Changeset View
Changeset View
Standalone View
Standalone View
src/addressee.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 55 | /** | |||
---|---|---|---|---|---|
78 | name() is the NAME type of RFC2426. It can be used as internal name for the | 78 | name() is the NAME type of RFC2426. It can be used as internal name for the | ||
79 | data enty, but shouldn't be used for displaying the data to the user. | 79 | data enty, but shouldn't be used for displaying the data to the user. | ||
80 | */ | 80 | */ | ||
81 | class KCONTACTS_EXPORT Addressee | 81 | class KCONTACTS_EXPORT Addressee | ||
82 | { | 82 | { | ||
83 | friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &); | 83 | friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &); | ||
84 | friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &); | 84 | friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &); | ||
85 | 85 | | |||
86 | Q_GADGET | ||||
87 | Q_PROPERTY(bool isEmpty READ isEmpty) | ||||
88 | Q_PROPERTY(QString uid READ uid WRITE setUid) | ||||
89 | Q_PROPERTY(QString name READ name WRITE setName) | ||||
90 | Q_PROPERTY(QString formattedName READ formattedName WRITE setFormattedName) | ||||
91 | Q_PROPERTY(QString familyName READ familyName WRITE setFamilyName) | ||||
92 | Q_PROPERTY(QString givenName READ givenName WRITE setGivenName) | ||||
93 | Q_PROPERTY(QString additionalName READ additionalName WRITE setAdditionalName) | ||||
94 | Q_PROPERTY(QString prefix READ prefix WRITE setPrefix) | ||||
95 | Q_PROPERTY(QString suffix READ suffix WRITE setSuffix) | ||||
96 | Q_PROPERTY(QString nickName READ nickName) | ||||
97 | Q_PROPERTY(QDateTime birthday READ birthday) // ### can't set this due to withTime argument | ||||
98 | Q_PROPERTY(bool birthdayHasTime READ birthdayHasTime) | ||||
99 | Q_PROPERTY(QString mailer READ mailer WRITE setMailer) | ||||
100 | Q_PROPERTY(KContacts::Geo geo READ geo WRITE setGeo) | ||||
101 | Q_PROPERTY(QString title READ title) | ||||
102 | Q_PROPERTY(QString role READ role) | ||||
103 | Q_PROPERTY(QString organization READ organization) | ||||
104 | Q_PROPERTY(QString department READ department WRITE setDepartment) | ||||
105 | Q_PROPERTY(QString note READ note WRITE setNote) | ||||
106 | Q_PROPERTY(QString productId READ productId WRITE setProductId) | ||||
107 | Q_PROPERTY(QDateTime revision READ revision) | ||||
108 | Q_PROPERTY(QString sortString READ sortString WRITE setSortString) | ||||
109 | Q_PROPERTY(KContacts::ResourceLocatorUrl url READ url WRITE setUrl) | ||||
110 | Q_PROPERTY(QString realName READ realName) | ||||
111 | Q_PROPERTY(QString assembledName READ assembledName) | ||||
112 | Q_PROPERTY(QString preferredEmail READ preferredEmail) | ||||
113 | Q_PROPERTY(QStringList categories READ categories WRITE setCategories) | ||||
114 | Q_PROPERTY(QStringList customs READ customs) | ||||
115 | Q_PROPERTY(bool changed READ changed WRITE setChanged) | ||||
116 | Q_PROPERTY(QDate anniversary READ anniversary WRITE setAnniversary) | ||||
117 | Q_PROPERTY(QString assistantsName READ assistantsName WRITE setAssistantsName) | ||||
118 | Q_PROPERTY(QString managersName READ managersName WRITE setManagersName) | ||||
119 | Q_PROPERTY(QString office READ office WRITE setOffice) | ||||
120 | Q_PROPERTY(QString profession READ profession WRITE setProfession) | ||||
121 | Q_PROPERTY(QString spousesName READ spousesName WRITE setSpousesName) | ||||
122 | | ||||
123 | // using variants for QML compatibility, can be changed to proper types once QML supports that | ||||
124 | Q_PROPERTY(QVariantList emails READ emailsVariant) | ||||
125 | Q_PROPERTY(QVariantList phoneNumbers READ phoneNumbersVariant) | ||||
126 | Q_PROPERTY(QVariantList addresses READ addressesVariant) | ||||
127 | | ||||
128 | // ### the following properties are still missing: | ||||
129 | // - logos, photos, sounds | ||||
130 | // - keys | ||||
131 | // - the list variants for nicks, titles, roles, orgs, urls | ||||
132 | // - timezone, secrecy, gender, kind, members, relationships, impps, language | ||||
133 | // - field groups, sourceUrls, calendarUrls | ||||
134 | | ||||
86 | public: | 135 | public: | ||
87 | /** | 136 | /** | ||
88 | A list of addressee objects | 137 | A list of addressee objects | ||
89 | */ | 138 | */ | ||
90 | typedef AddresseeList List; | 139 | typedef AddresseeList List; | ||
91 | /** | 140 | /** | ||
92 | A map from unique identifier to addressee. | 141 | A map from unique identifier to addressee. | ||
93 | 142 | | |||
▲ Show 20 Lines • Show All 1052 Lines • ▼ Show 20 Line(s) | |||||
1146 | /** | 1195 | /** | ||
1147 | * Set the contact's spouse's name. | 1196 | * Set the contact's spouse's name. | ||
1148 | * @note This is a non-standard extension using the @c X-SpousesName field. | 1197 | * @note This is a non-standard extension using the @c X-SpousesName field. | ||
1149 | * @since 5.12 | 1198 | * @since 5.12 | ||
1150 | */ | 1199 | */ | ||
1151 | void setSpousesName(const QString &spousesName); | 1200 | void setSpousesName(const QString &spousesName); | ||
1152 | 1201 | | |||
1153 | private: | 1202 | private: | ||
1203 | QVariantList emailsVariant() const; | ||||
1204 | QVariantList phoneNumbersVariant() const; | ||||
1205 | QVariantList addressesVariant() const; | ||||
1206 | | ||||
1154 | class Private; | 1207 | class Private; | ||
1155 | QSharedDataPointer<Private> d; | 1208 | QSharedDataPointer<Private> d; | ||
1156 | }; | 1209 | }; | ||
1157 | 1210 | | |||
1158 | KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &); | 1211 | KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &); | ||
1159 | KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &); | 1212 | KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &); | ||
1160 | } | 1213 | } | ||
1161 | 1214 | | |||
1162 | #define KCONTACTS_ADDRESSEE_METATYPE_DEFINED 1 | 1215 | #define KCONTACTS_ADDRESSEE_METATYPE_DEFINED 1 | ||
1163 | Q_DECLARE_METATYPE(KContacts::Addressee) | 1216 | Q_DECLARE_METATYPE(KContacts::Addressee) | ||
1164 | 1217 | | |||
1165 | #endif | 1218 | #endif |