|
1 /* |
|
2 * Copyright (c) 2010 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: Positioning settings view class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef POSSETTINGSFORM_H |
|
19 #define POSSETTINGSFORM_H |
|
20 |
|
21 #include <hbdataform.h> |
|
22 |
|
23 class HbDataFormModelItem; |
|
24 class PosSettingsEngine; |
|
25 class PosSettingsAdvView; |
|
26 class HbAction; |
|
27 |
|
28 class PosSettingsForm : public HbDataForm |
|
29 { |
|
30 Q_OBJECT |
|
31 private: |
|
32 /* |
|
33 * Enumarator for the positioning category type |
|
34 */ |
|
35 enum PosTypeIndex |
|
36 { |
|
37 /* |
|
38 * The position of GPS in HbDataForm |
|
39 */ |
|
40 PosTypeIndexGps = 1, |
|
41 |
|
42 /* |
|
43 * The position of Wireless in HbDataForm |
|
44 */ |
|
45 PosTypeIndexWireless = 2 , |
|
46 |
|
47 /* |
|
48 * The position of Background in HbDataForm |
|
49 */ |
|
50 PosTypeIndexBackground = 3 |
|
51 }; |
|
52 public: |
|
53 /** |
|
54 * Constructor. |
|
55 */ |
|
56 explicit PosSettingsForm( PosSettingsEngine& settingsEngine, |
|
57 QGraphicsItem *parent = 0 ); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 */ |
|
62 ~PosSettingsForm(); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * It will initiate the basic setting view |
|
67 */ |
|
68 void initSettingModel(); |
|
69 |
|
70 /** |
|
71 * It will validate visibility of Positioning type |
|
72 * |
|
73 * posTypeModelItemIndex[in] - The position at which control should be placed |
|
74 */ |
|
75 void validatePosTypeVisibility(PosTypeIndex posTypeModelItemIndex); |
|
76 |
|
77 /** |
|
78 * It will insert/remove Positioning type control in HbDataForm |
|
79 * |
|
80 * insert[in] - if true insert control else remove it |
|
81 * posTypeModelItem[in] - HbDataFormModelItem handle for position type |
|
82 * posTypeModelItemIndex[in] - The position at which control should be placed |
|
83 * posIndex[in] - The absolute poisition index at which control should be placed. |
|
84 * It will different from posTypeModelItemIndex for Wireless and Background |
|
85 * depending on GPS, Wireless are visible. |
|
86 */ |
|
87 void insertOrRemovePosTypeModelItem(bool insert, HbDataFormModelItem* posTypeModelItem, |
|
88 PosTypeIndex posTypeModelItemIndex, int posIndex); |
|
89 /* |
|
90 * It will create HbDataFormModelItem based on the position specified |
|
91 * |
|
92 * posTypeModelItemIndex [in] - The position at which control should be placed |
|
93 */ |
|
94 void createPosTypeModelItem(PosTypeIndex posTypeModelItemIndex); |
|
95 |
|
96 /** |
|
97 * It will mark/unmark positioning category checkbox |
|
98 * |
|
99 * posTypeModelItemIndex [in] - The position at which control should be placed |
|
100 */ |
|
101 void setPosTypeState(PosTypeIndex posTypeModelItemIndex); |
|
102 |
|
103 /** |
|
104 * It will add connection for the given model item |
|
105 * |
|
106 * posTypeModelItem [in] - HbDataFormModelItem handle for position type |
|
107 */ |
|
108 void addPosTypeConnection(HbDataFormModelItem* posTypeModelItem); |
|
109 |
|
110 private slots: |
|
111 /** |
|
112 * It will be called when 'Advanced' push button is pressed |
|
113 */ |
|
114 void onPressedAdvanced(); |
|
115 |
|
116 /** |
|
117 * It will be called when 'GPS' checkbox is clicked |
|
118 */ |
|
119 void onPressedGps(); |
|
120 |
|
121 /** |
|
122 * It will be called when 'Wirelss' checkbox is clicked |
|
123 */ |
|
124 void onPressedWireless(); |
|
125 |
|
126 /* |
|
127 * It will be called when 'Background' checkbox is clicked |
|
128 */ |
|
129 void onPressedBackground(); |
|
130 /* |
|
131 * It will be called when the Back Button is pressed to dismiss the |
|
132 * advanced view |
|
133 */ |
|
134 void closeAdvancedView(); |
|
135 |
|
136 /** |
|
137 * It will validate visibility of all positioning type controls |
|
138 * It will also be called when new positioning technology is |
|
139 * added at runtime |
|
140 */ |
|
141 void validateVisibility(); |
|
142 |
|
143 private: // Data memebers |
|
144 /** |
|
145 * Handle to engine |
|
146 * Not Own |
|
147 */ |
|
148 PosSettingsEngine& mSettingsEngine; |
|
149 |
|
150 /** |
|
151 * Handle to 'GPS' checkbox |
|
152 * Not Own |
|
153 */ |
|
154 HbDataFormModelItem *mGpsPosType; |
|
155 |
|
156 /** |
|
157 * Handle to 'Wireless' checkbox |
|
158 * Not Own |
|
159 */ |
|
160 HbDataFormModelItem *mWirelessPosType; |
|
161 |
|
162 /** |
|
163 * Handle to 'Background' checkbox |
|
164 * Not Own |
|
165 */ |
|
166 HbDataFormModelItem *mBgPosType; |
|
167 |
|
168 /** |
|
169 * Handle to 'Advanced' push button |
|
170 * Not Own |
|
171 */ |
|
172 HbDataFormModelItem *mAdvancedSettings; |
|
173 |
|
174 /** |
|
175 * Handle to Heading groupbox |
|
176 * Not Own |
|
177 */ |
|
178 HbDataFormModelItem *mHeading; |
|
179 |
|
180 /** |
|
181 * Pointer to Advanced view class |
|
182 * Owns this pointer. |
|
183 */ |
|
184 PosSettingsAdvView* mAdvancedView; |
|
185 |
|
186 /** |
|
187 * handle to the Back Action |
|
188 */ |
|
189 HbAction* mBackAction; |
|
190 |
|
191 }; |
|
192 #endif // POSSETTINGSFORM_H |