1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef QLOCATIONPICKERITEM_H |
|
19 #define QLOCATIONPICKERITEM_H |
|
20 |
|
21 #include <QString> |
|
22 #include <xqserviceipcmarshal.h> |
|
23 |
|
24 /** class defines location type |
|
25 */ |
|
26 class QLocationPickerItem |
|
27 { |
|
28 public: |
|
29 QLocationPickerItem():mIsValid(false) |
|
30 {}; |
|
31 ~QLocationPickerItem() {}; |
|
32 |
|
33 // copy contructor |
|
34 inline QLocationPickerItem(const QLocationPickerItem &l) |
|
35 { |
|
36 mIsValid = l.mIsValid; |
|
37 mName = l.mName; |
|
38 mStreet = l.mStreet; |
|
39 mPostalCode = l.mPostalCode; |
|
40 mCity = l.mCity; |
|
41 mState = l.mState; |
|
42 mCountry = l.mCountry; |
|
43 mLatitude = l.mLatitude; |
|
44 mLongitude = l.mLongitude; |
|
45 }; |
|
46 |
|
47 // assignment operator |
|
48 inline QLocationPickerItem &operator=(const QLocationPickerItem &l) |
|
49 { |
|
50 mIsValid = l.mIsValid; |
|
51 mName = l.mName; |
|
52 mStreet = l.mStreet; |
|
53 mPostalCode = l.mPostalCode; |
|
54 mCity = l.mCity; |
|
55 mState = l.mState; |
|
56 mCountry = l.mCountry; |
|
57 mLatitude = l.mLatitude; |
|
58 mLongitude = l.mLongitude; |
|
59 return *this; |
|
60 }; |
|
61 |
|
62 bool mIsValid; // if the current object is valid |
|
63 QString mName; // location name |
|
64 QString mStreet; // location street |
|
65 QString mPostalCode; // location postal code |
|
66 QString mCity; // location city |
|
67 QString mState; // location state/region |
|
68 QString mCountry; // location country |
|
69 double mLatitude; // latitude |
|
70 double mLongitude; // longitude |
|
71 |
|
72 // functions to pass data between application |
|
73 template <typename Stream> void serialize(Stream &stream) const; |
|
74 template <typename Stream> void deserialize(Stream &stream); |
|
75 }; |
|
76 |
|
77 template <typename Stream> inline void QLocationPickerItem::serialize(Stream &s) const |
|
78 { |
|
79 s << mIsValid; |
|
80 s << mName; |
|
81 s << mStreet; |
|
82 s << mPostalCode; |
|
83 s << mCity; |
|
84 s << mState; |
|
85 s << mCountry; |
|
86 s << mLatitude; |
|
87 s << mLongitude; |
|
88 } |
|
89 |
|
90 template <typename Stream> inline void QLocationPickerItem::deserialize(Stream &s) |
|
91 { |
|
92 s >> mIsValid; |
|
93 s >> mName; |
|
94 s >> mStreet; |
|
95 s >> mPostalCode; |
|
96 s >> mCity; |
|
97 s >> mState; |
|
98 s >> mCountry; |
|
99 s >> mLatitude; |
|
100 s >> mLongitude; |
|
101 } |
|
102 |
|
103 |
|
104 Q_DECLARE_USER_METATYPE(QLocationPickerItem) |
|
105 |
|
106 #endif // QLOCATIONPICKERITEM_H |
|