Debian Codegraph @

Dekko/backend/mail/MailAddress.h

raw symbols SCIP
1 /* Copyright (C) 2016 - 2017 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef MAILADDRESS_H
19 #define MAILADDRESS_H
20
21 #include <QObject>
22 #include <QCryptographicHash>
23 #include "qmailaddress.h"
24
25 class MailAddress : public QObject
26 {
27 Q_OBJECT
28 Q_PROPERTY(QString name READ name NOTIFY addrDataChanged)
29 Q_PROPERTY(QString address READ address NOTIFY addrDataChanged)
30 Q_PROPERTY(QString completeAddress READ completeAddress NOTIFY addrDataChanged)
31 Q_PROPERTY(QString initials READ initials NOTIFY addrDataChanged)
32 Q_PROPERTY(bool isGroup READ isGroup NOTIFY addrDataChanged)
33 Q_PROPERTY(bool isNull READ isNull NOTIFY addrDataChanged)
34
35 Q_PROPERTY(bool isContact READ isContact NOTIFY addrDataChanged)
36 public:
37 explicit MailAddress(QObject *parent = 0);
38 MailAddress(QObject *parent, const QMailAddress &address);
39 MailAddress(QObject *parent, const QString &name, const QString &address);
40 MailAddress(QObject *parent, const QString &address);
41
42 QString name() const;
43 QString address() const;
44 QString completeAddress() const;
45 QString initials();
46 bool isGroup() const;
47 bool isNull() const;
48 bool isContact() const;
49
50 Q_INVOKABLE QString toRfc6068Mailto();
51
52 QMailAddress qMailAddress() const { return m_address; }
53
54 signals:
55 void addrDataChanged();
56
57 public slots:
58 void setAddress(const QMailAddress &address);
59
60 private:
61 QMailAddress m_address;
62 };
63
64 #endif // MAILADDRESS_H