1 /* |
|
2 * Copyright (c) 2006 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: GSFW plugin header for Presence Settings UI GS plugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef PSUIGSPLUGIN_H |
|
22 #define PSUIGSPLUGIN_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <eikmobs.h> |
|
26 #include <ConeResLoader.h> |
|
27 #include <gsbaseview.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CPSUIGSPluginContainer; |
|
31 class CPSUIGSPluginModel; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Header of CPSUIGSPlugin which implements the CGSPluginInterface. |
|
37 * |
|
38 * @lib PSUIGSPlugin.lib |
|
39 * @since Series60_3.2 |
|
40 */ |
|
41 class CPSUIGSPlugin : |
|
42 public CGSBaseView, |
|
43 public MCoeViewDeactivationObserver, |
|
44 public MEikListBoxObserver |
|
45 { |
|
46 |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Symbian OS two-phased constructor |
|
51 */ |
|
52 static CPSUIGSPlugin* NewL( TAny* aAppUi ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CPSUIGSPlugin(); |
|
58 |
|
59 private: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From CAknView |
|
63 * See base class. |
|
64 */ |
|
65 TUid Id() const; |
|
66 |
|
67 /** |
|
68 * From CAknView |
|
69 * See base class. |
|
70 */ |
|
71 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
72 TUid aCustomMessageId, |
|
73 const TDesC8& aCustomMessage ); |
|
74 |
|
75 /** |
|
76 * From CAknView |
|
77 * See base class. |
|
78 */ |
|
79 void DoDeactivate(); |
|
80 |
|
81 /** |
|
82 * From CAknView |
|
83 * See base class. |
|
84 */ |
|
85 void HandleCommandL( TInt aCommand ); |
|
86 |
|
87 /** |
|
88 * From CGSBaseView |
|
89 * See base class. |
|
90 */ |
|
91 void NewContainerL(); |
|
92 |
|
93 /** |
|
94 * From CGSBaseView |
|
95 * See base class. |
|
96 */ |
|
97 void HandleListBoxSelectionL(); |
|
98 |
|
99 /** |
|
100 * From CGSPluginInterface |
|
101 * See base class. |
|
102 */ |
|
103 void GetCaptionL( TDes& aCaption ) const; |
|
104 |
|
105 /** |
|
106 * From CGSPluginInterface |
|
107 * See base class. |
|
108 */ |
|
109 TInt PluginProviderCategory() const; |
|
110 |
|
111 /** |
|
112 * From CGSPluginInterface |
|
113 * See base class. |
|
114 */ |
|
115 CGulIcon* CreateIconL( const TUid aIconType ); |
|
116 |
|
117 /** |
|
118 * From MEikMenuObserver |
|
119 * See base class. |
|
120 */ |
|
121 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane *aMenuPane ); |
|
122 |
|
123 /** |
|
124 * From MCoeViewDeactivationObserver |
|
125 * Used to be able to free memory when plugin get's closed. |
|
126 * See base class. |
|
127 */ |
|
128 void HandleViewDeactivation ( |
|
129 const TVwsViewId& aViewIdToBeDeactivated, |
|
130 const TVwsViewId& aNewlyActivatedViewId ); |
|
131 |
|
132 /** |
|
133 * From MEikListBoxObserver |
|
134 * See base class. |
|
135 */ |
|
136 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
137 |
|
138 public: // New |
|
139 |
|
140 /** |
|
141 * Gives a handle to PS Model. Ownership is not transferred. |
|
142 * |
|
143 * @return handle to PS Model |
|
144 */ |
|
145 CPSUIGSPluginModel* PSModel(); |
|
146 |
|
147 /** |
|
148 * Takes care of settings deletion. |
|
149 */ |
|
150 void DeleteSettingsL(); |
|
151 |
|
152 private: // New |
|
153 |
|
154 /** |
|
155 * Returns count and index of current item in listbox. |
|
156 * |
|
157 * @param aIndex returns the index. If no items, KErrNotFound. |
|
158 * @return TInt containing the count. |
|
159 */ |
|
160 TInt SettingCountAndIndex( TInt& aIndex ); |
|
161 |
|
162 /** |
|
163 * Shows the delete certain setting set confirmation note. |
|
164 * |
|
165 * @param aCount is the amount of all settings |
|
166 * @param aIndex is the to be deleted setting set |
|
167 * @return TBool about proceed with deletion. |
|
168 */ |
|
169 TBool AcceptDeletionL( TInt aCount, TInt aIndex ); |
|
170 |
|
171 /** |
|
172 * Constructs the setting view |
|
173 */ |
|
174 void ConstructSettingViewL(); |
|
175 |
|
176 /** |
|
177 * Removes the setting view |
|
178 */ |
|
179 void RemoveSettingView(); |
|
180 |
|
181 /** |
|
182 * Create new default settings and launch setting view |
|
183 */ |
|
184 void CreateNewDefaultSettingsL(); |
|
185 |
|
186 /** |
|
187 * Create new a copy of existing settings and launch setting view |
|
188 */ |
|
189 void CreateCopyOfExistingSettingsL(); |
|
190 |
|
191 /** |
|
192 * Toggles visibility of MSK depending on the amount of setting sets |
|
193 */ |
|
194 void UpdateMSK(); |
|
195 |
|
196 private: // Constructors |
|
197 |
|
198 /** |
|
199 * C++ default constructor. |
|
200 */ |
|
201 CPSUIGSPlugin(); |
|
202 |
|
203 /** |
|
204 * Symbian OS default constructor. |
|
205 */ |
|
206 void ConstructL(); |
|
207 |
|
208 private: // Data |
|
209 |
|
210 // Presence UI model |
|
211 CPSUIGSPluginModel* iPSModel; |
|
212 // Presence Setting view |
|
213 CAknView* iSettingView; |
|
214 // Indicates when PSUIGSPlugin's views are closed |
|
215 TBool iClosing; |
|
216 // Previous view |
|
217 TVwsViewId iPSUIGSPrevViewId; |
|
218 |
|
219 #ifdef _DEBUG |
|
220 friend class UT_CPSUIGSPlugin; |
|
221 friend class UT_CPSUIGSPluginContainer; |
|
222 #endif |
|
223 }; |
|
224 |
|
225 #endif // PSUIGSPLUGIN_H |
|
226 // End of File |
|