| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtContacts module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at http://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 2.1 or version 3 as published by the Free |
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and |
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the |
| 22 | ** following information to ensure the GNU Lesser General Public License |
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and |
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
| 25 | ** |
| 26 | ** As a special exception, The Qt Company gives you certain additional |
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception |
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
| 29 | ** |
| 30 | ** $QT_END_LICENSE$ |
| 31 | ** |
| 32 | ****************************************************************************/ |
| 33 | |
| 34 | #include "qcontactdetails.h" |
| 35 | |
| 36 | #include <QtCore/qfile.h> |
| 37 | |
| 38 | #include "qcontactmanager.h" |
| 39 | #include "qcontactfilter.h" |
| 40 | #include "qcontacts.h" |
| 41 | #include "qcontactdetail_p.h" |
| 42 | |
| 43 | /* |
| 44 | When these conditions are satisfied, QStringLiteral is implemented by |
| 45 | gcc's statement-expression extension. However, in this file it will |
| 46 | not work, because "statement-expressions are not allowed outside functions |
| 47 | nor in template-argument lists". |
| 48 | |
| 49 | Fall back to the less-performant QLatin1String in this case. |
| 50 | */ |
| 51 | #if defined(QStringLiteral) && defined(QT_UNICODE_LITERAL_II) && defined(Q_CC_GNU) && !defined(Q_COMPILER_LAMBDA) |
| 52 | # undef QStringLiteral |
| 53 | # define QStringLiteral QLatin1String |
| 54 | #endif |
| 55 | |
| 56 | QT_BEGIN_NAMESPACE_CONTACTS |
| 57 | |
| 58 | /* We use offsetof to determine the offset to member fields |
| 59 | * in each builtin detail type private class. |
| 60 | * This is technically undefined behavior according to the |
| 61 | * CPP98 spec, as the classes in question are non-POD. |
| 62 | * However, they do not have any virtual functions, nor any |
| 63 | * private or protected non-static data, nor do they use |
| 64 | * multiple inheritance or virtual inheritance otherwise. |
| 65 | * As such, all modern compilers do implement the class |
| 66 | * layouts as if they were POD, and the offsetof macro |
| 67 | * does indeed work in our case. */ |
| 68 | QT_WARNING_PUSH |
| 69 | QT_WARNING_DISABLE_GCC("-Winvalid-offsetof" ) |
| 70 | |
| 71 | |
| 72 | /* template docs: |
| 73 | |
| 74 | XXXX::FieldYYYY: |
| 75 | The field key constant for the YYYY value. |
| 76 | \sa yyyy(), setYyyy() |
| 77 | |
| 78 | XXXX::Type: |
| 79 | The enum constant for the type identifier of QContactXXXX details. |
| 80 | |
| 81 | XXXX::FieldSubType |
| 82 | The field key constant for the field that stores the sub type of a XXXX. |
| 83 | \sa subType(), setSubType() |
| 84 | |
| 85 | XXXX::SubTypeYYYY |
| 86 | The predefined enum constant for a sub type value, |
| 87 | indicating blah blah blah. |
| 88 | \sa subTypes(), setSubTypes() |
| 89 | */ |
| 90 | |
| 91 | |
| 92 | /* ==================== QContactSyncTarget ======================= */ |
| 93 | |
| 94 | /*! |
| 95 | \class QContactSyncTarget |
| 96 | \brief The QContactSyncTarget class provides a sync target |
| 97 | for a contact. |
| 98 | |
| 99 | \inmodule QtContacts |
| 100 | |
| 101 | \ingroup contacts-details |
| 102 | */ |
| 103 | |
| 104 | class QContactSyncTargetPrivate : public QContactDetailBuiltinPrivate<QContactSyncTargetPrivate> |
| 105 | { |
| 106 | public: |
| 107 | QString m_syncTarget; |
| 108 | |
| 109 | enum { FieldCount = 1 }; |
| 110 | |
| 111 | QContactSyncTargetPrivate() : QContactDetailBuiltinPrivate<QContactSyncTargetPrivate>(QContactSyncTarget::Type) {} |
| 112 | }; |
| 113 | |
| 114 | template<> |
| 115 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactSyncTargetPrivate>::s_members[] = { |
| 116 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactSyncTargetPrivate, m_syncTarget) }, |
| 117 | }; |
| 118 | |
| 119 | /*! |
| 120 | \variable QContactSyncTarget::Type |
| 121 | The enum constant for the type identifier of QContactSyncTarget details. |
| 122 | */ |
| 123 | const QContactDetail::DetailType QContactSyncTarget::Type(QContactDetail::TypeSyncTarget); |
| 124 | |
| 125 | /*! |
| 126 | \enum QContactSyncTarget::SyncTargetField |
| 127 | This enumeration defines the fields supported by QContactSyncTarget. |
| 128 | \value FieldSyncTarget The value stored in this field is the contact to which syncronize. |
| 129 | \sa syncTarget(), setSyncTarget() |
| 130 | */ |
| 131 | |
| 132 | /*! |
| 133 | \fn QContactSyncTarget::syncTarget() const |
| 134 | |
| 135 | Returns the identifier of the backend store to which the contact |
| 136 | containing this detail should be synchronized. |
| 137 | */ |
| 138 | QString QContactSyncTarget::syncTarget() const |
| 139 | { |
| 140 | return reinterpret_cast<const QContactSyncTargetPrivate*>(d.constData())->memberValue<QString>(field: QContactSyncTarget::FieldSyncTarget); |
| 141 | } |
| 142 | |
| 143 | /*! |
| 144 | \fn QContactSyncTarget::setSyncTarget(const QString& syncTarget) |
| 145 | |
| 146 | Sets the identifier of the backend store to which the contact |
| 147 | containing this detail should be synchronized to \a syncTarget. |
| 148 | */ |
| 149 | void QContactSyncTarget::setSyncTarget(const QString &_value) |
| 150 | { |
| 151 | reinterpret_cast<QContactSyncTargetPrivate*>(d.data())->setMemberValue<QString>(field: QContactSyncTarget::FieldSyncTarget, value: _value); |
| 152 | } |
| 153 | |
| 154 | /* ==================== QContactEmailAddress ======================= */ |
| 155 | |
| 156 | |
| 157 | /*! |
| 158 | \class QContactEmailAddress |
| 159 | |
| 160 | \brief The QContactEmailAddress class contains an email address of |
| 161 | a contact. |
| 162 | \ingroup contacts-details |
| 163 | \inmodule QtContacts |
| 164 | */ |
| 165 | |
| 166 | class QContactEmailAddressPrivate : public QContactDetailBuiltinPrivate<QContactEmailAddressPrivate> |
| 167 | { |
| 168 | public: |
| 169 | QString m_emailAddress; |
| 170 | |
| 171 | enum { FieldCount = 1 }; |
| 172 | |
| 173 | QContactEmailAddressPrivate() : QContactDetailBuiltinPrivate<QContactEmailAddressPrivate>(QContactEmailAddress::Type) {} |
| 174 | }; |
| 175 | |
| 176 | template<> |
| 177 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactEmailAddressPrivate>::s_members[] = { |
| 178 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactEmailAddressPrivate, m_emailAddress) }, |
| 179 | }; |
| 180 | |
| 181 | /*! |
| 182 | \variable QContactEmailAddress::Type |
| 183 | The enum constant for the type identifier of QContactEmailAddress details. |
| 184 | */ |
| 185 | const QContactDetail::DetailType QContactEmailAddress::Type(QContactDetail::TypeEmailAddress); |
| 186 | |
| 187 | /*! |
| 188 | \enum QContactEmailAddress::EmailAddressField |
| 189 | |
| 190 | This enumeration defines the fields supported by QContactEmailAddress. |
| 191 | \value FieldEmailAddress The value stored in this field is the email address value. |
| 192 | \sa emailAddress(), setEmailAddress() |
| 193 | */ |
| 194 | |
| 195 | /*! |
| 196 | \fn QContactEmailAddress::emailAddress() const |
| 197 | Returns the email address of the contact which is stored in this detail. |
| 198 | */ |
| 199 | QString QContactEmailAddress::emailAddress() const |
| 200 | { |
| 201 | return reinterpret_cast<const QContactEmailAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactEmailAddress::FieldEmailAddress); |
| 202 | } |
| 203 | |
| 204 | /*! |
| 205 | \fn QContactEmailAddress::setEmailAddress(const QString& emailAddress) |
| 206 | Sets the email address of the contact which is stored in this detail to \a emailAddress. |
| 207 | */ |
| 208 | void QContactEmailAddress::setEmailAddress(const QString& _value) |
| 209 | { |
| 210 | reinterpret_cast<QContactEmailAddressPrivate*>(d.data())->setMemberValue<QString>(field: QContactEmailAddress::FieldEmailAddress, value: _value); |
| 211 | } |
| 212 | |
| 213 | /* ==================== QContactFamily ======================= */ |
| 214 | /*! |
| 215 | \class QContactFamily |
| 216 | \brief The QContactFamily class contains names of |
| 217 | family members of a contact. |
| 218 | \ingroup contacts-details |
| 219 | \inmodule QtContacts |
| 220 | */ |
| 221 | |
| 222 | class QContactFamilyPrivate : public QContactDetailBuiltinPrivate<QContactFamilyPrivate> |
| 223 | { |
| 224 | public: |
| 225 | QString m_spouse; |
| 226 | QStringList m_children; |
| 227 | |
| 228 | enum { FieldCount = 2 }; |
| 229 | |
| 230 | QContactFamilyPrivate() : QContactDetailBuiltinPrivate<QContactFamilyPrivate>(QContactFamily::Type) {} |
| 231 | }; |
| 232 | |
| 233 | template<> |
| 234 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactFamilyPrivate>::s_members[] = { |
| 235 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactFamilyPrivate, m_spouse) }, |
| 236 | { .type: QContactDetailBuiltinPrivateBase::StringList, offsetof(QContactFamilyPrivate, m_children) }, |
| 237 | }; |
| 238 | |
| 239 | /*! |
| 240 | \variable QContactFamily::Type |
| 241 | The enum constant for the type identifier of QContactFamily details. |
| 242 | */ |
| 243 | const QContactDetail::DetailType QContactFamily::Type(QContactDetail::TypeFamily); |
| 244 | |
| 245 | /*! |
| 246 | \enum QContactFamily::FamilyField |
| 247 | |
| 248 | This enumeration defines the fields supported by QContactFamily. |
| 249 | \value FieldSpouse The value of this field contains the name of a spouse. |
| 250 | \value FieldChildren The value of this field contains the names of children. |
| 251 | \sa spouse(), setSpouse() |
| 252 | \sa children(), setChildren() |
| 253 | */ |
| 254 | |
| 255 | /*! |
| 256 | \fn QContactFamily::spouse() const |
| 257 | Returns the name of the spouse of the contact which is stored in this detail. |
| 258 | */ |
| 259 | QString QContactFamily::spouse() const |
| 260 | { |
| 261 | return reinterpret_cast<const QContactFamilyPrivate*>(d.constData())->memberValue<QString>(field: QContactFamily::FieldSpouse); |
| 262 | } |
| 263 | |
| 264 | /*! |
| 265 | \fn QContactFamily::setSpouse(const QString& spouseName) |
| 266 | Sets the name of the spouse of the contact which is stored in this detail to \a spouseName. |
| 267 | */ |
| 268 | void QContactFamily::setSpouse(const QString& _value) |
| 269 | { |
| 270 | reinterpret_cast<QContactFamilyPrivate*>(d.data())->setMemberValue<QString>(field: QContactFamily::FieldSpouse, value: _value); |
| 271 | } |
| 272 | |
| 273 | /*! |
| 274 | \fn QContactFamily::children() const |
| 275 | Returns the names of the children of the contact which is stored in this detail. |
| 276 | */ |
| 277 | QStringList QContactFamily::children() const |
| 278 | { |
| 279 | return reinterpret_cast<const QContactFamilyPrivate*>(d.constData())->memberValue<QStringList>(field: QContactFamily::FieldChildren); |
| 280 | } |
| 281 | |
| 282 | /*! |
| 283 | \fn QContactFamily::setChildren(const QStringList& childrenNames) |
| 284 | Sets the names of the children of the contact which is stored in this detail to \a childrenNames. |
| 285 | */ |
| 286 | void QContactFamily::setChildren(const QStringList &_value) |
| 287 | { |
| 288 | reinterpret_cast<QContactFamilyPrivate*>(d.data())->setMemberValue<QStringList>(field: QContactFamily::FieldChildren, value: _value); |
| 289 | } |
| 290 | |
| 291 | /* ==================== QContactFavorite ======================= */ |
| 292 | /*! |
| 293 | \class QContactFavorite |
| 294 | \brief The QContactFavorite class indicates if a contact is a favorite contact as well as the |
| 295 | position it should appear in an ordered list of favorites. |
| 296 | \ingroup contacts-details |
| 297 | \inmodule QtContacts |
| 298 | */ |
| 299 | |
| 300 | class QContactFavoritePrivate : public QContactDetailBuiltinPrivate<QContactFavoritePrivate> |
| 301 | { |
| 302 | public: |
| 303 | bool m_favorite; |
| 304 | int m_index; |
| 305 | |
| 306 | enum { FieldCount = 2 }; |
| 307 | |
| 308 | QContactFavoritePrivate() : QContactDetailBuiltinPrivate<QContactFavoritePrivate>(QContactFavorite::Type), m_favorite(false), m_index(0) {} |
| 309 | }; |
| 310 | |
| 311 | template<> |
| 312 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactFavoritePrivate>::s_members[] = { |
| 313 | { .type: QContactDetailBuiltinPrivateBase::Bool, offsetof(QContactFavoritePrivate, m_favorite) }, |
| 314 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactFavoritePrivate, m_index) }, |
| 315 | }; |
| 316 | |
| 317 | /*! |
| 318 | \variable QContactFavorite::Type |
| 319 | The enum constant for the type identifier of QContactFavorite details. |
| 320 | */ |
| 321 | const QContactDetail::DetailType QContactFavorite::Type(QContactDetail::TypeFavorite); |
| 322 | |
| 323 | /*! |
| 324 | \enum QContactFavorite::FavoriteField |
| 325 | |
| 326 | This enumeration defines the fields supported by QContactFavorite. |
| 327 | \value FieldFavorite The value of this field indicates whether a contact is a favorite. |
| 328 | \value FieldIndex The value of this field contains the index of the favorite contact (which determines the order they appear). |
| 329 | \sa isFavorite(), setFavorite() |
| 330 | \sa index(), setIndex() |
| 331 | */ |
| 332 | |
| 333 | |
| 334 | /*! |
| 335 | \fn bool QContactFavorite::isFavorite() const |
| 336 | Returns true if the contact is a favorite, false otherwise. |
| 337 | */ |
| 338 | bool QContactFavorite::isFavorite() const |
| 339 | { |
| 340 | return reinterpret_cast<const QContactFavoritePrivate*>(d.constData())->memberValue<bool>(field: QContactFavorite::FieldFavorite); |
| 341 | } |
| 342 | /*! |
| 343 | \fn QContactFavorite::setFavorite(bool isFavorite) |
| 344 | If \a isFavorite is true, marks the contact as a favorite. Otherwise, marks the contact as not a favorite. |
| 345 | */ |
| 346 | void QContactFavorite::setFavorite(bool _value) |
| 347 | { |
| 348 | reinterpret_cast<QContactFavoritePrivate*>(d.data())->setMemberValue<bool>(field: QContactFavorite::FieldFavorite, value: _value); |
| 349 | } |
| 350 | |
| 351 | /*! |
| 352 | \fn int QContactFavorite::index() const |
| 353 | Returns the index of the favorite contact. |
| 354 | */ |
| 355 | int QContactFavorite::index() const |
| 356 | { |
| 357 | return reinterpret_cast<const QContactFavoritePrivate*>(d.constData())->memberValue<int>(field: QContactFavorite::FieldIndex); |
| 358 | } |
| 359 | |
| 360 | /*! |
| 361 | \fn QContactFavorite::setIndex(int index) |
| 362 | Sets the index of the favorite contact to \a index. |
| 363 | */ |
| 364 | void QContactFavorite::setIndex(int _value) |
| 365 | { |
| 366 | reinterpret_cast<QContactFavoritePrivate*>(d.data())->setMemberValue<int>(field: QContactFavorite::FieldIndex, value: _value); |
| 367 | } |
| 368 | |
| 369 | /*! |
| 370 | Returns a filter suitable for finding contacts which are marked |
| 371 | as favorite contacts. |
| 372 | */ |
| 373 | QContactFilter QContactFavorite::match() |
| 374 | { |
| 375 | QContactDetailFilter f; |
| 376 | f.setDetailType(type: QContactFavorite::Type, field: QContactFavorite::FieldFavorite); |
| 377 | f.setValue(true); |
| 378 | f.setMatchFlags(QContactFilter::MatchExactly); |
| 379 | |
| 380 | return f; |
| 381 | } |
| 382 | |
| 383 | /* ==================== QContactAnniversary ======================= */ |
| 384 | |
| 385 | /*! |
| 386 | \class QContactAnniversary |
| 387 | \brief The QContactAnniversary class contains an anniversary of a contact. |
| 388 | \ingroup contacts-details |
| 389 | \inmodule QtContacts |
| 390 | */ |
| 391 | |
| 392 | class QContactAnniversaryPrivate : public QContactDetailBuiltinPrivate<QContactAnniversaryPrivate> |
| 393 | { |
| 394 | public: |
| 395 | QString m_calendarId; |
| 396 | QDateTime m_originalDate; |
| 397 | QString m_event; |
| 398 | int m_subType; |
| 399 | |
| 400 | enum { FieldCount = 4 }; |
| 401 | |
| 402 | QContactAnniversaryPrivate() : QContactDetailBuiltinPrivate<QContactAnniversaryPrivate>(QContactAnniversary::Type), m_subType(0) {} |
| 403 | }; |
| 404 | |
| 405 | template<> |
| 406 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactAnniversaryPrivate>::s_members[] = { |
| 407 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAnniversaryPrivate, m_calendarId) }, |
| 408 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactAnniversaryPrivate, m_originalDate) }, |
| 409 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAnniversaryPrivate, m_event) }, |
| 410 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactAnniversaryPrivate, m_subType) }, |
| 411 | }; |
| 412 | |
| 413 | /*! |
| 414 | \variable QContactAnniversary::Type |
| 415 | The enum constant for the type identifier of QContactAnniversary details. |
| 416 | */ |
| 417 | const QContactDetail::DetailType QContactAnniversary::Type(QContactDetail::TypeAnniversary); |
| 418 | |
| 419 | /*! |
| 420 | \enum QContactAnniversary::AnniversaryField |
| 421 | |
| 422 | This enumeration defines the fields supported by QContactAnniversary. |
| 423 | |
| 424 | \value FieldCalendarId The value stored in this field is the id of the calendar event. |
| 425 | \value FieldOriginalDate The value stored in this field is either a date, or a date and time. Some managers |
| 426 | may support either type, while others may convert the value here |
| 427 | to a specific type (either discarding the time if only a date is |
| 428 | supported, or by using midnight if a time is not supplied). |
| 429 | \value FieldEvent The value stored in this field is the name of the event value. |
| 430 | \value FieldSubType The value stored in this field is the sub type of a QContactAnniversary. |
| 431 | \sa originalDate(), setOriginalDate(), originalDateTime(), setOriginalDateTime() |
| 432 | \sa event(), setEvent() |
| 433 | \sa calendarId(), setCalendarId() |
| 434 | */ |
| 435 | |
| 436 | /*! |
| 437 | \enum QContactAnniversary::SubType |
| 438 | |
| 439 | This enumeration defines the predefined enum constants for a sub type value of a QContactAnniversary. |
| 440 | |
| 441 | \value SubTypeWedding The value stored is a wedding anniversary. |
| 442 | \value SubTypeEngagement The value stored is the anniversary of an engagement. |
| 443 | \value SubTypeHouse The value stored is the anniversary of a new residence. |
| 444 | \value SubTypeEmployment The value stored is the anniversary of a start of employment. |
| 445 | \value SubTypeMemorial The value stored is the anniversary of an event of sentimental significance. |
| 446 | \sa subType(), setSubType() |
| 447 | */ |
| 448 | |
| 449 | /*! |
| 450 | \fn QContactAnniversary::originalDate() const |
| 451 | Returns the original date of the event stored in this detail. |
| 452 | If the original event occurrence stored is a QDateTime, this returns the date portion. |
| 453 | */ |
| 454 | QDate QContactAnniversary::originalDate() const |
| 455 | { |
| 456 | return (reinterpret_cast<const QContactAnniversaryPrivate*>(d.constData()))->memberValue<QDateTime>(field: QContactAnniversary::FieldOriginalDate).date(); |
| 457 | } |
| 458 | |
| 459 | /*! |
| 460 | \fn QContactAnniversary::setOriginalDate(const QDate& date) |
| 461 | Sets the original date of the event stored in this detail to \a date. |
| 462 | */ |
| 463 | void QContactAnniversary::setOriginalDate(const QDate& _value) |
| 464 | { |
| 465 | reinterpret_cast<QContactAnniversaryPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactAnniversary::FieldOriginalDate, value: QDateTime(_value)); |
| 466 | } |
| 467 | |
| 468 | /*! |
| 469 | \fn QContactAnniversary::originalDateTime() const |
| 470 | Returns the original date and time of the event stored in this detail. |
| 471 | If the original event occurrence stored is a QDate, this returns a QDateTime with the |
| 472 | time set to midnight. |
| 473 | */ |
| 474 | QDateTime QContactAnniversary::originalDateTime() const |
| 475 | { |
| 476 | return reinterpret_cast<const QContactAnniversaryPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactAnniversary::FieldOriginalDate); |
| 477 | } |
| 478 | |
| 479 | /*! |
| 480 | \fn QContactAnniversary::setOriginalDateTime(const QDateTime& dateTime) |
| 481 | Sets the original date and time of the event stored in this detail to \a dateTime. |
| 482 | */ |
| 483 | void QContactAnniversary::setOriginalDateTime(const QDateTime& _value) |
| 484 | { |
| 485 | reinterpret_cast<QContactAnniversaryPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactAnniversary::FieldOriginalDate, value: _value); |
| 486 | } |
| 487 | |
| 488 | /*! |
| 489 | \fn QContactAnniversary::calendarId() const |
| 490 | * Returns the identifier of the calendar entry associated with this anniversary. |
| 491 | */ |
| 492 | QString QContactAnniversary::calendarId() const |
| 493 | { |
| 494 | return reinterpret_cast<const QContactAnniversaryPrivate*>(d.constData())->memberValue<QString>(field: QContactAnniversary::FieldCalendarId); |
| 495 | } |
| 496 | |
| 497 | /*! |
| 498 | \fn QContactAnniversary::setCalendarId(const QString& calendarId) |
| 499 | Sets the identifier of the calendar entry associated with this anniversary to \a calendarId. |
| 500 | */ |
| 501 | void QContactAnniversary::setCalendarId(const QString& _value) |
| 502 | { |
| 503 | reinterpret_cast<QContactAnniversaryPrivate*>(d.data())->setMemberValue<QString>(field: QContactAnniversary::FieldCalendarId, value: _value); |
| 504 | } |
| 505 | |
| 506 | /*! |
| 507 | \fn QContactAnniversary::event() const |
| 508 | Returns the name of the event for which this detail contains information. |
| 509 | */ |
| 510 | QString QContactAnniversary::event() const |
| 511 | { |
| 512 | return reinterpret_cast<const QContactAnniversaryPrivate*>(d.constData())->memberValue<QString>(field: QContactAnniversary::FieldEvent); |
| 513 | } |
| 514 | |
| 515 | /*! |
| 516 | \fn QContactAnniversary::setEvent(const QString& event) |
| 517 | Sets the name of the event for which this detail contains information to \a event. |
| 518 | */ |
| 519 | void QContactAnniversary::setEvent(const QString& _value) |
| 520 | { |
| 521 | reinterpret_cast<QContactAnniversaryPrivate*>(d.data())->setMemberValue<QString>(field: QContactAnniversary::FieldEvent, value: _value); |
| 522 | } |
| 523 | |
| 524 | /*! |
| 525 | \fn QContactAnniversary::setSubType(const QContactAnniversary::SubType &subType) |
| 526 | Sets the subtype which this detail implements to be the given \a subType. |
| 527 | */ |
| 528 | void QContactAnniversary::setSubType(QContactAnniversary::SubType _value) |
| 529 | { |
| 530 | reinterpret_cast<QContactAnniversaryPrivate*>(d.data())->setMemberValue<int>(field: QContactAnniversary::FieldSubType, value: static_cast<int>(_value)); |
| 531 | } |
| 532 | |
| 533 | /*! |
| 534 | \fn QContactAnniversary::subType() const |
| 535 | Returns the subtype that this detail implements, if defined. |
| 536 | */ |
| 537 | QContactAnniversary::SubType QContactAnniversary::subType() const |
| 538 | { |
| 539 | return static_cast<QContactAnniversary::SubType>(reinterpret_cast<const QContactAnniversaryPrivate*>(d.constData())->memberValue<int>(field: QContactAnniversary::FieldSubType)); |
| 540 | } |
| 541 | |
| 542 | /* ==================== QContactAvatar ======================= */ |
| 543 | |
| 544 | /*! |
| 545 | \class QContactAvatar |
| 546 | \ingroup contacts-details |
| 547 | \inmodule QtContacts |
| 548 | \brief The QContactAvatar class contains avatar URLs of a contact. |
| 549 | |
| 550 | Users can specify avatar URLs for a contact using this detail. |
| 551 | Generally, a URL will specify the location of a full-sized |
| 552 | image (or video) avatar. Support for the detail is backend-specific; |
| 553 | some managers will automatically load the URL and synthesize a |
| 554 | (possibly scaled) thumbnail image for the contact and store it |
| 555 | on a platform-specific location in the file system. |
| 556 | |
| 557 | The URLs which are contained in the detail may point to a file or |
| 558 | resource whose content may dynamically change. The content of a resource |
| 559 | identified by a URL specified in a QContactAvatar detail is set by whoever |
| 560 | owns the resource which the URL identifies. |
| 561 | */ |
| 562 | |
| 563 | class QContactAvatarPrivate : public QContactDetailBuiltinPrivate<QContactAvatarPrivate> |
| 564 | { |
| 565 | public: |
| 566 | QUrl m_imageUrl; |
| 567 | QUrl m_videoUrl; |
| 568 | QString m_metaData; |
| 569 | |
| 570 | enum { FieldCount = 3 }; |
| 571 | |
| 572 | QContactAvatarPrivate() : QContactDetailBuiltinPrivate<QContactAvatarPrivate>(QContactAvatar::Type) {} |
| 573 | }; |
| 574 | |
| 575 | template<> |
| 576 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactAvatarPrivate>::s_members[] = { |
| 577 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactAvatarPrivate, m_imageUrl) }, |
| 578 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactAvatarPrivate, m_videoUrl) }, |
| 579 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAvatarPrivate, m_metaData) }, |
| 580 | }; |
| 581 | |
| 582 | /*! |
| 583 | \variable QContactAvatar::Type |
| 584 | The enum constant for the type identifier of QContactAvatar details. |
| 585 | */ |
| 586 | const QContactDetail::DetailType QContactAvatar::Type(QContactDetail::TypeAvatar); |
| 587 | |
| 588 | /*! |
| 589 | \enum QContactAvatar::AvatarField |
| 590 | |
| 591 | This enumeration defines the fields supported by QContactAvatar. |
| 592 | \value FieldImageUrl The value stored in this field contains the URL of the avatar image. |
| 593 | \value FieldVideoUrl The value stored in this field contains the URL of the video avatar. |
| 594 | \sa imageUrl(), setImageUrl() |
| 595 | \sa videoUrl(), setVideoUrl() |
| 596 | */ |
| 597 | |
| 598 | /*! |
| 599 | \fn QContactAvatar::imageUrl() const |
| 600 | Returns the url of an avatar image associated with the contact |
| 601 | */ |
| 602 | QUrl QContactAvatar::imageUrl() const |
| 603 | { |
| 604 | return reinterpret_cast<const QContactAvatarPrivate*>(d.constData())->memberValue<QUrl>(field: QContactAvatar::FieldImageUrl); |
| 605 | } |
| 606 | |
| 607 | /*! |
| 608 | \fn QContactAvatar::setImageUrl(const QUrl& imageUrl) |
| 609 | Sets the url of an avatar image associated with the contact to \a imageUrl |
| 610 | */ |
| 611 | void QContactAvatar::setImageUrl(const QUrl& _value) |
| 612 | { |
| 613 | reinterpret_cast<QContactAvatarPrivate*>(d.data())->setMemberValue<QUrl>(field: QContactAvatar::FieldImageUrl, value: _value); |
| 614 | } |
| 615 | |
| 616 | /*! |
| 617 | \fn QContactAvatar::videoUrl() const |
| 618 | Returns the url of an avatar video associated with the contact |
| 619 | */ |
| 620 | QUrl QContactAvatar::videoUrl() const |
| 621 | { |
| 622 | return reinterpret_cast<const QContactAvatarPrivate*>(d.constData())->memberValue<QUrl>(field: QContactAvatar::FieldVideoUrl); |
| 623 | } |
| 624 | |
| 625 | /*! |
| 626 | \fn QContactAvatar::setVideoUrl(const QUrl& videoUrl) |
| 627 | Sets the url of an avatar video associated with the contact to \a videoUrl |
| 628 | */ |
| 629 | void QContactAvatar::setVideoUrl(const QUrl& _value) |
| 630 | { |
| 631 | reinterpret_cast<QContactAvatarPrivate*>(d.data())->setMemberValue<QUrl>(field: QContactAvatar::FieldVideoUrl, value: _value); |
| 632 | } |
| 633 | |
| 634 | /*! |
| 635 | \fn QContactAvatar::metaData() const |
| 636 | Returns the meta data associated with the avatar url. |
| 637 | */ |
| 638 | QString QContactAvatar::metaData() const |
| 639 | { |
| 640 | return reinterpret_cast<const QContactAvatarPrivate*>(d.constData())->memberValue<QString>(field: QContactAvatar::FieldMetaData); |
| 641 | } |
| 642 | |
| 643 | /*! |
| 644 | \fn QContactAvatar::setMetaData(const QString& metaData) |
| 645 | Sets the meta data associated with the avatar url to \a metaData. |
| 646 | */ |
| 647 | void QContactAvatar::setMetaData(const QString& _value) |
| 648 | { |
| 649 | reinterpret_cast<QContactAvatarPrivate*>(d.data())->setMemberValue<QString>(field: QContactAvatar::FieldMetaData, value: _value); |
| 650 | } |
| 651 | |
| 652 | /* ==================== QContactAddress ======================= */ |
| 653 | |
| 654 | |
| 655 | /*! |
| 656 | \class QContactAddress |
| 657 | \brief The QContactAddress class contains an address of a contact. |
| 658 | \ingroup contacts-details |
| 659 | \inmodule QtContacts |
| 660 | |
| 661 | The fields in the QContactAddress class are based on the segments |
| 662 | of the ADR property of a Versit vCard file. |
| 663 | Versit \reg is a trademark of the Internet Mail Consortium. |
| 664 | */ |
| 665 | |
| 666 | class QContactAddressPrivate : public QContactDetailBuiltinPrivate<QContactAddressPrivate> |
| 667 | { |
| 668 | public: |
| 669 | QString m_street; |
| 670 | QString m_locality; |
| 671 | QString m_region; |
| 672 | QString m_postcode; |
| 673 | QString m_country; |
| 674 | QList<int> m_subTypes; |
| 675 | QString m_pobox; |
| 676 | |
| 677 | enum { FieldCount = 7 }; |
| 678 | |
| 679 | QContactAddressPrivate() : QContactDetailBuiltinPrivate<QContactAddressPrivate>(QContactAddress::Type) {} |
| 680 | }; |
| 681 | |
| 682 | template<> |
| 683 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactAddressPrivate>::s_members[] = { |
| 684 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_street) }, |
| 685 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_locality) }, |
| 686 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_region) }, |
| 687 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_postcode) }, |
| 688 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_country) }, |
| 689 | { .type: QContactDetailBuiltinPrivateBase::IntList, offsetof(QContactAddressPrivate, m_subTypes) }, |
| 690 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactAddressPrivate, m_pobox) }, |
| 691 | }; |
| 692 | |
| 693 | /*! |
| 694 | \variable QContactAddress::Type |
| 695 | The enum constant for the type identifier of QContactAddress details. |
| 696 | */ |
| 697 | const QContactDetail::DetailType QContactAddress::Type(QContactDetail::TypeAddress); |
| 698 | |
| 699 | /*! |
| 700 | \enum QContactAddress::AddressField |
| 701 | |
| 702 | This enumeration defines the fields supported by QContactAddress. |
| 703 | |
| 704 | \value FieldStreet The value stored in this field contains the street number and street name of the address. |
| 705 | \value FieldLocality The value stored in this field contains the name of the city, town or suburb of the address. |
| 706 | \value FieldRegion The value stored in this field contains the region segment. The region segment contains the |
| 707 | name or identifier of the state, province or region of the address. |
| 708 | \value FieldPostcode The value stored in this field contains the postcode segment. The postcode segment contains |
| 709 | the postal code for the address. |
| 710 | \value FieldCountry The value stored in this field contains the country segment. The country segment contains |
| 711 | the name of the country of the address. |
| 712 | \value FieldPostOfficeBox The value stored in this field contains the post office box segment. The post office box |
| 713 | segment contains the post office box identifier of the mailing address. |
| 714 | \value FieldSubTypes The value stored in this field contains the sub types of a QContactAddress. |
| 715 | \sa street(), setStreet() |
| 716 | \sa locality(), setLocality() |
| 717 | \sa region(), setRegion() |
| 718 | \sa postcode(), setPostcode() |
| 719 | \sa country(), setCountry() |
| 720 | \sa postOfficeBox(), setPostOfficeBox() |
| 721 | */ |
| 722 | |
| 723 | /*! |
| 724 | \enum QContactAddress::SubType |
| 725 | |
| 726 | This enumeration defines the predefined enum constants for a sub type value of a QContactAddress. |
| 727 | |
| 728 | \value SubTypeParcel The value stored contains an address for parcel delivery. |
| 729 | \value SubTypePostal The value stored contains an address for postal delivery. |
| 730 | \value SubTypeDomestic The value stored contains an address for domestic mail delivery. |
| 731 | \value SubTypeInternational The value stored contains an address for international mail delivery. |
| 732 | \sa subTypes(), setSubTypes() |
| 733 | */ |
| 734 | |
| 735 | /*! |
| 736 | \fn QContactAddress::postOfficeBox() const |
| 737 | Returns the post office box segment of the address stored in this detail. |
| 738 | */ |
| 739 | QString QContactAddress::postOfficeBox() const |
| 740 | { |
| 741 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldPostOfficeBox); |
| 742 | } |
| 743 | |
| 744 | /*! |
| 745 | \fn QContactAddress::setPostOfficeBox(const QString& postOfficeBox) |
| 746 | Sets the post office box segment of the address stored in this detail to \a postOfficeBox. |
| 747 | */ |
| 748 | void QContactAddress::setPostOfficeBox(const QString& _value) |
| 749 | { |
| 750 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldPostOfficeBox, value: _value); |
| 751 | } |
| 752 | |
| 753 | /*! |
| 754 | \fn QContactAddress::street() const |
| 755 | Returns the street segment of the address stored in this detail. |
| 756 | */ |
| 757 | QString QContactAddress::street() const |
| 758 | { |
| 759 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldStreet); |
| 760 | } |
| 761 | |
| 762 | /*! |
| 763 | \fn QContactAddress::setStreet(const QString& street) |
| 764 | Sets the street segment of the address stored in this detail to \a street. |
| 765 | */ |
| 766 | void QContactAddress::setStreet(const QString& _value) |
| 767 | { |
| 768 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldStreet, value: _value); |
| 769 | } |
| 770 | |
| 771 | /*! |
| 772 | \fn QContactAddress::locality() const |
| 773 | Returns the locality segment of the address stored in this detail. |
| 774 | */ |
| 775 | QString QContactAddress::locality() const |
| 776 | { |
| 777 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldLocality); |
| 778 | } |
| 779 | |
| 780 | /*! |
| 781 | \fn QContactAddress::setLocality(const QString& locality) |
| 782 | Sets the locality segment of the address stored in this detail to \a locality. |
| 783 | */ |
| 784 | void QContactAddress::setLocality(const QString& _value) |
| 785 | { |
| 786 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldLocality, value: _value); |
| 787 | } |
| 788 | |
| 789 | /*! |
| 790 | \fn QContactAddress::region() const |
| 791 | Returns the region segment of the address stored in this detail. |
| 792 | */ |
| 793 | QString QContactAddress::region() const |
| 794 | { |
| 795 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldRegion); |
| 796 | } |
| 797 | |
| 798 | /*! |
| 799 | \fn QContactAddress::setRegion(const QString& region) |
| 800 | Sets the region segment of the address stored in this detail to \a region. |
| 801 | */ |
| 802 | void QContactAddress::setRegion(const QString& _value) |
| 803 | { |
| 804 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldRegion, value: _value); |
| 805 | } |
| 806 | |
| 807 | /*! |
| 808 | \fn QContactAddress::postcode() const |
| 809 | Returns the postcode segment of the address stored in this detail. |
| 810 | */ |
| 811 | QString QContactAddress::postcode() const |
| 812 | { |
| 813 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldPostcode); |
| 814 | } |
| 815 | |
| 816 | /*! |
| 817 | \fn QContactAddress::setPostcode(const QString& postcode) |
| 818 | Sets the postcode segment of the address stored in this detail to \a postcode. |
| 819 | */ |
| 820 | void QContactAddress::setPostcode(const QString& _value) |
| 821 | { |
| 822 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldPostcode, value: _value); |
| 823 | } |
| 824 | |
| 825 | /*! |
| 826 | \fn QContactAddress::country() const |
| 827 | Returns the country segment of the address stored in this detail. |
| 828 | */ |
| 829 | QString QContactAddress::country() const |
| 830 | { |
| 831 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QString>(field: QContactAddress::FieldCountry); |
| 832 | } |
| 833 | |
| 834 | /*! |
| 835 | \fn QContactAddress::setCountry(const QString& country) |
| 836 | Sets the country segment of the address stored in this detail to \a country. |
| 837 | */ |
| 838 | void QContactAddress::setCountry(const QString& _value) |
| 839 | { |
| 840 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldCountry, value: _value); |
| 841 | } |
| 842 | |
| 843 | /*! |
| 844 | \fn QContactAddress::setSubTypes(const QList<int> &subTypes) |
| 845 | Sets the subtypes which this detail implements to be those contained in the list of given \a subTypes. |
| 846 | */ |
| 847 | void QContactAddress::setSubTypes(const QList<int>& _value) |
| 848 | { |
| 849 | reinterpret_cast<QContactAddressPrivate*>(d.data())->setMemberValue(field: QContactAddress::FieldSubTypes, value: _value); |
| 850 | } |
| 851 | |
| 852 | /*! |
| 853 | \fn QContactAddress::subTypes() const |
| 854 | Returns the list of subtypes that this detail implements. |
| 855 | */ |
| 856 | QList<int> QContactAddress::subTypes() const |
| 857 | { |
| 858 | return reinterpret_cast<const QContactAddressPrivate*>(d.constData())->memberValue<QList<int> >(field: QContactAddress::FieldSubTypes); |
| 859 | } |
| 860 | |
| 861 | |
| 862 | /*! |
| 863 | Returns a filter suitable for finding contacts with an address which |
| 864 | contains the given \a subString in any of its fields. |
| 865 | */ |
| 866 | QContactFilter QContactAddress::match(const QString &subString) |
| 867 | { |
| 868 | QContactDetailFilter f1; |
| 869 | f1.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldStreet); |
| 870 | f1.setValue(subString); |
| 871 | f1.setMatchFlags(QContactFilter::MatchContains); |
| 872 | |
| 873 | QContactDetailFilter f2; |
| 874 | f2.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldLocality); |
| 875 | f2.setValue(subString); |
| 876 | f2.setMatchFlags(QContactFilter::MatchContains); |
| 877 | |
| 878 | QContactDetailFilter f3; |
| 879 | f3.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldRegion); |
| 880 | f3.setValue(subString); |
| 881 | f3.setMatchFlags(QContactFilter::MatchContains); |
| 882 | |
| 883 | QContactDetailFilter f4; |
| 884 | f4.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldPostcode); |
| 885 | f4.setValue(subString); |
| 886 | f4.setMatchFlags(QContactFilter::MatchContains); |
| 887 | |
| 888 | QContactDetailFilter f5; |
| 889 | f5.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldCountry); |
| 890 | f5.setValue(subString); |
| 891 | f5.setMatchFlags(QContactFilter::MatchContains); |
| 892 | |
| 893 | QContactDetailFilter f6; |
| 894 | f6.setDetailType(type: QContactAddress::Type, field: QContactAddress::FieldPostOfficeBox); |
| 895 | f6.setValue(subString); |
| 896 | f6.setMatchFlags(QContactFilter::MatchContains); |
| 897 | |
| 898 | return (f1 | f2 | f3 | f4 | f5 | f6); |
| 899 | } |
| 900 | |
| 901 | /* ==================== QContactUrl ======================= */ |
| 902 | |
| 903 | /*! |
| 904 | \class QContactUrl |
| 905 | \brief The QContactUrl class contains a url associated with |
| 906 | a contact. |
| 907 | \ingroup contacts-details |
| 908 | \inmodule QtContacts |
| 909 | */ |
| 910 | |
| 911 | class QContactUrlPrivate : public QContactDetailBuiltinPrivate<QContactUrlPrivate> |
| 912 | { |
| 913 | public: |
| 914 | QString m_url; |
| 915 | int m_subType; |
| 916 | |
| 917 | enum { FieldCount = 2 }; |
| 918 | |
| 919 | QContactUrlPrivate() : QContactDetailBuiltinPrivate<QContactUrlPrivate>(QContactUrl::Type), m_subType(0) {} |
| 920 | }; |
| 921 | |
| 922 | template<> |
| 923 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactUrlPrivate>::s_members[] = { |
| 924 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactUrlPrivate, m_url) }, |
| 925 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactUrlPrivate, m_subType) }, |
| 926 | }; |
| 927 | |
| 928 | /*! |
| 929 | \variable QContactUrl::Type |
| 930 | The enum constant for the type identifier of QContactUrl details. |
| 931 | */ |
| 932 | const QContactDetail::DetailType QContactUrl::Type(QContactDetail::TypeUrl); |
| 933 | |
| 934 | /*! |
| 935 | \enum QContactUrl::UrlField |
| 936 | |
| 937 | This enumeration defines the fields supported by QContactUrl. |
| 938 | |
| 939 | \value FieldUrl The value stored in this field contains the URL. |
| 940 | \value FieldSubType The value stored in this field contains the sub type of a QContactUrl. |
| 941 | \sa url(), setUrl() |
| 942 | */ |
| 943 | |
| 944 | /*! |
| 945 | \enum QContactUrl::SubType |
| 946 | |
| 947 | This enumeration defines the predefined enum constants for a sub type value of a QContactUrl. |
| 948 | |
| 949 | \value SubTypeHomePage The value stored is a contact's home page. |
| 950 | \value SubTypeFavourite The value stored is a contact's favourite URLs (or bookmarks). |
| 951 | \value SubTypeBlog The value stored is one of the contact's blogs. |
| 952 | \sa subType(), setSubType() |
| 953 | */ |
| 954 | |
| 955 | /*! |
| 956 | \fn QContactUrl::setUrl(const QUrl& url) |
| 957 | Sets the url stored in this detail to the string representation |
| 958 | of the given \a url. |
| 959 | */ |
| 960 | void QContactUrl::setUrl(const QUrl& _value) |
| 961 | { |
| 962 | reinterpret_cast<QContactUrlPrivate*>(d.data())->setMemberValue<QString>(field: QContactUrl::FieldUrl, value: _value.toString()); |
| 963 | } |
| 964 | |
| 965 | /*! |
| 966 | \fn QContactUrl::url() const |
| 967 | Returns the url stored in this detail. |
| 968 | */ |
| 969 | QString QContactUrl::url() const |
| 970 | { |
| 971 | return reinterpret_cast<const QContactUrlPrivate*>(d.constData())->memberValue<QString>(field: QContactUrl::FieldUrl); |
| 972 | } |
| 973 | |
| 974 | /*! |
| 975 | \fn QContactUrl::setUrl(const QString& url) |
| 976 | Sets the url stored in this detail to \a url. |
| 977 | */ |
| 978 | void QContactUrl::setUrl(const QString& _value) |
| 979 | { |
| 980 | reinterpret_cast<QContactUrlPrivate*>(d.data())->setMemberValue<QString>(field: QContactUrl::FieldUrl, value: _value); |
| 981 | } |
| 982 | |
| 983 | /*! |
| 984 | \fn QContactUrl::setSubType(const QContactUrl::SubType& subType) |
| 985 | Sets the subtype which this detail implements to be the given \a subType. |
| 986 | */ |
| 987 | void QContactUrl::setSubType(QContactUrl::SubType _value) |
| 988 | { |
| 989 | reinterpret_cast<QContactUrlPrivate*>(d.data())->setMemberValue<int>(field: QContactUrl::FieldSubType, value: static_cast<int>(_value)); |
| 990 | } |
| 991 | |
| 992 | /*! |
| 993 | \fn QContactUrl::subType() const |
| 994 | Returns the subtype that this detail implements, if defined. |
| 995 | */ |
| 996 | QContactUrl::SubType QContactUrl::subType() const |
| 997 | { |
| 998 | return static_cast<QContactUrl::SubType>(reinterpret_cast<const QContactUrlPrivate*>(d.constData())->memberValue<int>(field: QContactUrl::FieldSubType)); |
| 999 | } |
| 1000 | |
| 1001 | /* ==================== QContactPhonenumber ======================= */ |
| 1002 | |
| 1003 | /*! |
| 1004 | \class QContactPhoneNumber |
| 1005 | \brief The QContactPhoneNumber class provides a phone number |
| 1006 | of a contact. |
| 1007 | \ingroup contacts-details |
| 1008 | \inmodule QtContacts |
| 1009 | */ |
| 1010 | |
| 1011 | class QContactPhoneNumberPrivate : public QContactDetailBuiltinPrivate<QContactPhoneNumberPrivate> |
| 1012 | { |
| 1013 | public: |
| 1014 | QString m_number; |
| 1015 | QString m_normalizedNumber; |
| 1016 | QList<int> m_subTypes; |
| 1017 | |
| 1018 | enum { FieldCount = 3 }; |
| 1019 | |
| 1020 | QContactPhoneNumberPrivate() : QContactDetailBuiltinPrivate<QContactPhoneNumberPrivate>(QContactPhoneNumber::Type) {} |
| 1021 | }; |
| 1022 | |
| 1023 | template<> |
| 1024 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactPhoneNumberPrivate>::s_members[] = { |
| 1025 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactPhoneNumberPrivate, m_number) }, |
| 1026 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactPhoneNumberPrivate, m_normalizedNumber) }, |
| 1027 | { .type: QContactDetailBuiltinPrivateBase::IntList, offsetof(QContactPhoneNumberPrivate, m_subTypes) }, |
| 1028 | }; |
| 1029 | |
| 1030 | |
| 1031 | /*! |
| 1032 | \variable QContactPhoneNumber::Type |
| 1033 | The enum constant for the type identifier of QContactPhoneNumber details. |
| 1034 | */ |
| 1035 | const QContactDetail::DetailType QContactPhoneNumber::Type(QContactDetail::TypePhoneNumber); |
| 1036 | |
| 1037 | /*! |
| 1038 | \enum QContactPhoneNumber::PhoneNumberField |
| 1039 | |
| 1040 | This enumeration defines the fields supported by QContactPhoneNumber. |
| 1041 | |
| 1042 | \value FieldNumber The value stored in this field contains the phone number. |
| 1043 | \value FieldSubTypes The value stored in this field contains the sub types of a QContactPhoneNumber. |
| 1044 | \sa number(), setNumber() |
| 1045 | */ |
| 1046 | |
| 1047 | /*! |
| 1048 | \enum QContactPhoneNumber::SubType |
| 1049 | |
| 1050 | This enumeration defines the predefined enum constants for a sub type value of a QContactPhoneNumber. |
| 1051 | |
| 1052 | \value SubTypeLandline The value stored is a landline number. |
| 1053 | \value SubTypeMobile The value stored is a mobile (cellular) number. |
| 1054 | \value SubTypeFax The value stored is a fax number. |
| 1055 | \value SubTypePager The value stored is a pager number. |
| 1056 | \value SubTypeCar The value stored is a car phone. |
| 1057 | \value SubTypeBulletinBoardSystem The value stored is a bulletin board system. |
| 1058 | \value SubTypeVoice The value stored is indicating this phone number supports voice transmission. |
| 1059 | \value SubTypeModem The value stored is indicating this phone number supports data transmission. |
| 1060 | \value SubTypeVideo The value stored is indicating this phone number supports video transmission. |
| 1061 | \value SubTypeMessagingCapable The value stored is indicating this phone number supports messaging services. |
| 1062 | \value SubTypeAssistant The value stored is indicating this phone number is the number of an assistant. |
| 1063 | \value SubTypeDtmfMenu The value stored is indicating this phone number supports DTMF-controlled voice menu navigation. |
| 1064 | \sa subTypes(), setSubTypes() |
| 1065 | */ |
| 1066 | |
| 1067 | /*! |
| 1068 | \fn QContactPhoneNumber::number() const |
| 1069 | Returns the phone number stored in this detail. |
| 1070 | */ |
| 1071 | QString QContactPhoneNumber::number() const |
| 1072 | { |
| 1073 | return reinterpret_cast<const QContactPhoneNumberPrivate*>(d.constData())->memberValue<QString>(field: QContactPhoneNumber::FieldNumber); |
| 1074 | } |
| 1075 | |
| 1076 | /*! |
| 1077 | \fn QContactPhoneNumber::setNumber(const QString& number) |
| 1078 | Sets the phone number stored in this detail to \a number. |
| 1079 | */ |
| 1080 | void QContactPhoneNumber::setNumber(const QString& _value) |
| 1081 | { |
| 1082 | reinterpret_cast<QContactPhoneNumberPrivate*>(d.data())->setMemberValue<QString>(field: QContactPhoneNumber::FieldNumber, value: _value); |
| 1083 | } |
| 1084 | |
| 1085 | /*! |
| 1086 | \fn QContactPhoneNumber::normalizedNumber() const |
| 1087 | Returns the normalized version of the phone number stored in this detail. |
| 1088 | This value may be backend-generated, and may not be exportable. |
| 1089 | */ |
| 1090 | QString QContactPhoneNumber::normalizedNumber() const |
| 1091 | { |
| 1092 | return reinterpret_cast<const QContactPhoneNumberPrivate*>(d.constData())->memberValue<QString>(field: QContactPhoneNumber::FieldNormalizedNumber); |
| 1093 | } |
| 1094 | |
| 1095 | /*! |
| 1096 | \fn QContactPhoneNumber::setNormalizedNumber(const QString& normalizedNumber) |
| 1097 | Sets the normalized version of the phone number stored in this detail to \a normalizedNumber. |
| 1098 | */ |
| 1099 | void QContactPhoneNumber::setNormalizedNumber(const QString& _value) |
| 1100 | { |
| 1101 | reinterpret_cast<QContactPhoneNumberPrivate*>(d.data())->setMemberValue<QString>(field: QContactPhoneNumber::FieldNormalizedNumber, value: _value); |
| 1102 | } |
| 1103 | |
| 1104 | /*! |
| 1105 | \fn QContactPhoneNumber::setSubTypes(const QList<int>& subTypes) |
| 1106 | Sets the subtypes which this detail implements to be those contained in the list of given \a subTypes |
| 1107 | */ |
| 1108 | void QContactPhoneNumber::setSubTypes(const QList<int>& _value) |
| 1109 | { |
| 1110 | reinterpret_cast<QContactPhoneNumberPrivate*>(d.data())->setMemberValue<QList<int> >(field: QContactPhoneNumber::FieldSubTypes, value: _value); |
| 1111 | } |
| 1112 | |
| 1113 | /*! |
| 1114 | \fn QContactPhoneNumber::subTypes() const |
| 1115 | Returns the list of subtypes that this detail implements. |
| 1116 | */ |
| 1117 | QList<int> QContactPhoneNumber::subTypes() const |
| 1118 | { |
| 1119 | return reinterpret_cast<const QContactPhoneNumberPrivate*>(d.constData())->memberValue<QList<int> >(field: QContactPhoneNumber::FieldSubTypes); |
| 1120 | } |
| 1121 | |
| 1122 | /* ==================== QContactBirthday ======================= */ |
| 1123 | |
| 1124 | /*! |
| 1125 | \class QContactBirthday |
| 1126 | \brief The QContactBirthday class contains a birthday of a contact. |
| 1127 | \ingroup contacts-details |
| 1128 | \inmodule QtContacts |
| 1129 | */ |
| 1130 | |
| 1131 | class QContactBirthdayPrivate : public QContactDetailBuiltinPrivate<QContactBirthdayPrivate> |
| 1132 | { |
| 1133 | public: |
| 1134 | QDateTime m_birthday; |
| 1135 | QString m_calendarId; |
| 1136 | |
| 1137 | enum { FieldCount = 2 }; |
| 1138 | |
| 1139 | QContactBirthdayPrivate() : QContactDetailBuiltinPrivate<QContactBirthdayPrivate>(QContactBirthday::Type) {} |
| 1140 | }; |
| 1141 | |
| 1142 | template<> |
| 1143 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactBirthdayPrivate>::s_members[] = { |
| 1144 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactBirthdayPrivate, m_birthday) }, |
| 1145 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactBirthdayPrivate, m_calendarId) }, |
| 1146 | }; |
| 1147 | |
| 1148 | /*! |
| 1149 | \variable QContactBirthday::Type |
| 1150 | The enum constant for the type identifier of QContactBirthday details. |
| 1151 | */ |
| 1152 | const QContactDetail::DetailType QContactBirthday::Type(QContactDetail::TypeBirthday); |
| 1153 | |
| 1154 | /*! |
| 1155 | \enum QContactBirthday::BirthdayField |
| 1156 | This enumeration defines the fields supported by QContactBirthday. |
| 1157 | \value FieldBirthday The value stored in this field contains the birthday date. |
| 1158 | This field is either a date, or a date and time. Some managers |
| 1159 | may support either type, while others may convert the value here |
| 1160 | to a specific type (either discarding the time if only a date is |
| 1161 | supported, or by using midnight if a time is not supplied). |
| 1162 | \value FieldCalendarId The value stored in this field contains the id of the calendar event. |
| 1163 | \sa date(), setDate(), dateTime(), setDateTime() |
| 1164 | \sa calendarId(), setCalendarId() |
| 1165 | */ |
| 1166 | |
| 1167 | /*! |
| 1168 | \fn QContactBirthday::date() const |
| 1169 | Returns the date of the birthday which is stored in this detail. |
| 1170 | If the birthday stored is a QDateTime, this returns the date portion. |
| 1171 | */ |
| 1172 | QDate QContactBirthday::date() const |
| 1173 | { |
| 1174 | return reinterpret_cast<const QContactBirthdayPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactBirthday::FieldBirthday).date(); |
| 1175 | } |
| 1176 | |
| 1177 | /*! |
| 1178 | \fn QContactBirthday::setDate(const QDate& date) |
| 1179 | Sets the date of the birthday which is stored in this detail to \a date. |
| 1180 | */ |
| 1181 | void QContactBirthday::setDate(const QDate& _value) |
| 1182 | { |
| 1183 | reinterpret_cast<QContactBirthdayPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactBirthday::FieldBirthday, value: QDateTime(_value)); |
| 1184 | } |
| 1185 | |
| 1186 | /*! |
| 1187 | \fn QContactBirthday::dateTime() const |
| 1188 | Returns the date and time of the birthday which is stored in this detail. |
| 1189 | If the birthday stored is a QDate, this returns a QDateTime with the |
| 1190 | time set to midnight. |
| 1191 | */ |
| 1192 | QDateTime QContactBirthday::dateTime() const |
| 1193 | { |
| 1194 | return reinterpret_cast<const QContactBirthdayPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactBirthday::FieldBirthday); |
| 1195 | } |
| 1196 | |
| 1197 | /*! |
| 1198 | \fn QContactBirthday::setDateTime(const QDateTime& dateTime) |
| 1199 | Sets the date and time of the birthday which is stored in this detail to \a dateTime. |
| 1200 | */ |
| 1201 | void QContactBirthday::setDateTime(const QDateTime& _value) |
| 1202 | { |
| 1203 | reinterpret_cast<QContactBirthdayPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactBirthday::FieldBirthday, value: _value); |
| 1204 | } |
| 1205 | |
| 1206 | |
| 1207 | /*! |
| 1208 | \fn QContactBirthday::calendarId() const |
| 1209 | * Returns the identifier of the calendar entry associated with this birthday. |
| 1210 | */ |
| 1211 | QString QContactBirthday::calendarId() const |
| 1212 | { |
| 1213 | return reinterpret_cast<const QContactBirthdayPrivate*>(d.constData())->memberValue<QString>(field: QContactBirthday::FieldCalendarId); |
| 1214 | } |
| 1215 | |
| 1216 | /*! |
| 1217 | \fn QContactBirthday::setCalendarId(const QString& calendarId) |
| 1218 | Sets the identifier of the calendar entry associated with this birthday to \a calendarId. |
| 1219 | */ |
| 1220 | void QContactBirthday::setCalendarId(const QString& _value) |
| 1221 | { |
| 1222 | reinterpret_cast<QContactBirthdayPrivate*>(d.data())->setMemberValue<QString>(field: QContactBirthday::FieldCalendarId, value: _value); |
| 1223 | } |
| 1224 | |
| 1225 | /* ==================== QContactDisplayLabel ======================= */ |
| 1226 | |
| 1227 | /*! |
| 1228 | \class QContactDisplayLabel |
| 1229 | \brief The QContactDisplayLabel class contains a displayLabel of a contact. |
| 1230 | \ingroup contacts-details |
| 1231 | \inmodule QtContacts |
| 1232 | */ |
| 1233 | |
| 1234 | class QContactDisplayLabelPrivate : public QContactDetailBuiltinPrivate<QContactDisplayLabelPrivate> |
| 1235 | { |
| 1236 | public: |
| 1237 | QString m_label; |
| 1238 | |
| 1239 | enum { FieldCount = 1 }; |
| 1240 | |
| 1241 | QContactDisplayLabelPrivate() : QContactDetailBuiltinPrivate<QContactDisplayLabelPrivate>(QContactDisplayLabel::Type) {} |
| 1242 | }; |
| 1243 | |
| 1244 | template<> |
| 1245 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactDisplayLabelPrivate>::s_members[] = { |
| 1246 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactDisplayLabelPrivate, m_label) }, |
| 1247 | }; |
| 1248 | |
| 1249 | /*! |
| 1250 | \variable QContactDisplayLabel::Type |
| 1251 | The enum constant for the type identifier of QContactDisplayLabel details. |
| 1252 | */ |
| 1253 | const QContactDetail::DetailType QContactDisplayLabel::Type(QContactType::TypeDisplayLabel); |
| 1254 | |
| 1255 | /*! |
| 1256 | \enum QContactDisplayLabel::DisplayLabelField |
| 1257 | This enumeration defines the fields supported by QContactDisplayLabel. |
| 1258 | \value FieldLabel The value stored in this field contains the displaylabel. |
| 1259 | \sa label(), setLabel() |
| 1260 | */ |
| 1261 | |
| 1262 | /*! |
| 1263 | \fn QContactDisplayLabel::setLabel(const QString& displayLabel) |
| 1264 | Sets the displayLabel of the contact which is stored in this detail to \a displayLabel. |
| 1265 | displayLabel can be for example the first name of a contact. |
| 1266 | */ |
| 1267 | void QContactDisplayLabel::setLabel(const QString& _value) |
| 1268 | { |
| 1269 | reinterpret_cast<QContactDisplayLabelPrivate*>(d.data())->setMemberValue<QString>(field: QContactDisplayLabel::FieldLabel, value: _value); |
| 1270 | } |
| 1271 | |
| 1272 | /*! |
| 1273 | \fn QContactDisplayLabel::label() const |
| 1274 | Returns the displayLabel of the contact which is stored in this detail. |
| 1275 | */ |
| 1276 | QString QContactDisplayLabel::label() const |
| 1277 | { |
| 1278 | return reinterpret_cast<const QContactDisplayLabelPrivate*>(d.constData())->memberValue<QString>(field: QContactDisplayLabel::FieldLabel); |
| 1279 | } |
| 1280 | |
| 1281 | |
| 1282 | /* ==================== QContactGender ======================= */ |
| 1283 | |
| 1284 | /*! |
| 1285 | \class QContactGender |
| 1286 | \brief The QContactGender class contains the gender of a contact. |
| 1287 | \ingroup contacts-details |
| 1288 | \inmodule QtContacts |
| 1289 | */ |
| 1290 | |
| 1291 | class QContactGenderPrivate : public QContactDetailBuiltinPrivate<QContactGenderPrivate> |
| 1292 | { |
| 1293 | public: |
| 1294 | int m_gender; |
| 1295 | |
| 1296 | enum { FieldCount = 1 }; |
| 1297 | |
| 1298 | QContactGenderPrivate() : QContactDetailBuiltinPrivate<QContactGenderPrivate>(QContactGender::Type), m_gender(0) {} |
| 1299 | }; |
| 1300 | |
| 1301 | template<> |
| 1302 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactGenderPrivate>::s_members[] = { |
| 1303 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactGenderPrivate, m_gender) }, |
| 1304 | }; |
| 1305 | |
| 1306 | /*! |
| 1307 | \variable QContactGender::Type |
| 1308 | The enum constant for the type identifier of QContactGender details. |
| 1309 | */ |
| 1310 | const QContactDetail::DetailType QContactGender::Type(QContactDetail::TypeGender); |
| 1311 | |
| 1312 | /*! |
| 1313 | \enum QContactGender::GenderField |
| 1314 | This enumeration defines the fields supported by QContactGender. |
| 1315 | \value FieldGender The value stored in this field contains the gender. |
| 1316 | \sa gender(), setGender() |
| 1317 | */ |
| 1318 | |
| 1319 | /*! |
| 1320 | \enum QContactGender::GenderType |
| 1321 | This enumeration defines built-in gender values |
| 1322 | \value GenderUnspecified The value that identifies this contact as being of unspecified gender. |
| 1323 | \value GenderMale The value that identifies this contact as being male. |
| 1324 | \value GenderFemale The value that identifies this contact as being female. |
| 1325 | \sa gender(), setGender() |
| 1326 | */ |
| 1327 | |
| 1328 | /*! |
| 1329 | \fn QContactGender::gender() const |
| 1330 | |
| 1331 | Returns the gender of the contact, as stored in this detail. The |
| 1332 | possible values for the value stored are "Male", "Female" and |
| 1333 | "Unspecified". |
| 1334 | */ |
| 1335 | QContactGender::GenderType QContactGender::gender() const |
| 1336 | { |
| 1337 | return static_cast<QContactGender::GenderType>(reinterpret_cast<const QContactGenderPrivate*>(d.constData())->memberValue<int>(field: QContactGender::FieldGender)); |
| 1338 | } |
| 1339 | |
| 1340 | /*! |
| 1341 | \fn QContactGender::setGender(GenderType gender) |
| 1342 | |
| 1343 | Sets the gender of the contact (as stored in this detail) to \a |
| 1344 | gender, if \a gender is either GenderMale or GenderFemale, otherwise sets |
| 1345 | it to GenderUnspecified. |
| 1346 | */ |
| 1347 | void QContactGender::setGender(QContactGender::GenderType _value) |
| 1348 | { |
| 1349 | reinterpret_cast<QContactGenderPrivate*>(d.data())->setMemberValue<int>(field: QContactGender::FieldGender, value: static_cast<int>(_value)); |
| 1350 | } |
| 1351 | |
| 1352 | /* ==================== QContactGeolocation ======================= */ |
| 1353 | |
| 1354 | /*! |
| 1355 | \class QContactGeoLocation |
| 1356 | \brief The QContactGeoLocation class contains a global location |
| 1357 | coordinate associated with a contact. |
| 1358 | \ingroup contacts-details |
| 1359 | \inmodule QtContacts |
| 1360 | */ |
| 1361 | |
| 1362 | class QContactGeoLocationPrivate : public QContactDetailBuiltinPrivate<QContactGeoLocationPrivate> |
| 1363 | { |
| 1364 | public: |
| 1365 | QString m_label; |
| 1366 | double m_latitude; |
| 1367 | double m_longitude; |
| 1368 | double m_accuracy; |
| 1369 | double m_altitude; |
| 1370 | double m_altitudeAccuracy; |
| 1371 | double m_heading; |
| 1372 | double m_speed; |
| 1373 | QDateTime m_timestamp; |
| 1374 | |
| 1375 | enum { FieldCount = 9 }; |
| 1376 | |
| 1377 | QContactGeoLocationPrivate() : QContactDetailBuiltinPrivate<QContactGeoLocationPrivate>(QContactGeoLocation::Type), |
| 1378 | m_latitude(0.0), m_longitude(0.0), m_accuracy(0.0), m_altitude(0.0), m_altitudeAccuracy(0.0), m_heading(0.0), m_speed(0.0) {} |
| 1379 | }; |
| 1380 | |
| 1381 | template<> |
| 1382 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactGeoLocationPrivate>::s_members[] = { |
| 1383 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactGeoLocationPrivate, m_label) }, |
| 1384 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_latitude) }, |
| 1385 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_longitude) }, |
| 1386 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_accuracy) }, |
| 1387 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_altitude) }, |
| 1388 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_altitudeAccuracy) }, |
| 1389 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_heading) }, |
| 1390 | { .type: QContactDetailBuiltinPrivateBase::Double, offsetof(QContactGeoLocationPrivate, m_speed) }, |
| 1391 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactGeoLocationPrivate, m_timestamp) }, |
| 1392 | }; |
| 1393 | |
| 1394 | /*! |
| 1395 | \variable QContactGeoLocation::Type |
| 1396 | The enum constant for the type identifier of QContactGeoLocation details. |
| 1397 | */ |
| 1398 | const QContactDetail::DetailType QContactGeoLocation::Type(QContactDetail::TypeGeoLocation); |
| 1399 | |
| 1400 | /*! |
| 1401 | \enum QContactGeoLocation::GeoLocationField |
| 1402 | This enumeration defines the fields supported by QContactGeoLocation. |
| 1403 | \value FieldLabel The value stored in this field contains the location label. |
| 1404 | \value FieldLatitude The value stored in this field contains the latitude. |
| 1405 | \value FieldLongitude The value stored in this field contains the longitude. |
| 1406 | \value FieldAccuracy The value stored in this field contains the location (latitude/longitude) accuracy. |
| 1407 | \value FieldAltitude The value stored in this field contains the altitude. |
| 1408 | \value FieldAltitudeAccuracy The value stored in this field contains the accuracy of the altitude. |
| 1409 | \value FieldHeading The value stored in this field contains the heading. |
| 1410 | \value FieldSpeed The value stored in this field contains the speed. |
| 1411 | \value FieldTimestamp The value stored in this field contains the timestamp of the location information. |
| 1412 | \sa label(), setLabel() |
| 1413 | \sa latitude(), setLatitude() |
| 1414 | \sa longitude(), setLongitude() |
| 1415 | \sa accuracy(), setAccuracy() |
| 1416 | \sa altitude(), setAltitude() |
| 1417 | \sa altitudeAccuracy(), setAltitudeAccuracy() |
| 1418 | \sa heading(), setHeading() |
| 1419 | \sa speed(), setSpeed() |
| 1420 | \sa timestamp(), setTimestamp() |
| 1421 | */ |
| 1422 | |
| 1423 | /*! |
| 1424 | \fn QContactGeoLocation::setLabel(const QString& label) |
| 1425 | Sets the label of the location stored in the detail to \a label. |
| 1426 | */ |
| 1427 | void QContactGeoLocation::setLabel(const QString& _value) |
| 1428 | { |
| 1429 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<QString>(field: QContactGeoLocation::FieldLabel, value: _value); |
| 1430 | } |
| 1431 | |
| 1432 | /*! |
| 1433 | \fn QContactGeoLocation::label() const |
| 1434 | Returns the label of the location stored in the detail. |
| 1435 | */ |
| 1436 | QString QContactGeoLocation::label() const |
| 1437 | { |
| 1438 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<QString>(field: QContactGeoLocation::FieldLabel); |
| 1439 | } |
| 1440 | |
| 1441 | /*! |
| 1442 | \fn QContactGeoLocation::setLatitude(double latitude) |
| 1443 | |
| 1444 | Sets the latitude portion of the coordinate (in decimal degrees) of |
| 1445 | the location stored in the detail to \a latitude. |
| 1446 | */ |
| 1447 | void QContactGeoLocation::setLatitude(double _value) |
| 1448 | { |
| 1449 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldLatitude, value: _value); |
| 1450 | } |
| 1451 | |
| 1452 | /*! |
| 1453 | \fn QContactGeoLocation::latitude() const |
| 1454 | |
| 1455 | Returns the latitude portion of the coordinate (specified in |
| 1456 | decimal degrees) of the location stored in the detail. |
| 1457 | */ |
| 1458 | double QContactGeoLocation::latitude() const |
| 1459 | { |
| 1460 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldLatitude); |
| 1461 | } |
| 1462 | |
| 1463 | /*! |
| 1464 | \fn QContactGeoLocation::setLongitude(double longitude) |
| 1465 | |
| 1466 | Sets the longitude portion of the coordinate (in decimal degrees) |
| 1467 | of the location stored in the detail to \a longitude. |
| 1468 | */ |
| 1469 | void QContactGeoLocation::setLongitude(double _value) |
| 1470 | { |
| 1471 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldLongitude, value: _value); |
| 1472 | } |
| 1473 | |
| 1474 | /*! |
| 1475 | \fn QContactGeoLocation::longitude() const |
| 1476 | |
| 1477 | Returns the longitude portion of the coordinate (specified in |
| 1478 | decimal degrees) of the location stored in the detail. |
| 1479 | */ |
| 1480 | double QContactGeoLocation::longitude() const |
| 1481 | { |
| 1482 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldLongitude); |
| 1483 | } |
| 1484 | |
| 1485 | /*! |
| 1486 | \fn QContactGeoLocation::setAccuracy(double accuracy) |
| 1487 | |
| 1488 | Specifies that the latitude and longitude portions of the location |
| 1489 | stored in the detail are accurate to within \a accuracy metres. |
| 1490 | */ |
| 1491 | void QContactGeoLocation::setAccuracy(double _value) |
| 1492 | { |
| 1493 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldAccuracy, value: _value); |
| 1494 | } |
| 1495 | |
| 1496 | /*! |
| 1497 | \fn QContactGeoLocation::accuracy() const |
| 1498 | |
| 1499 | Returns the accuracy (in metres) of the latitude and longitude of |
| 1500 | the location stored in the detail. |
| 1501 | */ |
| 1502 | double QContactGeoLocation::accuracy() const |
| 1503 | { |
| 1504 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldAccuracy); |
| 1505 | } |
| 1506 | |
| 1507 | /*! |
| 1508 | \fn QContactGeoLocation::setAltitude(double altitude) |
| 1509 | |
| 1510 | Sets the altitude portion of the coordinate (in metres above the |
| 1511 | ellipsoid) of the location stored in the detail to \a altitude. |
| 1512 | */ |
| 1513 | void QContactGeoLocation::setAltitude(double _value) |
| 1514 | { |
| 1515 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldAltitude, value: _value); |
| 1516 | } |
| 1517 | |
| 1518 | /*! |
| 1519 | \fn QContactGeoLocation::altitude() const |
| 1520 | Returns the altitude (in metres) of the location stored in the detail. |
| 1521 | */ |
| 1522 | double QContactGeoLocation::altitude() const |
| 1523 | { |
| 1524 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldAltitude); |
| 1525 | } |
| 1526 | |
| 1527 | /*! |
| 1528 | \fn QContactGeoLocation::setAltitudeAccuracy(double altitudeAccuracy) |
| 1529 | |
| 1530 | Sets the altitude-accuracy portion of the coordinate (in metres) of |
| 1531 | the location stored in the detail to \a altitudeAccuracy. |
| 1532 | */ |
| 1533 | void QContactGeoLocation::setAltitudeAccuracy(double _value) |
| 1534 | { |
| 1535 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldAltitudeAccuracy, value: _value); |
| 1536 | } |
| 1537 | |
| 1538 | /*! |
| 1539 | \fn QContactGeoLocation::altitudeAccuracy() const |
| 1540 | |
| 1541 | Returns the accuracy of the altitude portion of the location stored |
| 1542 | in the detail. |
| 1543 | */ |
| 1544 | double QContactGeoLocation::altitudeAccuracy() const |
| 1545 | { |
| 1546 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldAltitudeAccuracy); |
| 1547 | } |
| 1548 | |
| 1549 | /*! |
| 1550 | \fn QContactGeoLocation::setHeading(double heading) |
| 1551 | |
| 1552 | Sets the heading portion of the coordinate (in decimal degrees |
| 1553 | clockwise relative to true north) of the location-aware device at |
| 1554 | the time of measurement to \a heading. |
| 1555 | */ |
| 1556 | void QContactGeoLocation::setHeading(double _value) |
| 1557 | { |
| 1558 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldHeading, value: _value); |
| 1559 | } |
| 1560 | |
| 1561 | /*! |
| 1562 | \fn QContactGeoLocation::heading() const |
| 1563 | |
| 1564 | Returns the heading (at the time of measurement) of the |
| 1565 | location-aware device that recorded (or was provided) the |
| 1566 | measurement. |
| 1567 | */ |
| 1568 | double QContactGeoLocation::heading() const |
| 1569 | { |
| 1570 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldHeading); |
| 1571 | } |
| 1572 | |
| 1573 | /*! |
| 1574 | \fn QContactGeoLocation::setSpeed(double speed) |
| 1575 | |
| 1576 | Sets the speed portion of the coordinate (in metres per second) of |
| 1577 | the location-aware device at the time of measurement to \a speed. |
| 1578 | */ |
| 1579 | void QContactGeoLocation::setSpeed(double _value) |
| 1580 | { |
| 1581 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<double>(field: QContactGeoLocation::FieldSpeed, value: _value); |
| 1582 | } |
| 1583 | |
| 1584 | /*! |
| 1585 | \fn QContactGeoLocation::speed() const |
| 1586 | |
| 1587 | Returns the speed (at the time of measurement) of the |
| 1588 | location-aware device that recorded (or was provided) the |
| 1589 | measurement. |
| 1590 | */ |
| 1591 | double QContactGeoLocation::speed() const |
| 1592 | { |
| 1593 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<double>(field: QContactGeoLocation::FieldSpeed); |
| 1594 | } |
| 1595 | |
| 1596 | /*! |
| 1597 | \fn QContactGeoLocation::setTimestamp(const QDateTime& timestamp) |
| 1598 | |
| 1599 | Sets the creation (or first-valid) timestamp of the location |
| 1600 | information to \a timestamp. |
| 1601 | */ |
| 1602 | void QContactGeoLocation::setTimestamp(const QDateTime& _value) |
| 1603 | { |
| 1604 | reinterpret_cast<QContactGeoLocationPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactGeoLocation::FieldTimestamp, value: _value); |
| 1605 | } |
| 1606 | |
| 1607 | /*! |
| 1608 | \fn QContactGeoLocation::timestamp() const |
| 1609 | |
| 1610 | Returns the timestamp associated with the location stored in the |
| 1611 | detail. |
| 1612 | */ |
| 1613 | QDateTime QContactGeoLocation::timestamp() const |
| 1614 | { |
| 1615 | return reinterpret_cast<const QContactGeoLocationPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactGeoLocation::FieldTimestamp); |
| 1616 | } |
| 1617 | |
| 1618 | /* ==================== QContactGuid ======================= */ |
| 1619 | |
| 1620 | /*! |
| 1621 | \class QContactGuid |
| 1622 | \brief The QContactGuid class contains a globally unique |
| 1623 | Id of a contact, for use in synchronization with other datastores. |
| 1624 | \ingroup contacts-details |
| 1625 | \inmodule QtContacts |
| 1626 | */ |
| 1627 | |
| 1628 | class QContactGuidPrivate : public QContactDetailBuiltinPrivate<QContactGuidPrivate> |
| 1629 | { |
| 1630 | public: |
| 1631 | QString m_guid; |
| 1632 | |
| 1633 | enum { FieldCount = 1 }; |
| 1634 | |
| 1635 | QContactGuidPrivate() : QContactDetailBuiltinPrivate<QContactGuidPrivate>(QContactGuid::Type) {} |
| 1636 | }; |
| 1637 | |
| 1638 | template<> |
| 1639 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactGuidPrivate>::s_members[] = { |
| 1640 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactGuidPrivate, m_guid) }, |
| 1641 | }; |
| 1642 | |
| 1643 | /*! |
| 1644 | \variable QContactGuid::Type |
| 1645 | The enum constant for the type identifier of QContactGuid details. |
| 1646 | */ |
| 1647 | const QContactDetail::DetailType QContactGuid::Type(QContactDetail::TypeGuid); |
| 1648 | |
| 1649 | /*! |
| 1650 | \enum QContactGuid::GuidField |
| 1651 | This enumeration defines the fields supported by QContactGuid. |
| 1652 | \value FieldGuid The value stored in this field contains the GUID. |
| 1653 | \sa guid(), setGuid() |
| 1654 | */ |
| 1655 | |
| 1656 | /*! |
| 1657 | \fn QContactGuid::guid() const |
| 1658 | |
| 1659 | Returns the globally unique identifier which is stored in this |
| 1660 | detail. |
| 1661 | */ |
| 1662 | QString QContactGuid::guid() const |
| 1663 | { |
| 1664 | return reinterpret_cast<const QContactGuidPrivate*>(d.constData())->memberValue<QString>(field: QContactGuid::FieldGuid); |
| 1665 | } |
| 1666 | |
| 1667 | /*! |
| 1668 | \fn QContactGuid::setGuid(const QString& guid) |
| 1669 | Sets the globally unique identifier which is stored in this detail to \a guid. |
| 1670 | */ |
| 1671 | void QContactGuid::setGuid(const QString& _value) |
| 1672 | { |
| 1673 | reinterpret_cast<QContactGuidPrivate*>(d.data())->setMemberValue<QString>(field: QContactGuid::FieldGuid, value: _value); |
| 1674 | } |
| 1675 | |
| 1676 | /* ==================== QContactHobby ======================= */ |
| 1677 | |
| 1678 | /*! |
| 1679 | \class QContactHobby |
| 1680 | \brief The QContactHobby class contains a hobby of the contact. |
| 1681 | \ingroup contacts-details |
| 1682 | \inmodule QtContacts |
| 1683 | |
| 1684 | A contact may have one or more hobbies. Each QContactHobby |
| 1685 | detail contains information about a single hobby of the contact. |
| 1686 | */ |
| 1687 | |
| 1688 | class QContactHobbyPrivate : public QContactDetailBuiltinPrivate<QContactHobbyPrivate> |
| 1689 | { |
| 1690 | public: |
| 1691 | QString m_hobby; |
| 1692 | |
| 1693 | enum { FieldCount = 1 }; |
| 1694 | |
| 1695 | QContactHobbyPrivate() : QContactDetailBuiltinPrivate<QContactHobbyPrivate>(QContactHobby::Type) {} |
| 1696 | }; |
| 1697 | |
| 1698 | template<> |
| 1699 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactHobbyPrivate>::s_members[] = { |
| 1700 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactHobbyPrivate, m_hobby) }, |
| 1701 | }; |
| 1702 | |
| 1703 | /*! |
| 1704 | \variable QContactHobby::Type |
| 1705 | The enum constant for the type identifier of QContactHobby details. |
| 1706 | */ |
| 1707 | const QContactDetail::DetailType QContactHobby::Type(QContactDetail::TypeHobby); |
| 1708 | |
| 1709 | /*! |
| 1710 | \enum QContactHobby::HobbyField |
| 1711 | This enumeration defines the fields supported by QContactHobby. |
| 1712 | \value FieldHobby The value stored in this field contains the name of the hobby. |
| 1713 | \sa hobby(), setHobby() |
| 1714 | */ |
| 1715 | |
| 1716 | /*! |
| 1717 | \fn QContactHobby::setHobby(const QString& hobby) |
| 1718 | Sets the hobby associated with a contact which is stored in this detail to \a hobby. |
| 1719 | */ |
| 1720 | void QContactHobby::setHobby(const QString& _value) |
| 1721 | { |
| 1722 | reinterpret_cast<QContactHobbyPrivate*>(d.data())->setMemberValue<QString>(field: QContactHobby::FieldHobby, value: _value); |
| 1723 | } |
| 1724 | |
| 1725 | /*! |
| 1726 | \fn QContactHobby::hobby() const |
| 1727 | Returns the hobby associated with a contact which is stored in this detail. |
| 1728 | */ |
| 1729 | QString QContactHobby::hobby() const |
| 1730 | { |
| 1731 | return reinterpret_cast<const QContactHobbyPrivate*>(d.constData())->memberValue<QString>(field: QContactHobby::FieldHobby); |
| 1732 | } |
| 1733 | |
| 1734 | |
| 1735 | /* ==================== QContactName ======================= */ |
| 1736 | |
| 1737 | /*! |
| 1738 | \class QContactName |
| 1739 | \brief The QContactName class contains a name of a contact. |
| 1740 | \ingroup contacts-details |
| 1741 | \inmodule QtContacts |
| 1742 | */ |
| 1743 | |
| 1744 | class QContactNamePrivate : public QContactDetailBuiltinPrivate<QContactNamePrivate> |
| 1745 | { |
| 1746 | public: |
| 1747 | QString m_prefix; |
| 1748 | QString m_firstName; |
| 1749 | QString m_middleName; |
| 1750 | QString m_lastName; |
| 1751 | QString m_suffix; |
| 1752 | QString m_customLabel; |
| 1753 | |
| 1754 | enum { FieldCount = 6 }; |
| 1755 | |
| 1756 | QContactNamePrivate() : QContactDetailBuiltinPrivate<QContactNamePrivate>(QContactName::Type) {} |
| 1757 | }; |
| 1758 | |
| 1759 | template<> |
| 1760 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactNamePrivate>::s_members[] = { |
| 1761 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_prefix) }, |
| 1762 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_firstName) }, |
| 1763 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_middleName) }, |
| 1764 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_lastName) }, |
| 1765 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_suffix) }, |
| 1766 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNamePrivate, m_customLabel) }, |
| 1767 | }; |
| 1768 | |
| 1769 | /*! |
| 1770 | \variable QContactName::Type |
| 1771 | The enum constant for the type identifier of QContactName details. |
| 1772 | */ |
| 1773 | const QContactDetail::DetailType QContactName::Type(QContactDetail::TypeName); |
| 1774 | |
| 1775 | /*! |
| 1776 | \enum QContactName::NameField |
| 1777 | This enumeration defines the fields supported by QContactName. |
| 1778 | \value FieldPrefix The value stored in this field contains the prefix part of the name. |
| 1779 | \value FieldFirstName The value stored in this field contains the first part of the name. |
| 1780 | \value FieldMiddleName The value stored in this field contains the middle part of the name. |
| 1781 | \value FieldLastName The value stored in this field contains the last part of the name. |
| 1782 | \value FieldSuffix The value stored in this field contains the suffix part of the name. |
| 1783 | \sa prefix(), setPrefix() |
| 1784 | \sa firstName(), setFirstName() |
| 1785 | \sa middleName(), setMiddleName() |
| 1786 | \sa lastName(), setLastName() |
| 1787 | \sa suffix(), setSuffix() |
| 1788 | */ |
| 1789 | |
| 1790 | /*! |
| 1791 | \fn QContactName::prefix() const |
| 1792 | Returns the prefix segment of the name stored in this detail. |
| 1793 | */ |
| 1794 | QString QContactName::prefix() const |
| 1795 | { |
| 1796 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldPrefix); |
| 1797 | } |
| 1798 | |
| 1799 | /*! |
| 1800 | \fn QContactName::setPrefix(const QString& prefix) |
| 1801 | Sets the prefix segment of the name stored in this detail to \a prefix. |
| 1802 | */ |
| 1803 | void QContactName::setPrefix(const QString& _value) |
| 1804 | { |
| 1805 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldPrefix, value: _value); |
| 1806 | } |
| 1807 | |
| 1808 | /*! |
| 1809 | \fn QContactName::firstName() const |
| 1810 | Returns the first (given) name segment of the name stored in this detail. |
| 1811 | */ |
| 1812 | QString QContactName::firstName() const |
| 1813 | { |
| 1814 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldFirstName); |
| 1815 | } |
| 1816 | |
| 1817 | /*! |
| 1818 | \fn QContactName::setFirstName(const QString& firstName) |
| 1819 | Sets the first name segment of the name stored in this detail to \a firstName. |
| 1820 | */ |
| 1821 | void QContactName::setFirstName(const QString& _value) |
| 1822 | { |
| 1823 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldFirstName, value: _value); |
| 1824 | } |
| 1825 | |
| 1826 | /*! |
| 1827 | \fn QContactName::middleName() const |
| 1828 | |
| 1829 | Returns the middle (additional, or other) name segment of the name |
| 1830 | stored in this detail. |
| 1831 | */ |
| 1832 | QString QContactName::middleName() const |
| 1833 | { |
| 1834 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldMiddleName); |
| 1835 | } |
| 1836 | |
| 1837 | /*! |
| 1838 | \fn QContactName::setMiddleName(const QString& middleName) |
| 1839 | Sets the middle name segment of the name stored in this detail to \a middleName. |
| 1840 | */ |
| 1841 | void QContactName::setMiddleName(const QString& _value) |
| 1842 | { |
| 1843 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldMiddleName, value: _value); |
| 1844 | } |
| 1845 | |
| 1846 | /*! |
| 1847 | \fn QContactName::lastName() const |
| 1848 | |
| 1849 | Returns the last (family, or surname) name segment of the name |
| 1850 | stored in this detail. |
| 1851 | */ |
| 1852 | QString QContactName::lastName() const |
| 1853 | { |
| 1854 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldLastName); |
| 1855 | } |
| 1856 | |
| 1857 | /*! |
| 1858 | \fn QContactName::setLastName(const QString& lastName) |
| 1859 | Sets the last name segment of the name stored in this detail to \a lastName. |
| 1860 | */ |
| 1861 | void QContactName::setLastName(const QString& _value) |
| 1862 | { |
| 1863 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldLastName, value: _value); |
| 1864 | } |
| 1865 | |
| 1866 | /*! |
| 1867 | \fn QContactName::suffix() const |
| 1868 | Returns the suffix segment of the name stored in this detail. |
| 1869 | */ |
| 1870 | QString QContactName::suffix() const |
| 1871 | { |
| 1872 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldSuffix); |
| 1873 | } |
| 1874 | |
| 1875 | /*! |
| 1876 | \fn QContactName::setSuffix(const QString& suffix) |
| 1877 | Sets the suffix segment of the name stored in this detail to \a suffix. |
| 1878 | */ |
| 1879 | void QContactName::setSuffix(const QString& _value) |
| 1880 | { |
| 1881 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldSuffix, value: _value); |
| 1882 | } |
| 1883 | |
| 1884 | /*! |
| 1885 | \fn QContactName::customLabel() const |
| 1886 | Returns the custom label data for the name stored in this detail. |
| 1887 | */ |
| 1888 | QString QContactName::customLabel() const |
| 1889 | { |
| 1890 | return reinterpret_cast<const QContactNamePrivate*>(d.constData())->memberValue<QString>(field: QContactName::FieldCustomLabel); |
| 1891 | } |
| 1892 | |
| 1893 | /*! |
| 1894 | \fn QContactName::setCustomLabel(const QString& customLabel) |
| 1895 | Sets the custom label of the name stored in this detail to \a customLabel. |
| 1896 | */ |
| 1897 | void QContactName::setCustomLabel(const QString& _value) |
| 1898 | { |
| 1899 | reinterpret_cast<QContactNamePrivate*>(d.data())->setMemberValue<QString>(field: QContactName::FieldCustomLabel, value: _value); |
| 1900 | } |
| 1901 | |
| 1902 | /* ==================== QContactNickname ======================= */ |
| 1903 | |
| 1904 | /*! |
| 1905 | \class QContactNickname |
| 1906 | \brief The QContactNickname class contains a nickname of a contact. |
| 1907 | \ingroup contacts-details |
| 1908 | \inmodule QtContacts |
| 1909 | */ |
| 1910 | |
| 1911 | class QContactNicknamePrivate : public QContactDetailBuiltinPrivate<QContactNicknamePrivate> |
| 1912 | { |
| 1913 | public: |
| 1914 | QString m_nickname; |
| 1915 | |
| 1916 | enum { FieldCount = 1 }; |
| 1917 | |
| 1918 | QContactNicknamePrivate() : QContactDetailBuiltinPrivate<QContactNicknamePrivate>(QContactNickname::Type) {} |
| 1919 | }; |
| 1920 | |
| 1921 | template<> |
| 1922 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactNicknamePrivate>::s_members[] = { |
| 1923 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNicknamePrivate, m_nickname) }, |
| 1924 | }; |
| 1925 | |
| 1926 | /*! |
| 1927 | \variable QContactNickname::Type |
| 1928 | The enum constant for the type identifier of QContactNickname details. |
| 1929 | */ |
| 1930 | const QContactDetail::DetailType QContactNickname::Type(QContactType::TypeNickname); |
| 1931 | |
| 1932 | /*! |
| 1933 | \enum QContactNickname::NicknameField |
| 1934 | This enumeration defines the fields supported by QContactNickname. |
| 1935 | \value FieldNickname The value stored in this field contains the nickname. |
| 1936 | \sa nickname(), setNickname() |
| 1937 | */ |
| 1938 | |
| 1939 | /*! |
| 1940 | \fn QContactNickname::setNickname(const QString& nickname) |
| 1941 | Sets the nickname of the contact which is stored in this detail to \a nickname. |
| 1942 | */ |
| 1943 | void QContactNickname::setNickname(const QString& _value) |
| 1944 | { |
| 1945 | reinterpret_cast<QContactNicknamePrivate*>(d.data())->setMemberValue<QString>(field: QContactNickname::FieldNickname, value: _value); |
| 1946 | } |
| 1947 | |
| 1948 | /*! |
| 1949 | \fn QContactNickname::nickname() const |
| 1950 | Returns the nickname of the contact which is stored in this detail. |
| 1951 | */ |
| 1952 | QString QContactNickname::nickname() const |
| 1953 | { |
| 1954 | return reinterpret_cast<const QContactNicknamePrivate*>(d.constData())->memberValue<QString>(field: QContactNickname::FieldNickname); |
| 1955 | } |
| 1956 | |
| 1957 | /* ==================== QContactNote ======================= */ |
| 1958 | |
| 1959 | /*! |
| 1960 | \class QContactNote |
| 1961 | \brief The QContactNote class contains a note associated |
| 1962 | with a contact. |
| 1963 | \ingroup contacts-details |
| 1964 | \inmodule QtContacts |
| 1965 | */ |
| 1966 | |
| 1967 | class QContactNotePrivate : public QContactDetailBuiltinPrivate<QContactNotePrivate> |
| 1968 | { |
| 1969 | public: |
| 1970 | QString m_note; |
| 1971 | |
| 1972 | enum { FieldCount = 1 }; |
| 1973 | |
| 1974 | QContactNotePrivate() : QContactDetailBuiltinPrivate<QContactNotePrivate>(QContactNote::Type) {} |
| 1975 | }; |
| 1976 | |
| 1977 | template<> |
| 1978 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactNotePrivate>::s_members[] = { |
| 1979 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactNotePrivate, m_note) }, |
| 1980 | }; |
| 1981 | |
| 1982 | /*! |
| 1983 | \variable QContactNote::Type |
| 1984 | The enum constant for the type identifier of QContactNote details. |
| 1985 | */ |
| 1986 | const QContactDetail::DetailType QContactNote::Type(QContactDetail::TypeNote); |
| 1987 | |
| 1988 | /*! |
| 1989 | \enum QContactNote::NoteField |
| 1990 | This enumeration defines the fields supported by QContactNote. |
| 1991 | \value FieldNote The value stored in this field contains the note. |
| 1992 | \sa note(), setNote() |
| 1993 | */ |
| 1994 | |
| 1995 | /*! |
| 1996 | \fn QContactNote::setNote(const QString& note) |
| 1997 | Sets a note associated with a contact to \a note. |
| 1998 | */ |
| 1999 | void QContactNote::setNote(const QString& _value) |
| 2000 | { |
| 2001 | reinterpret_cast<QContactNotePrivate*>(d.data())->setMemberValue<QString>(field: QContactNote::FieldNote, value: _value); |
| 2002 | } |
| 2003 | |
| 2004 | /*! |
| 2005 | \fn QContactNote::note() const |
| 2006 | Returns a string for a note associated with a contact. |
| 2007 | */ |
| 2008 | QString QContactNote::note() const |
| 2009 | { |
| 2010 | return reinterpret_cast<const QContactNotePrivate*>(d.constData())->memberValue<QString>(field: QContactNote::FieldNote); |
| 2011 | } |
| 2012 | |
| 2013 | /* ==================== QContactTag ======================= */ |
| 2014 | |
| 2015 | /*! |
| 2016 | \class QContactTag |
| 2017 | \brief The QContactTag class contains a tag associated with a |
| 2018 | contact. |
| 2019 | \ingroup contacts-details |
| 2020 | \inmodule QtContacts |
| 2021 | |
| 2022 | Typically the tags associated with a contact will be distinct, |
| 2023 | although this is usually only enforced when the contact is saved |
| 2024 | in the manager. |
| 2025 | |
| 2026 | Here is an example of retrieving all the tags for a contact: |
| 2027 | \snippet qtcontactsdocsample/qtcontactsdocsample.cpp Getting all tags |
| 2028 | |
| 2029 | Here is an example of checking for a specific tag value: |
| 2030 | \snippet qtcontactsdocsample/qtcontactsdocsample.cpp Checking for a specific tag |
| 2031 | */ |
| 2032 | |
| 2033 | class QContactTagPrivate : public QContactDetailBuiltinPrivate<QContactTagPrivate> |
| 2034 | { |
| 2035 | public: |
| 2036 | QString m_tag; |
| 2037 | |
| 2038 | enum { FieldCount = 1 }; |
| 2039 | |
| 2040 | QContactTagPrivate() : QContactDetailBuiltinPrivate<QContactTagPrivate>(QContactTag::Type) {} |
| 2041 | }; |
| 2042 | |
| 2043 | template<> |
| 2044 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactTagPrivate>::s_members[] = { |
| 2045 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactTagPrivate, m_tag) }, |
| 2046 | }; |
| 2047 | |
| 2048 | /*! |
| 2049 | \variable QContactTag::Type |
| 2050 | The enum constant for the type identifier of QContactTag details. |
| 2051 | */ |
| 2052 | const QContactDetail::DetailType QContactTag::Type(QContactDetail::TypeTag); |
| 2053 | |
| 2054 | /*! |
| 2055 | \enum QContactTag::TagField |
| 2056 | This enumeration defines the fields supported by QContactTag. |
| 2057 | \value FieldTag The value stored in this field contains the tag. |
| 2058 | \sa tag(), setTag() |
| 2059 | */ |
| 2060 | |
| 2061 | /*! |
| 2062 | \fn QContactTag::setTag(const QString& tag) |
| 2063 | Sets the tag associated with a contact which is stored in this detail to \a tag. |
| 2064 | */ |
| 2065 | void QContactTag::setTag(const QString& _value) |
| 2066 | { |
| 2067 | reinterpret_cast<QContactTagPrivate*>(d.data())->setMemberValue<QString>(field: QContactTag::FieldTag, value: _value); |
| 2068 | } |
| 2069 | |
| 2070 | /*! |
| 2071 | \fn QContactTag::tag() const |
| 2072 | Returns the tag associated with a contact which is stored in this detail. |
| 2073 | */ |
| 2074 | QString QContactTag::tag() const |
| 2075 | { |
| 2076 | return reinterpret_cast<const QContactTagPrivate*>(d.constData())->memberValue<QString>(field: QContactTag::FieldTag); |
| 2077 | } |
| 2078 | |
| 2079 | /*! |
| 2080 | Returns a filter suitable for finding contacts which have a tag which |
| 2081 | contains the specified \a subString. |
| 2082 | */ |
| 2083 | QContactFilter QContactTag::match(const QString &subString) |
| 2084 | { |
| 2085 | QContactDetailFilter f; |
| 2086 | f.setDetailType(type: QContactTag::Type, field: QContactTag::FieldTag); |
| 2087 | f.setValue(subString); |
| 2088 | f.setMatchFlags(QContactFilter::MatchContains); |
| 2089 | |
| 2090 | return f; |
| 2091 | } |
| 2092 | |
| 2093 | /* ==================== QContactTimestamp ======================= */ |
| 2094 | |
| 2095 | /*! |
| 2096 | \class QContactTimestamp |
| 2097 | \brief The QContactTimestamp class contains the creation and |
| 2098 | last-modified timestamp associated with the contact. |
| 2099 | \ingroup contacts-details |
| 2100 | \inmodule QtContacts |
| 2101 | */ |
| 2102 | |
| 2103 | class QContactTimestampPrivate : public QContactDetailBuiltinPrivate<QContactTimestampPrivate> |
| 2104 | { |
| 2105 | public: |
| 2106 | QDateTime m_modificationTimestamp; |
| 2107 | QDateTime m_creationTimestamp; |
| 2108 | QDateTime m_deletionTimestamp; |
| 2109 | |
| 2110 | enum { FieldCount = 3 }; |
| 2111 | |
| 2112 | QContactTimestampPrivate() : QContactDetailBuiltinPrivate<QContactTimestampPrivate>(QContactTimestamp::Type) {} |
| 2113 | }; |
| 2114 | |
| 2115 | template<> |
| 2116 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactTimestampPrivate>::s_members[] = { |
| 2117 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactTimestampPrivate, m_modificationTimestamp) }, |
| 2118 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactTimestampPrivate, m_creationTimestamp) }, |
| 2119 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactTimestampPrivate, m_deletionTimestamp) }, |
| 2120 | }; |
| 2121 | |
| 2122 | /*! |
| 2123 | \variable QContactTimestamp::Type |
| 2124 | The enum constant for the type identifier of QContactTimestamp details. |
| 2125 | */ |
| 2126 | const QContactDetail::DetailType QContactTimestamp::Type(QContactDetail::TypeTimestamp); |
| 2127 | |
| 2128 | /*! |
| 2129 | \enum QContactTimestamp::TimestampField |
| 2130 | This enumeration defines the fields supported by QContactTimestamp. |
| 2131 | \value FieldModificationTimestamp The value stored in this field contains the last modified timestamp. |
| 2132 | \value FieldCreationTimestamp The value stored in this field contains the value of the timestamp a contact was created. |
| 2133 | \sa lastModified(), setLastModified() |
| 2134 | \sa created(), setCreated() |
| 2135 | */ |
| 2136 | |
| 2137 | /*! |
| 2138 | \fn QContactTimestamp::setCreated(const QDateTime& dateTime) |
| 2139 | Sets the creation timestamp saved in this detail to \a dateTime. |
| 2140 | */ |
| 2141 | void QContactTimestamp::setCreated(const QDateTime& _value) |
| 2142 | { |
| 2143 | reinterpret_cast<QContactTimestampPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactTimestamp::FieldCreationTimestamp, value: _value); |
| 2144 | } |
| 2145 | |
| 2146 | /*! |
| 2147 | \fn QContactTimestamp::created() const |
| 2148 | Returns the creation timestamp saved in this detail. |
| 2149 | */ |
| 2150 | QDateTime QContactTimestamp::created() const |
| 2151 | { |
| 2152 | return reinterpret_cast<const QContactTimestampPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactTimestamp::FieldCreationTimestamp); |
| 2153 | } |
| 2154 | |
| 2155 | /*! |
| 2156 | \fn QContactTimestamp::setLastModified(const QDateTime& dateTime) |
| 2157 | Sets the last-modified timestamp saved in this detail to \a dateTime. |
| 2158 | */ |
| 2159 | void QContactTimestamp::setLastModified(const QDateTime& _value) |
| 2160 | { |
| 2161 | reinterpret_cast<QContactTimestampPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactTimestamp::FieldModificationTimestamp, value: _value); |
| 2162 | } |
| 2163 | |
| 2164 | /*! |
| 2165 | \fn QContactTimestamp::lastModified() const |
| 2166 | Returns the last-modified timestamp saved in this detail. |
| 2167 | */ |
| 2168 | QDateTime QContactTimestamp::lastModified() const |
| 2169 | { |
| 2170 | return reinterpret_cast<const QContactTimestampPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactTimestamp::FieldModificationTimestamp); |
| 2171 | } |
| 2172 | |
| 2173 | /*! |
| 2174 | \fn QContactTimestamp::setDeleted(const QDateTime& dateTime) |
| 2175 | Sets the deletion timestamp saved in this detail to \a dateTime. |
| 2176 | */ |
| 2177 | void QContactTimestamp::setDeleted(const QDateTime& _value) |
| 2178 | { |
| 2179 | reinterpret_cast<QContactTimestampPrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactTimestamp::FieldDeletionTimestamp, value: _value); |
| 2180 | } |
| 2181 | |
| 2182 | /*! |
| 2183 | \fn QContactTimestamp::deleted() const |
| 2184 | Returns the deletion timestamp saved in this detail. |
| 2185 | */ |
| 2186 | QDateTime QContactTimestamp::deleted() const |
| 2187 | { |
| 2188 | return reinterpret_cast<const QContactTimestampPrivate*>(d.constData())->memberValue<QDateTime>(field: QContactTimestamp::FieldDeletionTimestamp); |
| 2189 | } |
| 2190 | |
| 2191 | |
| 2192 | /* ==================== QContactType ======================= */ |
| 2193 | |
| 2194 | /*! |
| 2195 | \class QContactType |
| 2196 | \brief The QContactType class describes the type of the contact. |
| 2197 | \ingroup contacts-details |
| 2198 | \inmodule QtContacts |
| 2199 | */ |
| 2200 | |
| 2201 | class QContactTypePrivate : public QContactDetailBuiltinPrivate<QContactTypePrivate> |
| 2202 | { |
| 2203 | public: |
| 2204 | int m_contactType; |
| 2205 | |
| 2206 | enum { FieldCount = 1 }; |
| 2207 | |
| 2208 | QContactTypePrivate() : QContactDetailBuiltinPrivate<QContactTypePrivate>(QContactType::Type), m_contactType(0) {} |
| 2209 | }; |
| 2210 | |
| 2211 | template<> |
| 2212 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactTypePrivate>::s_members[] = { |
| 2213 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactTypePrivate, m_contactType) }, |
| 2214 | }; |
| 2215 | |
| 2216 | /*! |
| 2217 | \variable QContactType::Type |
| 2218 | The enum constant for the type identifier of QContactType details. |
| 2219 | */ |
| 2220 | const QContactDetail::DetailType QContactType::Type(QContactDetail::TypeType); |
| 2221 | |
| 2222 | /*! |
| 2223 | \enum QContactType::TypeField |
| 2224 | This enumeration defines the fields supported by QContactType. |
| 2225 | \value FieldType The value stored in this field contains the type value which is stored in details of |
| 2226 | the QContactType definition. |
| 2227 | \sa type(), setType() |
| 2228 | */ |
| 2229 | |
| 2230 | /*! |
| 2231 | \enum QContactType::TypeValues |
| 2232 | \value TypeContact The value indicates that this contact is an ordinary contact. |
| 2233 | |
| 2234 | Contacts of this type are able to be the second contact in |
| 2235 | relationships of the \c QContactRelationship::HasMember type, and the |
| 2236 | first contact in relationships of the \c QContactRelationship::Aggregates type. |
| 2237 | |
| 2238 | \value TypeGroup The value indicates that this contact is a group contact. |
| 2239 | |
| 2240 | Contacts of this type are able to be the first contact in |
| 2241 | relationships of the \c QContactRelationship::HasMember type. |
| 2242 | |
| 2243 | To enumerate the ids of members of a group, the client should |
| 2244 | retrieve the relationships which involve the group from the manager |
| 2245 | in which the group is saved. |
| 2246 | |
| 2247 | \value TypeFacet The value indicates that this contact is a facet of an individual contact. |
| 2248 | |
| 2249 | Contact facets are collections of details that form one representation |
| 2250 | of an individual contact. Facets can be aggregated together to create |
| 2251 | composite representations of a contact, represented by contacts of type |
| 2252 | \c TypeContact. |
| 2253 | |
| 2254 | Contacts of this type are able to be the second contact in |
| 2255 | relationships of the \c QContactRelationship::Aggregates type. |
| 2256 | |
| 2257 | Contact managers may automatically create composite contacts from facets, or |
| 2258 | require composition to be specified by clients, using QContactRelationship. |
| 2259 | |
| 2260 | \sa type(), setType() |
| 2261 | */ |
| 2262 | |
| 2263 | /*! |
| 2264 | \fn QContactType::type() const |
| 2265 | Returns the contact type value stored in this detail. |
| 2266 | */ |
| 2267 | QContactType::TypeValues QContactType::type() const |
| 2268 | { |
| 2269 | return static_cast<QContactType::TypeValues>(reinterpret_cast<const QContactTypePrivate*>(d.constData())->memberValue<int>(field: QContactType::FieldType)); |
| 2270 | } |
| 2271 | |
| 2272 | /*! |
| 2273 | \fn QContactType::setType(TypeValues type) |
| 2274 | Sets the type of the contact to be the give \a type. |
| 2275 | */ |
| 2276 | void QContactType::setType(QContactType::TypeValues _value) |
| 2277 | { |
| 2278 | reinterpret_cast<QContactTypePrivate*>(d.data())->setMemberValue<int>(field: QContactType::FieldType, value: static_cast<int>(_value)); |
| 2279 | } |
| 2280 | |
| 2281 | /* ==================== QContactOnlineAccount ======================= */ |
| 2282 | |
| 2283 | // XXX TODO explain link to QContactPresence |
| 2284 | |
| 2285 | /*! |
| 2286 | \class QContactOnlineAccount |
| 2287 | \brief The QContactOnlineAccount class provides an online account, |
| 2288 | which the contact uses to communicate with friends and family. |
| 2289 | \inmodule QtContacts |
| 2290 | |
| 2291 | A QContactOnlineAccount consists of the account details required to |
| 2292 | communicate with the contact, including the account URI, the capabilities |
| 2293 | of the account, the service provider of the account, and the type of the account. |
| 2294 | |
| 2295 | Presence information for a particular QContactOnlineAccount detail is provided |
| 2296 | in a QContactPresence detail which is linked (via linkedDetailUris()) to the |
| 2297 | account detail. This information is generally provided by the backend, and is |
| 2298 | not modifiable by clients. |
| 2299 | |
| 2300 | \sa QContactPresence |
| 2301 | |
| 2302 | \ingroup contacts-details |
| 2303 | */ |
| 2304 | |
| 2305 | class QContactOnlineAccountPrivate : public QContactDetailBuiltinPrivate<QContactOnlineAccountPrivate> |
| 2306 | { |
| 2307 | public: |
| 2308 | QString m_accountUri; |
| 2309 | QString m_serviceProvider; |
| 2310 | int m_protocol; |
| 2311 | QStringList m_capabilities; |
| 2312 | QList<int> m_subTypes; |
| 2313 | |
| 2314 | enum { FieldCount = 5 }; |
| 2315 | |
| 2316 | QContactOnlineAccountPrivate() : QContactDetailBuiltinPrivate<QContactOnlineAccountPrivate>(QContactOnlineAccount::Type), m_protocol(0) {} |
| 2317 | }; |
| 2318 | |
| 2319 | template<> |
| 2320 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactOnlineAccountPrivate>::s_members[] = { |
| 2321 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOnlineAccountPrivate, m_accountUri) }, |
| 2322 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOnlineAccountPrivate, m_serviceProvider) }, |
| 2323 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactOnlineAccountPrivate, m_protocol) }, |
| 2324 | { .type: QContactDetailBuiltinPrivateBase::StringList, offsetof(QContactOnlineAccountPrivate, m_capabilities) }, |
| 2325 | { .type: QContactDetailBuiltinPrivateBase::IntList, offsetof(QContactOnlineAccountPrivate, m_subTypes) }, |
| 2326 | }; |
| 2327 | |
| 2328 | /*! |
| 2329 | \variable QContactOnlineAccount::Type |
| 2330 | The enum constant for the type identifier of QContactOnlineAccount details. |
| 2331 | */ |
| 2332 | const QContactDetail::DetailType QContactOnlineAccount::Type(QContactDetail::TypeOnlineAccount); |
| 2333 | |
| 2334 | /*! |
| 2335 | \enum QContactOnlineAccount::OnlineAccountField |
| 2336 | |
| 2337 | This enumeration defines the fields supported by QContactOnlineAccount. |
| 2338 | |
| 2339 | \value FieldAccountUri The value stored in this field contains the value of the account uri. |
| 2340 | \value FieldServiceProvider The value stored in this field contains the value of the provider name. |
| 2341 | \value FieldProtocol The value stored in this field contains the value of the protocol. |
| 2342 | \value FieldCapabilities The value stored in this field contains the value of the account capabilities. |
| 2343 | \value FieldSubTypes The value stored in this field contains the value of the sub types of a QContactOnlineAccount. |
| 2344 | \sa accountUri(), setAccountUri() |
| 2345 | \sa serviceProvider(), setServiceProvider() |
| 2346 | \sa capabilities(), setCapabilities() |
| 2347 | */ |
| 2348 | |
| 2349 | /*! |
| 2350 | \enum QContactOnlineAccount::SubType |
| 2351 | |
| 2352 | This enumeration defines the predefined enum constants for a sub type value of a QContactOnlineAccount. |
| 2353 | |
| 2354 | \value SubTypeSip The value stored indicates if this online account supports SIP. |
| 2355 | \value SubTypeSipVoip The value stored indicates if this online account supports SIP based VOIP. |
| 2356 | \value SubTypeImpp The value stored indicates if this online account supports IMPP. |
| 2357 | \value SubTypeVideoShare The value stored indicates if this online account supports VideoShare. |
| 2358 | \sa subTypes(), setSubTypes() |
| 2359 | */ |
| 2360 | |
| 2361 | /*! |
| 2362 | \enum QContactOnlineAccount::Protocol |
| 2363 | |
| 2364 | This enumeration defines the predefined enum constants for a protocol value of a QContactOnlineAccount. |
| 2365 | |
| 2366 | \value ProtocolUnknown The value stored indicates this online account is for one unsupported protocol. |
| 2367 | \value ProtocolAim The value stored indicates this online account is for the AIM protocol. |
| 2368 | \value ProtocolIcq The value stored indicates this online account is for the ICQ protocol. |
| 2369 | \value ProtocolIrc The value stored indicates this online account is for the IRC protocol. |
| 2370 | \value ProtocolJabber The value stored indicates this online account is for the jabber protocol. |
| 2371 | \value ProtocolMsn The value stored indicates this online account is for the MSN protocol. |
| 2372 | \value ProtocolQq The value stored indicates this online account is for the QQ protocol. |
| 2373 | \value ProtocolSkype The value stored indicates this online account is for the Skype protocol. |
| 2374 | \value ProtocolYahoo The value stored indicates this online account is for the Yahoo protocol. |
| 2375 | \sa protocol(), setProtocol() |
| 2376 | */ |
| 2377 | |
| 2378 | /*! |
| 2379 | \fn QContactOnlineAccount::setAccountUri(const QString& accountUri) |
| 2380 | |
| 2381 | Sets the universal resource identifier of the contact's online |
| 2382 | account to \a accountUri. |
| 2383 | */ |
| 2384 | void QContactOnlineAccount::setAccountUri(const QString& _value) |
| 2385 | { |
| 2386 | reinterpret_cast<QContactOnlineAccountPrivate*>(d.data())->setMemberValue<QString>(field: QContactOnlineAccount::FieldAccountUri, value: _value); |
| 2387 | } |
| 2388 | |
| 2389 | /*! |
| 2390 | \fn QContactOnlineAccount::accountUri() const |
| 2391 | |
| 2392 | Returns the universal resource identifier of the online account of |
| 2393 | the contact. |
| 2394 | */ |
| 2395 | QString QContactOnlineAccount::accountUri() const |
| 2396 | { |
| 2397 | return reinterpret_cast<const QContactOnlineAccountPrivate*>(d.constData())->memberValue<QString>(field: QContactOnlineAccount::FieldAccountUri); |
| 2398 | } |
| 2399 | |
| 2400 | /*! |
| 2401 | \fn QContactOnlineAccount::setServiceProvider(const QString& serviceProvider) |
| 2402 | |
| 2403 | Sets the service provider of the contact's online account to \a |
| 2404 | serviceProvider. |
| 2405 | */ |
| 2406 | void QContactOnlineAccount::setServiceProvider(const QString& _value) |
| 2407 | { |
| 2408 | reinterpret_cast<QContactOnlineAccountPrivate*>(d.data())->setMemberValue<QString>(field: QContactOnlineAccount::FieldServiceProvider, value: _value); |
| 2409 | } |
| 2410 | |
| 2411 | /*! |
| 2412 | \fn QContactOnlineAccount::serviceProvider() const |
| 2413 | Returns the service provider of the online account of the contact. |
| 2414 | */ |
| 2415 | QString QContactOnlineAccount::serviceProvider() const |
| 2416 | { |
| 2417 | return reinterpret_cast<const QContactOnlineAccountPrivate*>(d.constData())->memberValue<QString>(field: QContactOnlineAccount::FieldServiceProvider); |
| 2418 | } |
| 2419 | |
| 2420 | /*! |
| 2421 | \fn QContactOnlineAccount::protocol() const |
| 2422 | Returns the protocol value. |
| 2423 | */ |
| 2424 | QContactOnlineAccount::Protocol QContactOnlineAccount::protocol() const |
| 2425 | { |
| 2426 | return static_cast<QContactOnlineAccount::Protocol>(reinterpret_cast<const QContactOnlineAccountPrivate*>(d.constData())->memberValue<int>(field: QContactOnlineAccount::FieldProtocol)); |
| 2427 | } |
| 2428 | |
| 2429 | /*! |
| 2430 | \fn QContactOnlineAccount::setProtocol(Protocol protocol) |
| 2431 | Set the protocol to \a protocol. |
| 2432 | */ |
| 2433 | void QContactOnlineAccount::setProtocol(QContactOnlineAccount::Protocol _value) |
| 2434 | { |
| 2435 | reinterpret_cast<QContactOnlineAccountPrivate*>(d.data())->setMemberValue<int>(field: QContactOnlineAccount::FieldProtocol, value: static_cast<int>(_value)); |
| 2436 | } |
| 2437 | |
| 2438 | /*! |
| 2439 | \fn QContactOnlineAccount::setSubTypes(const QList<int>& subTypes) |
| 2440 | |
| 2441 | Sets the subtypes which this detail implements to be those |
| 2442 | contained in the list of given \a subTypes. |
| 2443 | */ |
| 2444 | void QContactOnlineAccount::setSubTypes(const QList<int>& _value) |
| 2445 | { |
| 2446 | reinterpret_cast<QContactOnlineAccountPrivate*>(d.data())->setMemberValue<QList<int> >(field: QContactOnlineAccount::FieldSubTypes, value: _value); |
| 2447 | } |
| 2448 | |
| 2449 | /*! |
| 2450 | \fn QContactOnlineAccount::subTypes() const |
| 2451 | Returns the list of subtypes that this detail implements. |
| 2452 | */ |
| 2453 | QList<int> QContactOnlineAccount::subTypes() const |
| 2454 | { |
| 2455 | return reinterpret_cast<const QContactOnlineAccountPrivate*>(d.constData())->memberValue<QList<int> >(field: QContactOnlineAccount::FieldSubTypes); |
| 2456 | } |
| 2457 | |
| 2458 | /*! |
| 2459 | \fn QContactOnlineAccount::setCapabilities(const QStringList& capabilities) |
| 2460 | |
| 2461 | Sets the capabilities of the online account about which this detail stores |
| 2462 | presence information to \a capabilities. The \a capabilities list is a |
| 2463 | list of service-provider specified strings which together identify the |
| 2464 | types of communication which may be possible. |
| 2465 | */ |
| 2466 | void QContactOnlineAccount::setCapabilities(const QStringList& _value) |
| 2467 | { |
| 2468 | reinterpret_cast<QContactOnlineAccountPrivate*>(d.data())->setMemberValue<QStringList>(field: QContactOnlineAccount::FieldCapabilities, value: _value); |
| 2469 | } |
| 2470 | |
| 2471 | /*! |
| 2472 | \fn QContactOnlineAccount::capabilities() const |
| 2473 | |
| 2474 | Returns the capabilities of the online account about which this detail stores |
| 2475 | presence information. |
| 2476 | */ |
| 2477 | QStringList QContactOnlineAccount::capabilities() const |
| 2478 | { |
| 2479 | return reinterpret_cast<const QContactOnlineAccountPrivate*>(d.constData())->memberValue<QStringList>(field: QContactOnlineAccount::FieldCapabilities); |
| 2480 | } |
| 2481 | |
| 2482 | /* ==================== QContactOrganization ======================= */ |
| 2483 | |
| 2484 | /*! |
| 2485 | \class QContactOrganization |
| 2486 | \brief The QContactOrganization class provides details about an |
| 2487 | organization that the contact is either a part of, or stands for. |
| 2488 | \ingroup contacts-details |
| 2489 | \inmodule QtContacts |
| 2490 | */ |
| 2491 | |
| 2492 | class QContactOrganizationPrivate : public QContactDetailBuiltinPrivate<QContactOrganizationPrivate> |
| 2493 | { |
| 2494 | public: |
| 2495 | QString m_name; |
| 2496 | QUrl m_logoUrl; |
| 2497 | QStringList m_department; |
| 2498 | QString m_location; |
| 2499 | QString m_role; |
| 2500 | QString m_title; |
| 2501 | QString m_assistantName; |
| 2502 | |
| 2503 | enum { FieldCount = 7 }; |
| 2504 | |
| 2505 | QContactOrganizationPrivate() : QContactDetailBuiltinPrivate<QContactOrganizationPrivate>(QContactOrganization::Type) {} |
| 2506 | }; |
| 2507 | |
| 2508 | template<> |
| 2509 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactOrganizationPrivate>::s_members[] = { |
| 2510 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOrganizationPrivate, m_name) }, |
| 2511 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactOrganizationPrivate, m_logoUrl) }, |
| 2512 | { .type: QContactDetailBuiltinPrivateBase::StringList, offsetof(QContactOrganizationPrivate, m_department) }, |
| 2513 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOrganizationPrivate, m_location) }, |
| 2514 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOrganizationPrivate, m_role) }, |
| 2515 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOrganizationPrivate, m_title) }, |
| 2516 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactOrganizationPrivate, m_assistantName) }, |
| 2517 | }; |
| 2518 | |
| 2519 | /*! |
| 2520 | \variable QContactOrganization::Type |
| 2521 | The enum constant for the type identifier of QContactOrganization details. |
| 2522 | */ |
| 2523 | const QContactDetail::DetailType QContactOrganization::Type(QContactDetail::TypeOrganization); |
| 2524 | |
| 2525 | /*! |
| 2526 | \enum QContactOrganization::OrganizationField |
| 2527 | This enumeration defines the fields supported by QContactOrganization. |
| 2528 | \value FieldName The value stored in this field contains the organization name. |
| 2529 | \value FieldLogoUrl The value stored in this field contains the organization logo image. |
| 2530 | \value FieldDepartment The value stored in this field contains the department name. |
| 2531 | \value FieldLocation The value stored in this field contains the location of the organization. |
| 2532 | \value FieldRole The value stored in this field contains the contact's role in the organization. |
| 2533 | \value FieldTitle The value stored in this field contains the contact's title in the organization. |
| 2534 | \value FieldAssistantName The value stored in this field contains the contact's assistant. |
| 2535 | \sa department(), setDepartment() |
| 2536 | \sa name(), setName() |
| 2537 | \sa logoUrl(), setLogoUrl() |
| 2538 | \sa department(), setDepartment() |
| 2539 | \sa location(), setLocation() |
| 2540 | \sa role(), setRole() |
| 2541 | \sa title(), setTitle() |
| 2542 | \sa assistantName(), setAssistantName() |
| 2543 | */ |
| 2544 | |
| 2545 | /*! |
| 2546 | \fn QContactOrganization::setName(const QString& name) |
| 2547 | Sets the name of the organization stored in this detail to \a name. |
| 2548 | */ |
| 2549 | void QContactOrganization::setName(const QString& _value) |
| 2550 | { |
| 2551 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QString>(field: QContactOrganization::FieldName, value: _value); |
| 2552 | } |
| 2553 | |
| 2554 | /*! |
| 2555 | \fn QContactOrganization::name() const |
| 2556 | Returns the name of the organization stored in this detail. |
| 2557 | */ |
| 2558 | QString QContactOrganization::name() const |
| 2559 | { |
| 2560 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QString>(field: QContactOrganization::FieldName); |
| 2561 | } |
| 2562 | |
| 2563 | /*! |
| 2564 | \fn QContactOrganization::setLogoUrl(const QUrl& logo) |
| 2565 | Sets the url of the logo of the organization stored in this detail to \a logo. |
| 2566 | */ |
| 2567 | void QContactOrganization::setLogoUrl(const QUrl& _value) |
| 2568 | { |
| 2569 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QUrl>(field: QContactOrganization::FieldLogoUrl, value: _value); |
| 2570 | } |
| 2571 | |
| 2572 | /*! |
| 2573 | \fn QContactOrganization::logoUrl() const |
| 2574 | Returns the url of the logo of the organization stored in this detail. |
| 2575 | */ |
| 2576 | QUrl QContactOrganization::logoUrl() const |
| 2577 | { |
| 2578 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QUrl>(field: QContactOrganization::FieldLogoUrl); |
| 2579 | } |
| 2580 | |
| 2581 | |
| 2582 | /*! |
| 2583 | \fn QContactOrganization::setDepartment(const QStringList& department) |
| 2584 | |
| 2585 | Sets the contact's department of the organization stored in this |
| 2586 | detail to \a department. The department is a list of progressively |
| 2587 | finer-grained information. |
| 2588 | */ |
| 2589 | void QContactOrganization::setDepartment(const QStringList& _value) |
| 2590 | { |
| 2591 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QStringList>(field: QContactOrganization::FieldDepartment, value: _value); |
| 2592 | } |
| 2593 | |
| 2594 | /*! |
| 2595 | \fn QContactOrganization::department() const |
| 2596 | Returns the contact's department stored in this detail. |
| 2597 | */ |
| 2598 | QStringList QContactOrganization::department() const |
| 2599 | { |
| 2600 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QStringList>(field: QContactOrganization::FieldDepartment); |
| 2601 | } |
| 2602 | |
| 2603 | /*! |
| 2604 | \fn QContactOrganization::setLocation(const QString& location) |
| 2605 | |
| 2606 | Sets the location (e.g. city or suburb) of the organization stored |
| 2607 | in this detail to \a location. |
| 2608 | */ |
| 2609 | void QContactOrganization::setLocation(const QString& _value) |
| 2610 | { |
| 2611 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QString>(field: QContactOrganization::FieldLocation, value: _value); |
| 2612 | } |
| 2613 | |
| 2614 | /*! |
| 2615 | \fn QContactOrganization::location() const |
| 2616 | Returns the location of the organization stored in this detail. |
| 2617 | */ |
| 2618 | QString QContactOrganization::location() const |
| 2619 | { |
| 2620 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QString>(field: QContactOrganization::FieldLocation); |
| 2621 | } |
| 2622 | |
| 2623 | |
| 2624 | /*! |
| 2625 | \fn QContactOrganization::setRole(const QString& role) |
| 2626 | Sets the contact's role within the organization stored in this detail to \a role. |
| 2627 | */ |
| 2628 | void QContactOrganization::setRole(const QString& _value) |
| 2629 | { |
| 2630 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QString>(field: QContactOrganization::FieldRole, value: _value); |
| 2631 | } |
| 2632 | |
| 2633 | /*! |
| 2634 | \fn QContactOrganization::role() const |
| 2635 | Returns the contact's role within the organization stored in this detail. |
| 2636 | */ |
| 2637 | QString QContactOrganization::role() const |
| 2638 | { |
| 2639 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QString>(field: QContactOrganization::FieldRole); |
| 2640 | } |
| 2641 | |
| 2642 | /*! |
| 2643 | \fn QContactOrganization::setTitle(const QString& title) |
| 2644 | Sets the contact's title within the organization stored in this detail to \a title. |
| 2645 | */ |
| 2646 | void QContactOrganization::setTitle(const QString& _value) |
| 2647 | { |
| 2648 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QString>(field: QContactOrganization::FieldTitle, value: _value); |
| 2649 | } |
| 2650 | |
| 2651 | /*! |
| 2652 | \fn QContactOrganization::title() const |
| 2653 | Returns the contact's title within the organization stored in this detail. |
| 2654 | */ |
| 2655 | QString QContactOrganization::title() const |
| 2656 | { |
| 2657 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QString>(field: QContactOrganization::FieldTitle); |
| 2658 | } |
| 2659 | |
| 2660 | /*! |
| 2661 | \fn QContactOrganization::setAssistantName(const QString& assistantName) |
| 2662 | |
| 2663 | Sets the name of the default assistant of contacts belonging to |
| 2664 | this organization to \a assistantName. |
| 2665 | */ |
| 2666 | void QContactOrganization::setAssistantName(const QString& _value) |
| 2667 | { |
| 2668 | reinterpret_cast<QContactOrganizationPrivate*>(d.data())->setMemberValue<QString>(field: QContactOrganization::FieldAssistantName, value: _value); |
| 2669 | } |
| 2670 | |
| 2671 | /*! |
| 2672 | \fn QContactOrganization::assistantName() const |
| 2673 | |
| 2674 | Returns the name of the default assistant of contacts belonging to |
| 2675 | this organization. |
| 2676 | */ |
| 2677 | QString QContactOrganization::assistantName() const |
| 2678 | { |
| 2679 | return reinterpret_cast<const QContactOrganizationPrivate*>(d.constData())->memberValue<QString>(field: QContactOrganization::FieldAssistantName); |
| 2680 | } |
| 2681 | |
| 2682 | |
| 2683 | /* ==================== QContactRingtone ======================= */ |
| 2684 | |
| 2685 | /*! |
| 2686 | \class QContactRingtone |
| 2687 | \brief The QContactRingtone class provides a ringtone associated |
| 2688 | with a contact |
| 2689 | \ingroup contacts-details |
| 2690 | \inmodule QtContacts |
| 2691 | */ |
| 2692 | |
| 2693 | class QContactRingtonePrivate : public QContactDetailBuiltinPrivate<QContactRingtonePrivate> |
| 2694 | { |
| 2695 | public: |
| 2696 | QUrl m_audioRingtoneUrl; |
| 2697 | QUrl m_videoRingtoneUrl; |
| 2698 | QUrl m_vibrationRingtoneUrl; |
| 2699 | |
| 2700 | enum { FieldCount = 3 }; |
| 2701 | |
| 2702 | QContactRingtonePrivate() : QContactDetailBuiltinPrivate<QContactRingtonePrivate>(QContactRingtone::Type) {} |
| 2703 | }; |
| 2704 | |
| 2705 | template<> |
| 2706 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactRingtonePrivate>::s_members[] = { |
| 2707 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactRingtonePrivate, m_audioRingtoneUrl) }, |
| 2708 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactRingtonePrivate, m_videoRingtoneUrl) }, |
| 2709 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactRingtonePrivate, m_vibrationRingtoneUrl) }, |
| 2710 | }; |
| 2711 | |
| 2712 | /*! |
| 2713 | \variable QContactRingtone::Type |
| 2714 | The enum constant for the type identifier of QContactRingtone details. |
| 2715 | */ |
| 2716 | const QContactDetail::DetailType QContactRingtone::Type(QContactDetail::TypeRingtone); |
| 2717 | |
| 2718 | /*! |
| 2719 | \enum QContactRingtone::RingtoneField |
| 2720 | This enumeration defines the fields supported by QContactRingtone. |
| 2721 | \value FieldAudioRingtoneUrl The value stored in this field contains the URL for an audio ringtone. |
| 2722 | \value FieldVideoRingtoneUrl The value stored in this field contains the URL for a video ringtone. |
| 2723 | \value FieldVibrationRingtoneUrl The value stored in this field contains the URL for a vibration ringtone. |
| 2724 | \sa setAudioRingtoneUrl(), audioRingtoneUrl() |
| 2725 | \sa setVideoRingtoneUrl(), videoRingtoneUrl() |
| 2726 | */ |
| 2727 | |
| 2728 | /*! |
| 2729 | \fn QContactRingtone::audioRingtoneUrl() const |
| 2730 | |
| 2731 | Returns the uri of the audio ringtone stored in the ringtone detail. |
| 2732 | */ |
| 2733 | QUrl QContactRingtone::audioRingtoneUrl() const |
| 2734 | { |
| 2735 | return reinterpret_cast<const QContactRingtonePrivate*>(d.constData())->memberValue<QUrl>(field: QContactRingtone::FieldAudioRingtoneUrl); |
| 2736 | } |
| 2737 | |
| 2738 | /*! |
| 2739 | \fn QContactRingtone::setAudioRingtoneUrl(const QUrl& audioRingtoneUrl) |
| 2740 | |
| 2741 | Sets the uri of the audio ringtone stored in the ringtone detail |
| 2742 | to \a audioRingtoneUrl. |
| 2743 | */ |
| 2744 | void QContactRingtone::setAudioRingtoneUrl(const QUrl& _value) |
| 2745 | { |
| 2746 | reinterpret_cast<QContactRingtonePrivate*>(d.data())->setMemberValue<QUrl>(field: QContactRingtone::FieldAudioRingtoneUrl, value: _value); |
| 2747 | } |
| 2748 | |
| 2749 | /*! |
| 2750 | \fn QContactRingtone::videoRingtoneUrl() const |
| 2751 | |
| 2752 | Returns the uri of the video ringtone stored in the ringtone detail. |
| 2753 | */ |
| 2754 | QUrl QContactRingtone::videoRingtoneUrl() const |
| 2755 | { |
| 2756 | return reinterpret_cast<const QContactRingtonePrivate*>(d.constData())->memberValue<QUrl>(field: QContactRingtone::FieldVideoRingtoneUrl); |
| 2757 | } |
| 2758 | |
| 2759 | /*! |
| 2760 | \fn QContactRingtone::setVideoRingtoneUrl(const QUrl& videoRingtoneUrl) |
| 2761 | |
| 2762 | Sets the uri of the video ringtone stored in the ringtone detail |
| 2763 | to \a videoRingtoneUrl. |
| 2764 | */ |
| 2765 | void QContactRingtone::setVideoRingtoneUrl(const QUrl& _value) |
| 2766 | { |
| 2767 | reinterpret_cast<QContactRingtonePrivate*>(d.data())->setMemberValue<QUrl>(field: QContactRingtone::FieldVideoRingtoneUrl, value: _value); |
| 2768 | } |
| 2769 | |
| 2770 | /*! |
| 2771 | \fn QContactRingtone::vibrationRingtoneUrl() const |
| 2772 | |
| 2773 | Returns the uri of the vibration ringtone stored in the ringtone detail. |
| 2774 | */ |
| 2775 | QUrl QContactRingtone::vibrationRingtoneUrl() const |
| 2776 | { |
| 2777 | return reinterpret_cast<const QContactRingtonePrivate*>(d.constData())->memberValue<QUrl>(field: QContactRingtone::FieldVibrationRingtoneUrl); |
| 2778 | } |
| 2779 | |
| 2780 | /*! |
| 2781 | \fn QContactRingtone::setVibrationRingtoneUrl(const QUrl& vibrationRingtoneUrl) |
| 2782 | |
| 2783 | Sets the uri of the vibration ringtone stored in the ringtone detail |
| 2784 | to \a vibrationRingtoneUrl. |
| 2785 | */ |
| 2786 | void QContactRingtone::setVibrationRingtoneUrl(const QUrl& _value) |
| 2787 | { |
| 2788 | reinterpret_cast<QContactRingtonePrivate*>(d.data())->setMemberValue<QUrl>(field: QContactRingtone::FieldVibrationRingtoneUrl, value: _value); |
| 2789 | } |
| 2790 | |
| 2791 | /* ==================== QContactPresence ======================= */ |
| 2792 | |
| 2793 | // XXX TODO add more stuff here |
| 2794 | /*! |
| 2795 | \class QContactPresence |
| 2796 | \brief The QContactPresence class provides presence information |
| 2797 | for an online account of a contact. |
| 2798 | \inmodule QtContacts |
| 2799 | |
| 2800 | Presence information for a particular QContactOnlineAccount detail is provided |
| 2801 | in a QContactPresence detail which is linked (via linkedDetailUris()) to the |
| 2802 | account detail. This information is generally provided by the backend, and is |
| 2803 | not modifiable by clients. |
| 2804 | |
| 2805 | Presence information can include update timestamp, screen name, |
| 2806 | and the status icon, status value, and status text provided by |
| 2807 | the service provider, as well as user defined status message. |
| 2808 | |
| 2809 | \sa QContactOnlineAccount |
| 2810 | |
| 2811 | \ingroup contacts-details |
| 2812 | */ |
| 2813 | |
| 2814 | class QContactPresencePrivate : public QContactDetailBuiltinPrivate<QContactPresencePrivate> |
| 2815 | { |
| 2816 | public: |
| 2817 | QDateTime m_timestamp; |
| 2818 | QString m_nickname; |
| 2819 | int m_presenceState; |
| 2820 | QString m_presenceStateText; |
| 2821 | QUrl m_presenceStateImageUrl; |
| 2822 | QString m_customMessage; |
| 2823 | |
| 2824 | enum { FieldCount = 6 }; |
| 2825 | |
| 2826 | QContactPresencePrivate() : QContactDetailBuiltinPrivate<QContactPresencePrivate>(QContactPresence::Type), m_presenceState(0) {} |
| 2827 | }; |
| 2828 | |
| 2829 | template<> |
| 2830 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactPresencePrivate>::s_members[] = { |
| 2831 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactPresencePrivate, m_timestamp) }, |
| 2832 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactPresencePrivate, m_nickname) }, |
| 2833 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactPresencePrivate, m_presenceState) }, |
| 2834 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactPresencePrivate, m_presenceStateText) }, |
| 2835 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactPresencePrivate, m_presenceStateImageUrl) }, |
| 2836 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactPresencePrivate, m_customMessage) }, |
| 2837 | }; |
| 2838 | |
| 2839 | /*! |
| 2840 | \variable QContactPresence::Type |
| 2841 | The enum constant for the type identifier of QContactPresence details. |
| 2842 | */ |
| 2843 | const QContactDetail::DetailType QContactPresence::Type(QContactDetail::TypePresence); |
| 2844 | |
| 2845 | /*! |
| 2846 | \enum QContactPresence::PresenceField |
| 2847 | This enumeration defines the fields supported by QContactPresence. |
| 2848 | \value FieldTimestamp The value stored in this field contains the timestamp value. |
| 2849 | \value FieldNickname The value stored in this field contains the nickname value. |
| 2850 | \value FieldPresenceState The value stored in this field contains the presence state enumeration value. |
| 2851 | \value FieldPresenceStateText The value stored in this field contains the presence state description value. |
| 2852 | \value FieldPresenceStateImageUrl The value stored in this field contains the presence state image URL. |
| 2853 | \value FieldCustomMessage The value stored in this field contains the user-entered custom presence message. |
| 2854 | \sa setTimestamp(), timestamp() |
| 2855 | \sa setNickname(), nickname() |
| 2856 | \sa setPresenceState(), presenceState() |
| 2857 | \sa setPresenceStateText(), presenceStateText() |
| 2858 | \sa setPresenceStateImageUrl(), presenceStateImageUrl() |
| 2859 | \sa setCustomMessage(), customMessage() |
| 2860 | */ |
| 2861 | |
| 2862 | /*! |
| 2863 | \fn QContactPresence::setTimestamp(const QDateTime& updateTimestamp) |
| 2864 | |
| 2865 | Sets the timestamp for the last update of the presence detail to be |
| 2866 | \a updateTimestamp. |
| 2867 | */ |
| 2868 | void QContactPresence::setTimestamp(const QDateTime& _value) |
| 2869 | { |
| 2870 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactPresence::FieldTimestamp, value: _value); |
| 2871 | } |
| 2872 | |
| 2873 | /*! |
| 2874 | \fn QContactPresence::timestamp() const |
| 2875 | |
| 2876 | Returns the timestamp at which the data in the presence detail was valid. |
| 2877 | */ |
| 2878 | QDateTime QContactPresence::timestamp() const |
| 2879 | { |
| 2880 | return reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<QDateTime>(field: QContactPresence::FieldTimestamp); |
| 2881 | } |
| 2882 | |
| 2883 | /*! |
| 2884 | \fn QContactPresence::setNickname(const QString& nickname) |
| 2885 | |
| 2886 | Sets the last-known nickname used by the contact during |
| 2887 | communications via the online account about which this detail |
| 2888 | stores presence information to \a nickname. |
| 2889 | */ |
| 2890 | void QContactPresence::setNickname(const QString& _value) |
| 2891 | { |
| 2892 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactPresence::FieldNickname, value: _value); |
| 2893 | } |
| 2894 | |
| 2895 | /*! |
| 2896 | \fn QContactPresence::nickname() const |
| 2897 | |
| 2898 | Returns the last-known nickname used by the contact during |
| 2899 | communications via the online account. |
| 2900 | */ |
| 2901 | QString QContactPresence::nickname() const |
| 2902 | { |
| 2903 | return reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactPresence::FieldNickname); |
| 2904 | } |
| 2905 | |
| 2906 | /*! |
| 2907 | \enum QContactPresence::PresenceState |
| 2908 | |
| 2909 | This enum defines the possible presence states supported by the default schema. |
| 2910 | Not all presence providers support all of these states. |
| 2911 | |
| 2912 | \value PresenceUnknown Signifies that the presence state of the contact is not currently known |
| 2913 | \value PresenceAvailable Signifies that the contact is available |
| 2914 | \value PresenceHidden Signifies that the contact is hidden |
| 2915 | \value PresenceBusy Signifies that the contact is busy |
| 2916 | \value PresenceAway Signifies that the contact is away |
| 2917 | \value PresenceExtendedAway Signifies that the contact is away for an extended period of time |
| 2918 | \value PresenceOffline Signifies that the contact is offline |
| 2919 | */ |
| 2920 | /*! |
| 2921 | \fn QContactPresence::setPresenceState(QContactPresence::PresenceState presenceState) |
| 2922 | |
| 2923 | Sets the presence state of the online account according to the presence |
| 2924 | information provider to the given \a presenceState. |
| 2925 | */ |
| 2926 | void QContactPresence::setPresenceState(QContactPresence::PresenceState _value) |
| 2927 | { |
| 2928 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<int>(field: QContactPresence::FieldPresenceState, value: static_cast<int>(_value)); |
| 2929 | } |
| 2930 | |
| 2931 | /*! |
| 2932 | \fn QContactPresence::presenceState() const |
| 2933 | |
| 2934 | Returns the presence state of the online account according to the |
| 2935 | presence provider. |
| 2936 | */ |
| 2937 | QContactPresence::PresenceState QContactPresence::presenceState() const |
| 2938 | { |
| 2939 | return static_cast<QContactPresence::PresenceState>(reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<int>(field: QContactPresence::FieldPresenceState)); |
| 2940 | } |
| 2941 | |
| 2942 | /*! |
| 2943 | \fn QContactPresence::setPresenceStateText(const QString& presenceStateText) |
| 2944 | |
| 2945 | Sets the text corresponding to the presence state to \a presenceStateText. |
| 2946 | This function is generally called by presence providers to allow custom |
| 2947 | naming of states, or to allow finer grained state reporting than is |
| 2948 | provided by the presence state API. |
| 2949 | */ |
| 2950 | void QContactPresence::setPresenceStateText(const QString& _value) |
| 2951 | { |
| 2952 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactPresence::FieldPresenceStateText, value: _value); |
| 2953 | } |
| 2954 | |
| 2955 | /*! |
| 2956 | \fn QContactPresence::presenceStateText() const |
| 2957 | |
| 2958 | Returns the text corresponding to the current presence state. |
| 2959 | */ |
| 2960 | QString QContactPresence::presenceStateText() const |
| 2961 | { |
| 2962 | return reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactPresence::FieldPresenceStateText); |
| 2963 | } |
| 2964 | |
| 2965 | /*! |
| 2966 | \fn QContactPresence::setCustomMessage(const QString& customMessage) |
| 2967 | |
| 2968 | Sets the custom status message from the contact for the online account |
| 2969 | about which this detail stores presence information, to \a customMessage. |
| 2970 | This custom message would have been set by the contact, |
| 2971 | and does not necessarily correspond to a particular presence state. |
| 2972 | */ |
| 2973 | void QContactPresence::setCustomMessage(const QString& _value) |
| 2974 | { |
| 2975 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactPresence::FieldCustomMessage, value: _value); |
| 2976 | } |
| 2977 | |
| 2978 | /*! |
| 2979 | \fn QContactPresence::customMessage() const |
| 2980 | |
| 2981 | Returns the custom status message from the contact for the online account |
| 2982 | about which this detail stores presence information. |
| 2983 | */ |
| 2984 | QString QContactPresence::customMessage() const |
| 2985 | { |
| 2986 | return reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactPresence::FieldCustomMessage); |
| 2987 | } |
| 2988 | |
| 2989 | /*! |
| 2990 | \fn QContactPresence::setPresenceStateImageUrl(const QUrl& presenceStateImageUrl) |
| 2991 | |
| 2992 | Sets the last-known status image url of the contact for the online account |
| 2993 | about which this detail stores presence information, to \a presenceStateImageUrl. |
| 2994 | */ |
| 2995 | void QContactPresence::setPresenceStateImageUrl(const QUrl& _value) |
| 2996 | { |
| 2997 | reinterpret_cast<QContactPresencePrivate*>(d.data())->setMemberValue<QUrl>(field: QContactPresence::FieldPresenceStateImageUrl, value: _value); |
| 2998 | } |
| 2999 | |
| 3000 | /*! |
| 3001 | \fn QContactPresence::presenceStateImageUrl() const |
| 3002 | |
| 3003 | Returns the last-known status image url of the contact for the online account |
| 3004 | about which this detail stores presence information. |
| 3005 | */ |
| 3006 | QUrl QContactPresence::presenceStateImageUrl() const |
| 3007 | { |
| 3008 | return reinterpret_cast<const QContactPresencePrivate*>(d.constData())->memberValue<QUrl>(field: QContactPresence::FieldPresenceStateImageUrl); |
| 3009 | } |
| 3010 | |
| 3011 | /* ==================== QContactGlobalPresence ======================= */ |
| 3012 | |
| 3013 | /*! |
| 3014 | \class QContactGlobalPresence |
| 3015 | \brief The QContactGlobalPresence class provides aggregated presence information |
| 3016 | for a contact, synthesized or supplied by the backend. |
| 3017 | \ingroup contacts-details |
| 3018 | \inmodule QtContacts |
| 3019 | */ |
| 3020 | |
| 3021 | class QContactGlobalPresencePrivate : public QContactDetailBuiltinPrivate<QContactGlobalPresencePrivate> |
| 3022 | { |
| 3023 | public: |
| 3024 | QDateTime m_timestamp; |
| 3025 | QString m_nickname; |
| 3026 | int m_presenceState; |
| 3027 | QString m_presenceStateText; |
| 3028 | QUrl m_presenceStateImageUrl; |
| 3029 | QString m_customMessage; |
| 3030 | |
| 3031 | enum { FieldCount = 6 }; |
| 3032 | |
| 3033 | QContactGlobalPresencePrivate() : QContactDetailBuiltinPrivate<QContactGlobalPresencePrivate>(QContactGlobalPresence::Type), m_presenceState(0) {} |
| 3034 | }; |
| 3035 | |
| 3036 | template<> |
| 3037 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactGlobalPresencePrivate>::s_members[] = { |
| 3038 | { .type: QContactDetailBuiltinPrivateBase::DateTime, offsetof(QContactGlobalPresencePrivate, m_timestamp) }, |
| 3039 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactGlobalPresencePrivate, m_nickname) }, |
| 3040 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactGlobalPresencePrivate, m_presenceState) }, |
| 3041 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactGlobalPresencePrivate, m_presenceStateText) }, |
| 3042 | { .type: QContactDetailBuiltinPrivateBase::Url, offsetof(QContactGlobalPresencePrivate, m_presenceStateImageUrl) }, |
| 3043 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactGlobalPresencePrivate, m_customMessage) }, |
| 3044 | }; |
| 3045 | |
| 3046 | /*! |
| 3047 | \variable QContactGlobalPresence::Type |
| 3048 | The enum constant for the type identifier of QContactGlobalPresence details. |
| 3049 | */ |
| 3050 | const QContactDetail::DetailType QContactGlobalPresence::Type(QContactDetail::TypeGlobalPresence); |
| 3051 | |
| 3052 | /*! |
| 3053 | \enum QContactGlobalPresence::GlobalPresenceField |
| 3054 | This enumeration defines the fields supported by QContactGlobalPresence. |
| 3055 | \value FieldTimestamp The value stored in this field contains the timestamp value. |
| 3056 | \value FieldNickname The value stored in this field contains the nickname value. |
| 3057 | \value FieldPresenceState The value stored in this field contains the presence state enumeration value. |
| 3058 | \value FieldPresenceStateText The value stored in this field contains the presence state description value. |
| 3059 | \value FieldPresenceStateImageUrl The value stored in this field contains the presence state image URL. |
| 3060 | \value FieldCustomMessage The value stored in this field contains the user-entered custom presence message. |
| 3061 | \sa setTimestamp(), timestamp() |
| 3062 | \sa setNickname(), nickname() |
| 3063 | \sa setPresenceState(), presenceState() |
| 3064 | \sa setPresenceStateText(), presenceStateText() |
| 3065 | \sa setPresenceStateImageUrl(), presenceStateImageUrl() |
| 3066 | \sa setCustomMessage(), customMessage() |
| 3067 | */ |
| 3068 | |
| 3069 | /*! |
| 3070 | \fn QContactGlobalPresence::setTimestamp(const QDateTime& updateTimestamp) |
| 3071 | |
| 3072 | Sets the update timestamp of the global presence detail to be |
| 3073 | \a updateTimestamp. |
| 3074 | */ |
| 3075 | void QContactGlobalPresence::setTimestamp(const QDateTime& _value) |
| 3076 | { |
| 3077 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<QDateTime>(field: QContactGlobalPresence::FieldTimestamp, value: _value); |
| 3078 | } |
| 3079 | |
| 3080 | /*! |
| 3081 | \fn QContactGlobalPresence::timestamp() const |
| 3082 | |
| 3083 | Returns the timestamp at which the data in the global presence detail was valid. |
| 3084 | */ |
| 3085 | QDateTime QContactGlobalPresence::timestamp() const |
| 3086 | { |
| 3087 | return reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<QDateTime>(field: QContactGlobalPresence::FieldTimestamp); |
| 3088 | } |
| 3089 | |
| 3090 | /*! |
| 3091 | \fn QContactGlobalPresence::setNickname(const QString& nickname) |
| 3092 | |
| 3093 | Sets the last-known nickname used by the contact during |
| 3094 | communications via any online account about which this detail |
| 3095 | aggregates presence information to \a nickname. |
| 3096 | */ |
| 3097 | void QContactGlobalPresence::setNickname(const QString& _value) |
| 3098 | { |
| 3099 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactGlobalPresence::FieldNickname, value: _value); |
| 3100 | } |
| 3101 | |
| 3102 | /*! |
| 3103 | \fn QContactGlobalPresence::nickname() const |
| 3104 | |
| 3105 | Returns the last-known nickname used by the contact during |
| 3106 | communications via any online account about which this detail |
| 3107 | aggregates presence information. |
| 3108 | */ |
| 3109 | QString QContactGlobalPresence::nickname() const |
| 3110 | { |
| 3111 | return reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactGlobalPresence::FieldNickname); |
| 3112 | } |
| 3113 | |
| 3114 | /*! |
| 3115 | \fn QContactGlobalPresence::setPresenceState(QContactPresence::PresenceState presenceState) |
| 3116 | |
| 3117 | Sets the presence state of this aggregate detail according to the presence |
| 3118 | information available from the presence providers which this detail aggregates |
| 3119 | to the given \a presenceState. |
| 3120 | */ |
| 3121 | void QContactGlobalPresence::setPresenceState(QContactPresence::PresenceState _value) |
| 3122 | { |
| 3123 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<int>(field: QContactGlobalPresence::FieldPresenceState, value: static_cast<int>(_value)); |
| 3124 | } |
| 3125 | |
| 3126 | /*! |
| 3127 | \fn QContactGlobalPresence::presenceState() const |
| 3128 | |
| 3129 | Returns the aggregate presence state of any online accounts about which this detail |
| 3130 | aggregates presence information. |
| 3131 | */ |
| 3132 | QContactPresence::PresenceState QContactGlobalPresence::presenceState() const |
| 3133 | { |
| 3134 | return static_cast<QContactPresence::PresenceState>(reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<int>(field: QContactGlobalPresence::FieldPresenceState)); |
| 3135 | } |
| 3136 | |
| 3137 | /*! |
| 3138 | \fn QContactGlobalPresence::setPresenceStateText(const QString& presenceStateText) |
| 3139 | |
| 3140 | Sets the text corresponding to the presence state to \a presenceStateText. |
| 3141 | This function is generally called by presence providers to allow custom |
| 3142 | naming of states, or to allow finer grained state reporting than is |
| 3143 | provided by the presence state API. |
| 3144 | */ |
| 3145 | void QContactGlobalPresence::setPresenceStateText(const QString& _value) |
| 3146 | { |
| 3147 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactGlobalPresence::FieldPresenceStateText, value: _value); |
| 3148 | } |
| 3149 | |
| 3150 | /*! |
| 3151 | \fn QContactGlobalPresence::presenceStateText() const |
| 3152 | |
| 3153 | Returns the text corresponding to the current presence state. |
| 3154 | */ |
| 3155 | QString QContactGlobalPresence::presenceStateText() const |
| 3156 | { |
| 3157 | return reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactGlobalPresence::FieldPresenceStateText); |
| 3158 | } |
| 3159 | |
| 3160 | /*! |
| 3161 | \fn QContactGlobalPresence::setCustomMessage(const QString& customMessage) |
| 3162 | |
| 3163 | Sets the custom status message from the contact for the aggregate presence |
| 3164 | detail, to \a customMessage. |
| 3165 | */ |
| 3166 | void QContactGlobalPresence::setCustomMessage(const QString& _value) |
| 3167 | { |
| 3168 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<QString>(field: QContactGlobalPresence::FieldCustomMessage, value: _value); |
| 3169 | } |
| 3170 | |
| 3171 | |
| 3172 | /*! |
| 3173 | \fn QContactGlobalPresence::customMessage() const |
| 3174 | |
| 3175 | Returns the custom status message from the contact for the aggregate presence |
| 3176 | detail. |
| 3177 | */ |
| 3178 | QString QContactGlobalPresence::customMessage() const |
| 3179 | { |
| 3180 | return reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<QString>(field: QContactGlobalPresence::FieldCustomMessage); |
| 3181 | } |
| 3182 | |
| 3183 | /*! |
| 3184 | \fn QContactGlobalPresence::setPresenceStateImageUrl(const QUrl& presenceStateImageUrl) |
| 3185 | |
| 3186 | Sets the last-known status image url of the contact to \a presenceStateImageUrl. |
| 3187 | */ |
| 3188 | void QContactGlobalPresence::setPresenceStateImageUrl(const QUrl& _value) |
| 3189 | { |
| 3190 | reinterpret_cast<QContactGlobalPresencePrivate*>(d.data())->setMemberValue<QUrl>(field: QContactGlobalPresence::FieldPresenceStateImageUrl, value: _value); |
| 3191 | } |
| 3192 | |
| 3193 | /*! |
| 3194 | \fn QContactGlobalPresence::presenceStateImageUrl() const |
| 3195 | |
| 3196 | Returns the last-known status image url of the contact. |
| 3197 | */ |
| 3198 | QUrl QContactGlobalPresence::presenceStateImageUrl() const |
| 3199 | { |
| 3200 | return reinterpret_cast<const QContactGlobalPresencePrivate*>(d.constData())->memberValue<QUrl>(field: QContactGlobalPresence::FieldPresenceStateImageUrl); |
| 3201 | } |
| 3202 | |
| 3203 | /*! |
| 3204 | Returns a filter which matches any contact whose global presence state |
| 3205 | is listed as \a state. |
| 3206 | */ |
| 3207 | QContactFilter QContactGlobalPresence::match(QContactPresence::PresenceState state) |
| 3208 | { |
| 3209 | QContactDetailFilter f; |
| 3210 | f.setDetailType(type: QContactGlobalPresence::Type, field: QContactGlobalPresence::FieldPresenceState); |
| 3211 | f.setValue(state); |
| 3212 | f.setMatchFlags(QContactFilter::MatchExactly); |
| 3213 | |
| 3214 | return f; |
| 3215 | } |
| 3216 | |
| 3217 | |
| 3218 | /* ==================== QContactExtendedDetail ======================= */ |
| 3219 | /*! |
| 3220 | \class QContactExtendedDetail |
| 3221 | \brief The QContactExtendedDetail class provides the possibility to save extended details to QContact objects. |
| 3222 | \inmodule QtContacts |
| 3223 | \ingroup contacts-details |
| 3224 | |
| 3225 | Different back-end engines may or may not support extended details for different contact types. Even |
| 3226 | if supported, they may accept different QVariant types as the data. The back-end engine may convert |
| 3227 | the data to another type that the engine supports. |
| 3228 | */ |
| 3229 | |
| 3230 | class QContactExtendedDetailPrivate : public QContactDetailBuiltinPrivate<QContactExtendedDetailPrivate> |
| 3231 | { |
| 3232 | public: |
| 3233 | QString m_name; |
| 3234 | QVariant m_data; |
| 3235 | |
| 3236 | enum { FieldCount = 2 }; |
| 3237 | |
| 3238 | QContactExtendedDetailPrivate() : QContactDetailBuiltinPrivate<QContactExtendedDetailPrivate>(QContactExtendedDetail::Type) {} |
| 3239 | }; |
| 3240 | |
| 3241 | template<> |
| 3242 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactExtendedDetailPrivate>::s_members[] = { |
| 3243 | { .type: QContactDetailBuiltinPrivateBase::String, offsetof(QContactExtendedDetailPrivate, m_name) }, |
| 3244 | { .type: QContactDetailBuiltinPrivateBase::Variant, offsetof(QContactExtendedDetailPrivate, m_data) }, |
| 3245 | }; |
| 3246 | |
| 3247 | /*! |
| 3248 | \variable QContactExtendedDetail::Type |
| 3249 | |
| 3250 | The constant enum which identifies the type of details which are extended details. |
| 3251 | */ |
| 3252 | const QContactDetail::DetailType QContactExtendedDetail::Type(QContactDetail::TypeExtendedDetail); |
| 3253 | |
| 3254 | /*! |
| 3255 | \enum QContactExtendedDetail::ExtendedDetailField |
| 3256 | This enumeration defines the fields supported by QContactExtendedDetail. |
| 3257 | \value FieldName The value stored in this field contains the name of the extended detail. |
| 3258 | \value FieldData The value stored in this field contains the data of this extended detail. |
| 3259 | */ |
| 3260 | |
| 3261 | /*! |
| 3262 | \fn void QContactExtendedDetail::setName(const QString &name) |
| 3263 | |
| 3264 | Sets the \a name of this extended detail. |
| 3265 | */ |
| 3266 | void QContactExtendedDetail::setName(const QString& _value) |
| 3267 | { |
| 3268 | reinterpret_cast<QContactExtendedDetailPrivate*>(d.data())->setMemberValue<QString>(field: QContactExtendedDetail::FieldName, value: _value); |
| 3269 | } |
| 3270 | |
| 3271 | /*! |
| 3272 | \fn QString QContactExtendedDetail::name() const |
| 3273 | |
| 3274 | Gets the name of this extended detail. |
| 3275 | */ |
| 3276 | QString QContactExtendedDetail::name() const |
| 3277 | { |
| 3278 | return reinterpret_cast<const QContactExtendedDetailPrivate*>(d.constData())->memberValue<QString>(field: QContactExtendedDetail::FieldName); |
| 3279 | } |
| 3280 | |
| 3281 | /*! |
| 3282 | \fn void QContactExtendedDetail::setData(const QVariant &data) |
| 3283 | |
| 3284 | Sets the \a data of the extended detail. |
| 3285 | */ |
| 3286 | void QContactExtendedDetail::setData(const QVariant& _value) |
| 3287 | { |
| 3288 | reinterpret_cast<QContactExtendedDetailPrivate*>(d.data())->setMemberValue(field: QContactExtendedDetail::FieldData, value: _value); |
| 3289 | } |
| 3290 | |
| 3291 | /*! |
| 3292 | \fn QVariant QContactExtendedDetail::data() const |
| 3293 | |
| 3294 | Gets the data of this extended detail. |
| 3295 | */ |
| 3296 | QVariant QContactExtendedDetail::data() const |
| 3297 | { |
| 3298 | return reinterpret_cast<const QContactExtendedDetailPrivate*>(d.constData())->memberValue<QVariant>(field: QContactExtendedDetail::FieldData); |
| 3299 | } |
| 3300 | |
| 3301 | |
| 3302 | /* ==================== QContactVersion ======================= */ |
| 3303 | /*! |
| 3304 | \class QContactVersion |
| 3305 | \brief The QContactVersion class provides the versioning information of a QContact object. |
| 3306 | \inmodule QtContacts |
| 3307 | \ingroup contacts-details |
| 3308 | */ |
| 3309 | |
| 3310 | class QContactVersionPrivate : public QContactDetailBuiltinPrivate<QContactVersionPrivate> |
| 3311 | { |
| 3312 | public: |
| 3313 | int m_sequenceNumber; |
| 3314 | QByteArray m_extendedVersion; |
| 3315 | |
| 3316 | enum { FieldCount = 2 }; |
| 3317 | |
| 3318 | QContactVersionPrivate() : QContactDetailBuiltinPrivate<QContactVersionPrivate>(QContactVersion::Type), m_sequenceNumber(0) {} |
| 3319 | }; |
| 3320 | |
| 3321 | template<> |
| 3322 | const QContactDetailBuiltinPrivateBase::Member QContactDetailBuiltinPrivate<QContactVersionPrivate>::s_members[] = { |
| 3323 | { .type: QContactDetailBuiltinPrivateBase::Int, offsetof(QContactVersionPrivate, m_sequenceNumber) }, |
| 3324 | { .type: QContactDetailBuiltinPrivateBase::ByteArray, offsetof(QContactVersionPrivate, m_extendedVersion) }, |
| 3325 | }; |
| 3326 | |
| 3327 | /*! |
| 3328 | \variable QContactVersion::Type |
| 3329 | |
| 3330 | The constant string which identifies the definition of details which are extended details. |
| 3331 | */ |
| 3332 | const QContactDetail::DetailType QContactVersion::Type(QContactDetail::TypeVersion); |
| 3333 | |
| 3334 | /*! |
| 3335 | \enum QContactVersion::VersionField |
| 3336 | This enumeration defines the fields supported by QContactVersion. |
| 3337 | \value FieldSequenceNumber Contains the integer sequence number of a QContact object. |
| 3338 | \value FieldExtendedVersion Contains the extended version of a QContact object. It can be used to represent the version stored |
| 3339 | in the back-end in cases when the back-end specific version cannot be represented only by a sequence number. |
| 3340 | */ |
| 3341 | |
| 3342 | /*! |
| 3343 | \fn void QContactVersion::setSequenceNumber(int sequenceNumber) |
| 3344 | |
| 3345 | Sets the integer \a sequenceNumber. |
| 3346 | */ |
| 3347 | void QContactVersion::setSequenceNumber(int _value) |
| 3348 | { |
| 3349 | reinterpret_cast<QContactVersionPrivate*>(d.data())->setMemberValue<int>(field: QContactVersion::FieldSequenceNumber, value: _value); |
| 3350 | } |
| 3351 | |
| 3352 | /*! |
| 3353 | \fn int QContactVersion::sequenceNumber() const |
| 3354 | |
| 3355 | Gets the integer sequenceNumber. |
| 3356 | */ |
| 3357 | int QContactVersion::sequenceNumber() const |
| 3358 | { |
| 3359 | return reinterpret_cast<const QContactVersionPrivate*>(d.constData())->memberValue<int>(field: QContactVersion::FieldSequenceNumber); |
| 3360 | } |
| 3361 | |
| 3362 | /*! |
| 3363 | \fn void QContactVersion::setExtendedVersion(const QByteArray &extendedVersion) |
| 3364 | |
| 3365 | Sets the \a extendedVersion. |
| 3366 | */ |
| 3367 | void QContactVersion::setExtendedVersion(const QByteArray& _value) |
| 3368 | { |
| 3369 | reinterpret_cast<QContactVersionPrivate*>(d.data())->setMemberValue<QByteArray>(field: QContactVersion::FieldExtendedVersion, value: _value); |
| 3370 | } |
| 3371 | |
| 3372 | /*! |
| 3373 | \fn QByteArray QContactVersion::extendedVersion() const |
| 3374 | |
| 3375 | Gets the extendedVersion. |
| 3376 | */ |
| 3377 | QByteArray QContactVersion::extendedVersion() const |
| 3378 | { |
| 3379 | return reinterpret_cast<const QContactVersionPrivate*>(d.constData())->memberValue<QByteArray>(field: QContactVersion::FieldExtendedVersion); |
| 3380 | } |
| 3381 | |
| 3382 | |
| 3383 | /* ==================== Convenience Filters ======================= */ |
| 3384 | |
| 3385 | /*! |
| 3386 | Returns a filter suitable for finding contacts with a display label containing the specified |
| 3387 | \a label. |
| 3388 | */ |
| 3389 | QContactFilter QContactDisplayLabel::match(const QString &label) |
| 3390 | { |
| 3391 | QContactDetailFilter f; |
| 3392 | f.setDetailType(type: QContactDisplayLabel::Type, field: QContactDisplayLabel::FieldLabel); |
| 3393 | f.setValue(label); |
| 3394 | f.setMatchFlags(QContactFilter::MatchContains); |
| 3395 | |
| 3396 | return f; |
| 3397 | } |
| 3398 | |
| 3399 | /*! |
| 3400 | Returns a filter suitable for finding contacts with a name with a first name containing the |
| 3401 | specified \a firstName and a last name containing the specified \a lastName. If either |
| 3402 | parameter is empty, any value will match that component. |
| 3403 | */ |
| 3404 | QContactFilter QContactName::match(const QString &firstName, const QString &lastName) |
| 3405 | { |
| 3406 | if (firstName.isEmpty()) { |
| 3407 | if (lastName.isEmpty()) { |
| 3408 | // Matches contacts that have a name |
| 3409 | QContactDetailFilter f; |
| 3410 | f.setDetailType(type: QContactName::Type); |
| 3411 | return f; |
| 3412 | } else { |
| 3413 | // Contact with matching lastname |
| 3414 | QContactDetailFilter f; |
| 3415 | f.setDetailType(type: QContactName::Type, field: QContactName::FieldLastName); |
| 3416 | f.setValue(lastName); |
| 3417 | f.setMatchFlags(QContactFilter::MatchContains); |
| 3418 | return f; |
| 3419 | } |
| 3420 | } else { |
| 3421 | if (lastName.isEmpty()) { |
| 3422 | // Contact with matching firstName |
| 3423 | QContactDetailFilter f; |
| 3424 | f.setDetailType(type: QContactName::Type, field: QContactName::FieldFirstName); |
| 3425 | f.setValue(firstName); |
| 3426 | f.setMatchFlags(QContactFilter::MatchContains); |
| 3427 | return f; |
| 3428 | } else { |
| 3429 | // Match a contact with the specified first and last names |
| 3430 | // XXX This needs multi detail filter! |
| 3431 | |
| 3432 | // Best we can currently do is "and" and assume there's only one name per contact |
| 3433 | QContactDetailFilter f; |
| 3434 | f.setDetailType(type: QContactName::Type, field: QContactName::FieldFirstName); |
| 3435 | f.setValue(firstName); |
| 3436 | f.setMatchFlags(QContactFilter::MatchContains); |
| 3437 | QContactDetailFilter l; |
| 3438 | l.setDetailType(type: QContactName::Type, field: QContactName::FieldLastName); |
| 3439 | l.setValue(lastName); |
| 3440 | l.setMatchFlags(QContactFilter::MatchContains); |
| 3441 | |
| 3442 | return f & l; |
| 3443 | } |
| 3444 | } |
| 3445 | } |
| 3446 | |
| 3447 | /*! |
| 3448 | Returns a filter suitable for finding contacts with any name field (e.g. first, last) that |
| 3449 | contains the supplied \a name. |
| 3450 | */ |
| 3451 | QContactFilter QContactName::match(const QString &name) |
| 3452 | { |
| 3453 | QContactUnionFilter nameFilter; |
| 3454 | QList<int> nameFields; |
| 3455 | nameFields << QContactName::FieldFirstName |
| 3456 | << QContactName::FieldLastName |
| 3457 | << QContactName::FieldMiddleName |
| 3458 | << QContactName::FieldPrefix |
| 3459 | << QContactName::FieldSuffix; |
| 3460 | foreach (int fieldName, nameFields) { |
| 3461 | QContactDetailFilter subFilter; |
| 3462 | subFilter.setDetailType(type: QContactName::Type, field: fieldName); |
| 3463 | subFilter.setValue(name); |
| 3464 | subFilter.setMatchFlags(QContactFilter::MatchContains); |
| 3465 | nameFilter.append(filter: subFilter); |
| 3466 | } |
| 3467 | return nameFilter; |
| 3468 | } |
| 3469 | |
| 3470 | /*! |
| 3471 | Returns a filter suitable for finding contacts with an email address containing the specified |
| 3472 | \a emailAddress. |
| 3473 | */ |
| 3474 | QContactFilter QContactEmailAddress::match(const QString &emailAddress) |
| 3475 | { |
| 3476 | QContactDetailFilter l; |
| 3477 | l.setDetailType(type: QContactEmailAddress::Type, field: QContactEmailAddress::FieldEmailAddress); |
| 3478 | l.setValue(emailAddress); |
| 3479 | l.setMatchFlags(QContactFilter::MatchContains); |
| 3480 | return l; |
| 3481 | } |
| 3482 | |
| 3483 | /*! |
| 3484 | Returns a filter suitable for finding contacts with a phone number containing the specified |
| 3485 | \a number. |
| 3486 | */ |
| 3487 | QContactFilter QContactPhoneNumber::match(const QString &number) |
| 3488 | { |
| 3489 | QContactDetailFilter l; |
| 3490 | l.setDetailType(type: QContactPhoneNumber::Type, field: QContactPhoneNumber::FieldNumber); |
| 3491 | l.setValue(number); |
| 3492 | l.setMatchFlags(QContactFilter::MatchPhoneNumber); |
| 3493 | return l; |
| 3494 | } |
| 3495 | |
| 3496 | /* |
| 3497 | Adding a new builtin-detail-type requires extending this function! |
| 3498 | */ |
| 3499 | QContactDetailPrivate *QContactDetailPrivate::construct(QContactDetail::DetailType detailType) |
| 3500 | { |
| 3501 | switch (detailType) { |
| 3502 | case QContactDetail::TypeAddress: return new QContactAddressPrivate; |
| 3503 | case QContactDetail::TypeAnniversary: return new QContactAnniversaryPrivate; |
| 3504 | case QContactDetail::TypeAvatar: return new QContactAvatarPrivate; |
| 3505 | case QContactDetail::TypeBirthday: return new QContactBirthdayPrivate; |
| 3506 | case QContactDetail::TypeDisplayLabel: return new QContactDisplayLabelPrivate; |
| 3507 | case QContactDetail::TypeEmailAddress: return new QContactEmailAddressPrivate; |
| 3508 | case QContactDetail::TypeExtendedDetail:return new QContactExtendedDetailPrivate; |
| 3509 | case QContactDetail::TypeFamily: return new QContactFamilyPrivate; |
| 3510 | case QContactDetail::TypeFavorite: return new QContactFavoritePrivate; |
| 3511 | case QContactDetail::TypeGender: return new QContactGenderPrivate; |
| 3512 | case QContactDetail::TypeGeoLocation: return new QContactGeoLocationPrivate; |
| 3513 | case QContactDetail::TypeGlobalPresence:return new QContactGlobalPresencePrivate; |
| 3514 | case QContactDetail::TypeGuid: return new QContactGuidPrivate; |
| 3515 | case QContactDetail::TypeHobby: return new QContactHobbyPrivate; |
| 3516 | case QContactDetail::TypeName: return new QContactNamePrivate; |
| 3517 | case QContactDetail::TypeNickname: return new QContactNicknamePrivate; |
| 3518 | case QContactDetail::TypeNote: return new QContactNotePrivate; |
| 3519 | case QContactDetail::TypeOnlineAccount: return new QContactOnlineAccountPrivate; |
| 3520 | case QContactDetail::TypeOrganization: return new QContactOrganizationPrivate; |
| 3521 | case QContactDetail::TypePhoneNumber: return new QContactPhoneNumberPrivate; |
| 3522 | case QContactDetail::TypePresence: return new QContactPresencePrivate; |
| 3523 | case QContactDetail::TypeRingtone: return new QContactRingtonePrivate; |
| 3524 | case QContactDetail::TypeSyncTarget: return new QContactSyncTargetPrivate; |
| 3525 | case QContactDetail::TypeTag: return new QContactTagPrivate; |
| 3526 | case QContactDetail::TypeTimestamp: return new QContactTimestampPrivate; |
| 3527 | case QContactDetail::TypeType: return new QContactTypePrivate; |
| 3528 | case QContactDetail::TypeUrl: return new QContactUrlPrivate; |
| 3529 | case QContactDetail::TypeVersion: return new QContactVersionPrivate; |
| 3530 | default: return new QContactDetailPrivate(detailType); |
| 3531 | } |
| 3532 | } |
| 3533 | |
| 3534 | |
| 3535 | /*! |
| 3536 | \fn QContactDetail::QContactDetail(QContactDetail::DetailType type) |
| 3537 | Constructs a new, empty detail of the type identified by \a type. |
| 3538 | */ |
| 3539 | QContactDetail::QContactDetail(QContactDetail::DetailType type) |
| 3540 | : d(QContactDetailPrivate::construct(detailType: type)) |
| 3541 | { |
| 3542 | } |
| 3543 | |
| 3544 | /*! |
| 3545 | \internal |
| 3546 | \fn QContactDetail::QContactDetail(const QContactDetail& other, DetailType expectedType) |
| 3547 | |
| 3548 | Constructs a detail that is a copy of \a other if \a other is of the expected type |
| 3549 | identified by \a expectedType, else constructs a new, empty detail of the |
| 3550 | type identified by the \a expectedType |
| 3551 | */ |
| 3552 | QContactDetail::QContactDetail(const QContactDetail& other, DetailType expectedType) |
| 3553 | { |
| 3554 | if (other.d.constData()->m_type == expectedType) { |
| 3555 | d = other.d; |
| 3556 | } else { |
| 3557 | d = QContactDetailPrivate::construct(detailType: expectedType); |
| 3558 | } |
| 3559 | } |
| 3560 | |
| 3561 | /*! |
| 3562 | \internal |
| 3563 | \fn QContactDetail& QContactDetail::assign(const QContactDetail& other, DetailType expectedType) |
| 3564 | |
| 3565 | Assigns this detail to \a other if the type of \a other is that identified |
| 3566 | by the given \a expectedType, else assigns this detail to be a new, empty |
| 3567 | detail of the type identified by the given \a expectedType |
| 3568 | */ |
| 3569 | QContactDetail& QContactDetail::assign(const QContactDetail& other, DetailType expectedType) |
| 3570 | { |
| 3571 | if (this != &other) { |
| 3572 | if (other.d.constData()->m_type == expectedType) { |
| 3573 | d = other.d; |
| 3574 | } else { |
| 3575 | d = QContactDetailPrivate::construct(detailType: expectedType); |
| 3576 | } |
| 3577 | } |
| 3578 | return *this; |
| 3579 | } |
| 3580 | |
| 3581 | QT_WARNING_POP /* -Winvalid-offsetof */ |
| 3582 | |
| 3583 | QT_END_NAMESPACE_CONTACTS |
| 3584 | |