|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 |
|
43 #ifndef QCONTACTADDRESS_H |
|
44 #define QCONTACTADDRESS_H |
|
45 |
|
46 #include <QString> |
|
47 |
|
48 #include "qtcontactsglobal.h" |
|
49 #include "qcontactdetail.h" |
|
50 #include "qcontact.h" |
|
51 |
|
52 QTM_BEGIN_NAMESPACE |
|
53 |
|
54 /* Leaf class */ |
|
55 class Q_CONTACTS_EXPORT QContactAddress : public QContactDetail |
|
56 { |
|
57 public: |
|
58 #ifdef Q_QDOC |
|
59 static const QLatin1Constant DefinitionName; |
|
60 static const QLatin1Constant FieldStreet; |
|
61 static const QLatin1Constant FieldLocality; |
|
62 static const QLatin1Constant FieldRegion; |
|
63 static const QLatin1Constant FieldPostcode; |
|
64 static const QLatin1Constant FieldCountry; |
|
65 static const QLatin1Constant FieldSubTypes; |
|
66 static const QLatin1Constant FieldPostOfficeBox; |
|
67 static const QLatin1Constant SubTypeParcel; |
|
68 static const QLatin1Constant SubTypePostal; |
|
69 static const QLatin1Constant SubTypeDomestic; |
|
70 static const QLatin1Constant SubTypeInternational; |
|
71 #else |
|
72 Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactAddress, "Address") |
|
73 Q_DECLARE_LATIN1_CONSTANT(FieldStreet, "Street"); |
|
74 Q_DECLARE_LATIN1_CONSTANT(FieldLocality, "Locality"); |
|
75 Q_DECLARE_LATIN1_CONSTANT(FieldRegion, "Region"); |
|
76 Q_DECLARE_LATIN1_CONSTANT(FieldPostcode, "Postcode"); |
|
77 Q_DECLARE_LATIN1_CONSTANT(FieldCountry, "Country"); |
|
78 Q_DECLARE_LATIN1_CONSTANT(FieldSubTypes, "SubTypes"); |
|
79 Q_DECLARE_LATIN1_CONSTANT(FieldPostOfficeBox, "PostOfficeBox"); |
|
80 Q_DECLARE_LATIN1_CONSTANT(SubTypeParcel, "Parcel"); |
|
81 Q_DECLARE_LATIN1_CONSTANT(SubTypePostal, "Postal"); |
|
82 Q_DECLARE_LATIN1_CONSTANT(SubTypeDomestic, "Domestic"); |
|
83 Q_DECLARE_LATIN1_CONSTANT(SubTypeInternational, "International"); |
|
84 #endif |
|
85 |
|
86 void setStreet(const QString& street) {setValue(FieldStreet, street);} |
|
87 QString street() const {return value(FieldStreet);} |
|
88 void setLocality(const QString& locality) {setValue(FieldLocality, locality);} |
|
89 QString locality() const {return value(FieldLocality);} |
|
90 void setRegion(const QString& region) {setValue(FieldRegion, region);} |
|
91 QString region() const {return value(FieldRegion);} |
|
92 void setPostcode(const QString& postcode) {setValue(FieldPostcode, postcode);} |
|
93 QString postcode() const {return value(FieldPostcode);} |
|
94 void setCountry(const QString& country) {setValue(FieldCountry, country);} |
|
95 QString country() const {return value(FieldCountry);} |
|
96 void setPostOfficeBox(const QString& postOfficeBox) {setValue(FieldPostOfficeBox, postOfficeBox);} |
|
97 QString postOfficeBox() const {return value(FieldPostOfficeBox);} |
|
98 |
|
99 void setSubTypes(const QStringList& subTypes) {setValue(FieldSubTypes, subTypes);} |
|
100 void setSubTypes(const QString& subType) {setValue(FieldSubTypes, QStringList(subType));} |
|
101 QStringList subTypes() const {return value<QStringList>(FieldSubTypes);} |
|
102 }; |
|
103 |
|
104 QTM_END_NAMESPACE |
|
105 |
|
106 #endif |
|
107 |