|
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: This is for SUPL Positioning Settings plugin |
|
15 * for Advanced View |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef POSSUPLSETTINGS_PLUGIN_H |
|
20 #define POSSUPLSETTINGS_PLUGIN_H |
|
21 |
|
22 //User Includes |
|
23 #include "possuplsettingscommon.h" |
|
24 #include "possettingssignalmapper.h" |
|
25 |
|
26 #include <QObject> |
|
27 #include <hbdataformmodelitem.h> |
|
28 #include <possettingsadvinterface.h> |
|
29 #include <qsignalmapper.h> |
|
30 #include <hbdataformviewitem.h> |
|
31 |
|
32 //Forward Declaration |
|
33 class PosSettingsAdvOp; |
|
34 class PosSuplSettingsEngine; |
|
35 class QModelIndex; |
|
36 class HbRadioButtonList; |
|
37 class HbDialog; |
|
38 |
|
39 class PosSuplSettingsPlugin : public QObject, public PosSettingsAdvInterface |
|
40 |
|
41 { |
|
42 Q_OBJECT |
|
43 Q_INTERFACES( PosSettingsAdvInterface ) |
|
44 public: |
|
45 /** |
|
46 * Constructor |
|
47 */ |
|
48 PosSuplSettingsPlugin(); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 ~PosSuplSettingsPlugin(); |
|
54 public: |
|
55 /* |
|
56 * Derived from PosSettingsAdvInterface |
|
57 */ |
|
58 virtual int initialise(PosSettingsAdvOp* operation); |
|
59 |
|
60 private: |
|
61 /** |
|
62 * This method is used to list all the server that are present for |
|
63 * positioing. Depending on whether the server is enabled/disabled for positioning |
|
64 * the corresponding checkboxes are marked. |
|
65 */ |
|
66 void listServers(); |
|
67 |
|
68 /** |
|
69 * This method creates menu to delete the servers |
|
70 */ |
|
71 void createMenu(); |
|
72 |
|
73 private slots: |
|
74 /** |
|
75 * This is used as a slot whenever the checkbox is marked/unmarked. |
|
76 * On changing the state of the checkbox the corresponding positioning |
|
77 * server is enabled/disabled |
|
78 * @param [in] - slpid for the server to be enababled/disabled |
|
79 */ |
|
80 void changeServerUsage(int slpid); |
|
81 |
|
82 /** |
|
83 * This is slot, which is called whenever there is a new server added or |
|
84 * a server in the list is deleted. This refreshes the view. |
|
85 */ |
|
86 void updateList(); |
|
87 |
|
88 /** |
|
89 * This is slot, which is called when the user selects the |
|
90 * server to be deleted |
|
91 */ |
|
92 void onDeleteServer(); |
|
93 |
|
94 /** |
|
95 * This slot is used to enable the primary Action wheneven |
|
96 * a server is selected from the list of servers to be deleted |
|
97 * @param [in] - index of the server to be deleted |
|
98 */ |
|
99 void setPrimaryAction(int itemSelected); |
|
100 |
|
101 /** |
|
102 * This slot is used to delete the server whenever |
|
103 * a server is selected from the list of servers to be deleted |
|
104 */ |
|
105 void deleteServer(); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * an object if the supl setting engine class |
|
111 * Owns |
|
112 */ |
|
113 PosSuplSettingsEngine* mSuplSettingsEngine; |
|
114 |
|
115 /** |
|
116 * an object of data form model item class |
|
117 * Owns |
|
118 */ |
|
119 HbDataFormModelItem * mGroup; |
|
120 |
|
121 /** |
|
122 * Holds the params of the list of servers |
|
123 * Owns |
|
124 */ |
|
125 QList<PosServerParams> mServerList; |
|
126 |
|
127 /** |
|
128 * hold the signal mapper objects of PosPsySettingsSignalMapper |
|
129 * Owns |
|
130 */ |
|
131 QList<PosSettingsSignalMapper*> mSignalMapperList; |
|
132 |
|
133 /** |
|
134 * Handle to PosSettingsAdvOp object |
|
135 * Does not own |
|
136 */ |
|
137 PosSettingsAdvOp * mOperation; |
|
138 |
|
139 /** |
|
140 * an object of QSignalMapper |
|
141 * Owns |
|
142 */ |
|
143 QSignalMapper * mSignalMapper; |
|
144 |
|
145 /** |
|
146 * an object on HbMenu |
|
147 * Owns |
|
148 */ |
|
149 HbMenu* mMainMenu; |
|
150 |
|
151 /** |
|
152 * list of servers that can be deleted |
|
153 * Owns |
|
154 */ |
|
155 QList<PosServerParams> mDeleteableServerList; |
|
156 |
|
157 /** |
|
158 * an instance of HBAction, used for SK1 in |
|
159 * the delete server Dialog box |
|
160 * Owns |
|
161 */ |
|
162 HbAction* mPrimaryAction; |
|
163 |
|
164 /** |
|
165 * an instance of HbRadioButtonList, used to add server |
|
166 * in the delete server selection Dialog box |
|
167 * Owns |
|
168 */ |
|
169 HbRadioButtonList *mRadioButtonList; |
|
170 |
|
171 /** |
|
172 * holds the server delete query dialog |
|
173 * Owns |
|
174 */ |
|
175 HbDialog *mDeleteQuery; |
|
176 }; |
|
177 #endif // POSSUPLSETTINGS_PLUGIN_H |