|
1 /* |
|
2 * Copyright (c) 2005 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 * SIPSettings plugin implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef SIP_SETTINGS_PLUGIN_H |
|
21 #define SIP_SETTINGS_PLUGIN_H |
|
22 |
|
23 // System includes |
|
24 #include <eikclb.h> |
|
25 #include <ConeResLoader.h> |
|
26 #include <gsplugininterface.h> |
|
27 #include "MGsFWMSKLabelObserver.h" |
|
28 |
|
29 // Classes referenced |
|
30 class CSIPSettingsContainer; |
|
31 class CAknNavigationDecorator; |
|
32 class CAknViewAppUi; |
|
33 class CEikFormattedCellListBox; |
|
34 class CAknPopupList; |
|
35 class CSIPSettingsModel; |
|
36 class CGSSIPModel; |
|
37 |
|
38 // Constants |
|
39 const TUid KGSSIPSettingsPluginUID = { 0x101FD6D0 }; //SIP Settings ECom plug-in uid |
|
40 //const TUid KUidGS = { 0x100058EC }; // GS uid, needed in help handling |
|
41 _LIT( KSIPSettingsResourceFileName, "z:GSSIPSettingsPluginRsc.rsc" ); |
|
42 _LIT( KGSDefaultSIPIconFileName, "Z:\\resource\\apps\\GSSIPSettingsplugin.mbm"); |
|
43 _LIT( KSIPluginIconFileName, "\\resource\\apps\\GSSIPSettingsplugin.mif"); |
|
44 |
|
45 |
|
46 |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * CPacketDataPlugin view class. |
|
51 * |
|
52 * This class handles state and application logic of SIP settings. |
|
53 * |
|
54 * |
|
55 */ |
|
56 class CSIPSettingsPlugin |
|
57 : public CGSPluginInterface, |
|
58 public MEikListBoxObserver, |
|
59 public MGsFWMSKObserver |
|
60 |
|
61 { |
|
62 public: // Constructors and destructor |
|
63 /** |
|
64 * Symbian OS two-phased constructor |
|
65 * @return |
|
66 */ |
|
67 static CSIPSettingsPlugin* NewL( TAny* aAppUi ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 ~CSIPSettingsPlugin(); |
|
73 |
|
74 /** |
|
75 * Checks if the MSK label needs to be adjusted. |
|
76 */ |
|
77 void CheckMiddleSoftkeyLabelL(); |
|
78 |
|
79 /** |
|
80 * Remove command and label from MSK. |
|
81 */ |
|
82 void RemoveCommandFromMSK( const TBool flag); |
|
83 |
|
84 /** |
|
85 * Adds given resource text as MSK to CBA. |
|
86 * |
|
87 * @param aResourceId middle softkey label. |
|
88 * @param aCommandId command that should be performed when MSK |
|
89 * is pressed. |
|
90 */ |
|
91 void SetMiddleSoftKeyLabelL( const TInt aResourceId, |
|
92 const TInt aCommandId ); |
|
93 |
|
94 public: // From CAknView |
|
95 TUid Id() const; |
|
96 void HandleCommandL( TInt aCommand ); |
|
97 |
|
98 protected: // From CAknView |
|
99 void HandleClientRectChange(); |
|
100 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
101 TUid aCustomMessageId, |
|
102 const TDesC8& aCustomMessage ); |
|
103 void DoDeactivate(); |
|
104 |
|
105 protected: |
|
106 |
|
107 /** |
|
108 * C++ default constructor. |
|
109 */ |
|
110 CSIPSettingsPlugin( ); |
|
111 |
|
112 /** |
|
113 * Symbian OS default constructor. |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 public: // From CGSPluginInterface |
|
118 |
|
119 /** |
|
120 * Method for getting caption of this plugin. This should be the |
|
121 * localized name of the settings view to be shown in parent view. |
|
122 * |
|
123 * @param aCaption pointer to Caption variable |
|
124 */ |
|
125 void GetCaptionL( TDes& aCaption ) const; |
|
126 |
|
127 /** |
|
128 * Method for reading the ID of the plugin provider category. See |
|
129 * TGSPluginProviderCategory. PluginProviderCategory can be used for |
|
130 * sorting plugins. |
|
131 * |
|
132 * Default value is EGSPluginProvider3rdParty. Override this function |
|
133 * to change the category. |
|
134 * |
|
135 * @return Plugin provider category ID defined by |
|
136 * TGSPluginProviderCategory |
|
137 */ |
|
138 TInt PluginProviderCategory() const; |
|
139 |
|
140 /** |
|
141 * @see CGSPluginInterface header file. |
|
142 */ |
|
143 CGulIcon* CreateIconL( const TUid aIconType ); |
|
144 |
|
145 /** |
|
146 * Shows the pop-up list for user to change the default profile |
|
147 */ |
|
148 void ChangeDefaultProfileL(); |
|
149 |
|
150 /** |
|
151 * Confirms from the user and then deletes the profile |
|
152 */ |
|
153 void DeleteProfileL(); |
|
154 |
|
155 /** |
|
156 * Starts editing an existing profile |
|
157 */ |
|
158 void EditProfileL(); |
|
159 |
|
160 protected: // From MEikListBoxObserver |
|
161 |
|
162 /** |
|
163 * Handles listbox events. |
|
164 * @param aListBox Listbox where the event occurred. |
|
165 * @param aEventType Event type. |
|
166 * |
|
167 */ |
|
168 void HandleListBoxEventL( CEikListBox* aListBox, |
|
169 TListBoxEvent aEventType ); |
|
170 |
|
171 protected: // New functions |
|
172 |
|
173 /** |
|
174 * Shows user a pop-up list, where s/he can choose the profile, |
|
175 * which parameters are copied to a new profile |
|
176 */ |
|
177 void CreateFromExisitingProfileL(); |
|
178 |
|
179 /** |
|
180 * Creates pop-up list for choosing the cloned profile |
|
181 * @param aListBox List box used in the pop-up list |
|
182 * @return Initialized pop-up list and list box |
|
183 */ |
|
184 CAknPopupList* CreatePopupListL( CEikFormattedCellListBox* aListBox ); |
|
185 |
|
186 /** |
|
187 * Creates a new profile and moves to profile edit view (deactivates |
|
188 * this view |
|
189 * @param aIndex index to point the cloned profile |
|
190 */ |
|
191 void CreateNewProfileL( TInt aIndex ); |
|
192 |
|
193 private: // Functions from base classes |
|
194 |
|
195 /** |
|
196 * From CAknView (MEikMenuObserver) |
|
197 * Dynamically initializes the contents of the menu list |
|
198 */ |
|
199 void DynInitMenuPaneL( TInt aResourceId, |
|
200 CEikMenuPane* aMenuPane ); |
|
201 |
|
202 private: // New |
|
203 void HandleListBoxSelectionL(); |
|
204 void ShowSIPProfilesSettingPageL(); |
|
205 |
|
206 protected: //Data |
|
207 RConeResourceLoader iResourceLoader; // resource loader |
|
208 |
|
209 //check if which command MSK is set during destruction |
|
210 TBool iMskCommandFlag; |
|
211 |
|
212 CSIPSettingsContainer* iContainer; // pointer to the container |
|
213 CAknNavigationDecorator* iNaviPaneContext; // navi pane |
|
214 |
|
215 CGSSIPModel* iHandler; // pointer to SIP profile handler |
|
216 CSIPSettingsModel* iModel; |
|
217 TInt iActiveIndex; // Active index number |
|
218 |
|
219 TInt iCurrentItem; // currently selected listbox item |
|
220 TInt iTopItemIndex; // first item in the listbox |
|
221 TBool iElaf; |
|
222 |
|
223 TVwsViewId iPrevViewId; // Previous view |
|
224 |
|
225 TBool iListBoxEventPenDown; // Check the ListBoxEvent |
|
226 }; |
|
227 |
|
228 #endif |