| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |