|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 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 QCONTACTGEOLOCATION_H |
|
44 #define QCONTACTGEOLOCATION_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 // replaces the below |
|
56 class Q_CONTACTS_EXPORT QContactGeoLocation : public QContactDetail |
|
57 { |
|
58 public: |
|
59 #ifdef Q_QDOC |
|
60 const char* DefinitionName; |
|
61 const char* FieldLabel; |
|
62 const char* FieldLatitude; |
|
63 const char* FieldLongitude; |
|
64 const char* FieldAccuracy; |
|
65 const char* FieldAltitude; |
|
66 const char* FieldAltitudeAccuracy; |
|
67 const char* FieldHeading; |
|
68 const char* FieldSpeed; |
|
69 const char* FieldTimestamp; |
|
70 #else |
|
71 Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactGeoLocation, "GeoLocation") |
|
72 Q_DECLARE_LATIN1_LITERAL(FieldLabel, "Label"); |
|
73 Q_DECLARE_LATIN1_LITERAL(FieldLatitude, "Latitude"); |
|
74 Q_DECLARE_LATIN1_LITERAL(FieldLongitude, "Longitude"); |
|
75 Q_DECLARE_LATIN1_LITERAL(FieldAccuracy, "Accuracy"); |
|
76 Q_DECLARE_LATIN1_LITERAL(FieldAltitude, "Altitude"); |
|
77 Q_DECLARE_LATIN1_LITERAL(FieldAltitudeAccuracy, "AltitudeAccuracy"); |
|
78 Q_DECLARE_LATIN1_LITERAL(FieldHeading, "Heading"); |
|
79 Q_DECLARE_LATIN1_LITERAL(FieldSpeed, "Speed"); |
|
80 Q_DECLARE_LATIN1_LITERAL(FieldTimestamp, "Timestamp"); |
|
81 #endif |
|
82 |
|
83 void setLabel(const QString& label) {setValue(FieldLabel, label);} |
|
84 QString label() const {return value(FieldLabel);} |
|
85 void setLatitude(double latitude) {setValue(FieldLatitude, latitude);} |
|
86 double latitude() const {return variantValue(FieldLatitude).toDouble();} |
|
87 void setLongitude(double longitude) {setValue(FieldLongitude, longitude);} |
|
88 double longitude() const {return variantValue(FieldLongitude).toDouble();} |
|
89 void setAccuracy(double accuracy) {setValue(FieldAccuracy, accuracy);} |
|
90 double accuracy() const {return variantValue(FieldAccuracy).toDouble();} |
|
91 void setAltitude(double altitude) {setValue(FieldAltitude, altitude);} |
|
92 double altitude() const {return variantValue(FieldAltitude).toDouble();} |
|
93 void setAltitudeAccuracy(double altitudeAccuracy) {setValue(FieldAltitudeAccuracy, altitudeAccuracy);} |
|
94 double altitudeAccuracy() const {return variantValue(FieldAltitudeAccuracy).toDouble();} |
|
95 void setHeading(double heading) {setValue(FieldHeading, heading);} |
|
96 double heading() const {return variantValue(FieldHeading).toDouble();} |
|
97 void setSpeed(double speed) {setValue(FieldSpeed, speed);} |
|
98 double speed() const {return variantValue(FieldSpeed).toDouble();} |
|
99 void setTimestamp(const QDateTime& timestamp) {setValue(FieldTimestamp, timestamp);} |
|
100 QDateTime timestamp() const {return variantValue(FieldTimestamp).toDateTime();} |
|
101 }; |
|
102 |
|
103 QTM_END_NAMESPACE |
|
104 |
|
105 #endif |
|
106 |