|
1 /* |
|
2 * Copyright (c) 2002 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 * Declares CApNetSelPopupList for network selection. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef APNETSEL_POPUP_LIST_DIALOG_H |
|
21 #define APNETSEL_POPUP_LIST_DIALOG_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include <aknradiobuttonsettingpage.h> |
|
26 #include <ActiveApDb.h> // for MActiveApDbObserver |
|
27 |
|
28 #include <ApSettingsHandlerCommons.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 class CApNetSelectorListboxModel; |
|
34 class CApSettingsHandlerImpl; |
|
35 class CApSettingsModel; |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * CApNetSelPopupList class |
|
41 * Pop-up network selector 'control' object. |
|
42 */ |
|
43 NONSHARABLE_CLASS( CApNetSelPopupList ) : public CAknRadioButtonSettingPage, |
|
44 public MActiveApDbObserver |
|
45 { |
|
46 |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * 2 phase construction |
|
51 * @param aModel The data model object |
|
52 * @param aHandler The data handler object |
|
53 * @param aCurrentSelectionIndex The required selection index |
|
54 * @param aPreferredUid The preferred UID |
|
55 * @param aEventStore Stores the events |
|
56 * @param aItemArray Itemarray |
|
57 * @param aNeedsNone Gives whether it disoplays the item 'None' or not |
|
58 * @return the constructed CApNetSelPopupList object |
|
59 */ |
|
60 static CApNetSelPopupList* NewL |
|
61 ( |
|
62 CApSettingsModel& aModel, |
|
63 CApSettingsHandlerImpl& aHandler, |
|
64 TInt& aCurrentSelectionIndex, |
|
65 TInt& aPreferredUid, |
|
66 TUint32& aEventStore, |
|
67 CDesCArrayFlat* aItemArray, |
|
68 TBool aNeedsNone |
|
69 ); |
|
70 |
|
71 // Two phased construction |
|
72 virtual void ConstructL(); |
|
73 |
|
74 private: |
|
75 /** |
|
76 * 2 phase construction |
|
77 * @param aModel The data model object |
|
78 * @param aHandler The data handler object |
|
79 * @param aCurrentSelectionIndex The required selection index |
|
80 * @param aPreferredUid The preferred UID |
|
81 * @param aEventStore Stores the events |
|
82 * @param aItemArray Itemarray |
|
83 * @param aNeedsNone Gives whether it disoplays the item 'None' or not |
|
84 * @return the constructed CApNetSelPopupList object |
|
85 */ |
|
86 CApNetSelPopupList |
|
87 ( |
|
88 CApSettingsModel& aModel, |
|
89 CApSettingsHandlerImpl& aHandler, |
|
90 TInt& aIndex, |
|
91 TInt& aPreferredUid, |
|
92 CDesCArrayFlat* aItemArray, |
|
93 TUint32& aEventStore, |
|
94 TBool aNeedsNone |
|
95 ); |
|
96 |
|
97 virtual ~CApNetSelPopupList(); |
|
98 |
|
99 public: // New functions |
|
100 void SetHighlighted(); |
|
101 |
|
102 private: |
|
103 /** |
|
104 * It tells whether the Select menu item needs to be deleted or not |
|
105 * @param aResourcfeId The menu resource ID |
|
106 * @return Boolean indicating whether the Select menu item |
|
107 * needs to be deleted or not |
|
108 */ |
|
109 TBool Need2DeleteSelect( TInt aResourceId ); |
|
110 |
|
111 /** |
|
112 * It tells whether the Open & the Dlete menu item needs |
|
113 * to be deleted or not |
|
114 * @param aResourcfeId The menu resource ID |
|
115 * @return Boolean indicating whether the Delete menu item |
|
116 * needs to be deleted or not |
|
117 */ |
|
118 TBool Need2DeleteOpenDelete( TInt aResourceId ); |
|
119 |
|
120 |
|
121 /** |
|
122 * Creates a new network group |
|
123 * @return TBool indicating successful creation |
|
124 */ |
|
125 TBool HandleCreateNewNetworkGroupL(); |
|
126 |
|
127 |
|
128 public: // Functions from base classes |
|
129 // From CCoeControl |
|
130 virtual void GetHelpContext(TCoeHelpContext& aContext) const; |
|
131 |
|
132 /** |
|
133 * Implements the MActiveApDbObserver protocol |
|
134 */ |
|
135 virtual void HandleApDbEventL( TEvent anEvent ); |
|
136 |
|
137 |
|
138 /** |
|
139 * Overrides ActivateL |
|
140 */ |
|
141 virtual void ActivateL(); |
|
142 |
|
143 protected: |
|
144 // From CAknRadioButtonPage |
|
145 /* |
|
146 * Needed to know about SELECTION (not HIGHLIGHT!) changes |
|
147 * to be able to update currently valid selection UID. |
|
148 */ |
|
149 virtual void SelectCurrentItemL(); |
|
150 |
|
151 private: |
|
152 /** |
|
153 * From CAknSettingPage |
|
154 */ |
|
155 TBool OkToExitL( TInt aButtonId ); |
|
156 |
|
157 protected: // New functions |
|
158 /** |
|
159 * Fills up listbox control with data dynamically |
|
160 */ |
|
161 void FillListBoxWithDataL(); |
|
162 |
|
163 /* |
|
164 * Sets the Selected item in the list. |
|
165 * Needed to initialize the list according to the Uid and |
|
166 * not to 'itemindex'... |
|
167 */ |
|
168 void SetSelectedL(); |
|
169 |
|
170 protected: // Functions from base classes |
|
171 |
|
172 /** |
|
173 * From CAknSettingPage |
|
174 */ |
|
175 virtual void DynInitMenuPaneL( TInt aResourceId, |
|
176 CEikMenuPane* aMenuPane ); |
|
177 |
|
178 // From MEikCommandObserver |
|
179 virtual void ProcessCommandL( TInt aCommandId ); |
|
180 |
|
181 // From CCoeControl |
|
182 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
183 TEventCode aType); |
|
184 |
|
185 private: //data |
|
186 CApSettingsModel* iDataModel; // not owned, passed for usage |
|
187 CAknSetStyleListBox* iList; |
|
188 |
|
189 CApNetSelectorListboxModel* iModel; // owns it, just passes |
|
190 // items for usage to list! |
|
191 |
|
192 TInt* iSelected; // not owns it,passed for usage |
|
193 CApSettingsHandlerImpl* iHandler; // not owns it,passed for usage |
|
194 TUint32* iEventStore;// to hold the events |
|
195 TUint32 iPreferredUid; |
|
196 TInt iPreferredLine; |
|
197 TBool iNeedsNone; |
|
198 TBool iNeedUnlock; |
|
199 TBool iHelpSupported; |
|
200 TBool iProtectionSupported; |
|
201 |
|
202 }; |
|
203 |
|
204 #endif // APNETSEL_POPUP_LIST_DIALOG_H |
|
205 |
|
206 // End of File |