|
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: Settings handler for the settings outside of Profiles. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPROFILESGSTONESPLUGINSETTINGSHANDLER_H |
|
21 #define CPROFILESGSTONESPLUGINSETTINGSHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <cenrepnotifyhandler.h> |
|
26 #include <MProfileExternalSettingsHandler.h> |
|
27 #include "MProfilesGSTonesPluginItemDataInterface.h" |
|
28 #include "CProfilesGSTonesViewFeatures.h" |
|
29 #include "CProfilesGSTonesViewSettings.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CCoeEnv; |
|
33 class CRepository; |
|
34 class MProfileExternalSettingsObserver; |
|
35 class CDRMHelper; |
|
36 class CProfilesGSTonesPluginCalendarDataInterface; |
|
37 class CProfilesGSTonesPluginClockDataInterface; |
|
38 class TCoeHelpContext; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 /** |
|
42 * Setting item class for tone selection. |
|
43 * CProfilesGSTonesPluginSettingsHandler launches File List Dialog common component |
|
44 * from which user can select a file for ringing tone. |
|
45 * |
|
46 * @lib ProfileSettingsView.lib |
|
47 * @since 1.2 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CProfilesGSTonesPluginSettingsHandler ) |
|
50 : public CBase, |
|
51 public MCenRepNotifyHandlerCallback, |
|
52 public MProfileExternalSettingsHandler |
|
53 { |
|
54 |
|
55 friend class CProfilesGSTonesPluginCalendarDataInterface; // CSI: 36 # This friend is defined in this very same file |
|
56 friend class CProfilesGSTonesPluginClockDataInterface; // CSI: 36 # This friend is defined in this very same file |
|
57 |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 static CProfilesGSTonesPluginSettingsHandler* NewL( CCoeEnv* aCoeEnv ); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 */ |
|
68 ~CProfilesGSTonesPluginSettingsHandler(); |
|
69 |
|
70 /** |
|
71 * Variated destructor. |
|
72 */ |
|
73 void DrmDelete(); |
|
74 |
|
75 private: // Functions from base classes |
|
76 |
|
77 /** |
|
78 * From MCenRepNotifyHandlerCallback |
|
79 */ |
|
80 void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue ); |
|
81 |
|
82 /** |
|
83 * From MProfilesExternalSettingsHandler |
|
84 */ |
|
85 CAknSettingItem* CreateSettingItemL( TInt aIdentifier ); |
|
86 |
|
87 /** |
|
88 * From MProfilesExternalSettingsHandler |
|
89 */ |
|
90 void SetObserver( |
|
91 MProfileExternalSettingsObserver& aObserver ); |
|
92 |
|
93 /** |
|
94 * From MProfilesExternalSettingsHandler |
|
95 */ |
|
96 TBool AllowedToChange( TInt aSettingItemId ) const; |
|
97 |
|
98 /** |
|
99 * From MProfilesExternalSettingsHandler |
|
100 */ |
|
101 TBool GetHelpContext( TCoeHelpContext& aContext ) const; |
|
102 |
|
103 /** |
|
104 * From MProfilesExternalSettingsHandler |
|
105 */ |
|
106 void SetHiddenItems( CAknSettingItemArray& aSettingItemArray ) const; |
|
107 |
|
108 /** |
|
109 * From MProfilesExternalSettingsHandler |
|
110 */ |
|
111 void StoreIfChangedL( TInt aSettingId ); |
|
112 |
|
113 protected: |
|
114 |
|
115 /** |
|
116 * C++ constructor. |
|
117 */ |
|
118 CProfilesGSTonesPluginSettingsHandler( CCoeEnv* aCoeEnv ); |
|
119 |
|
120 /** |
|
121 * Symbian 2nd phase constructor. |
|
122 */ |
|
123 void ConstructL(); |
|
124 |
|
125 /** |
|
126 * Variated constructor. |
|
127 */ |
|
128 void DrmConstructL(); |
|
129 |
|
130 private: // New functions |
|
131 |
|
132 /** |
|
133 * Stores the new Calendar alarm tone in the Central Repository. |
|
134 * @param aTone the file to be used as the new Calendar alarm tone. |
|
135 */ |
|
136 void StoreCalendarToneL( const TDesC& aTone ); |
|
137 |
|
138 /** |
|
139 * Stores the new Clock alarm tone in the Central Repository. |
|
140 * @param aTone the file to be used as the new Clock alarm tone. |
|
141 */ |
|
142 void StoreClockToneL( const TDesC& aTone ); |
|
143 |
|
144 /** |
|
145 * Removes the given tone from the list of automated content. |
|
146 * @param aOldTone tone to be removed from the automated content list. |
|
147 */ |
|
148 void RemoveAutomatedContent( const TDesC& aOldTone ); |
|
149 |
|
150 private: // Data |
|
151 |
|
152 /// Ref: Observer for the settings controlled by this handler |
|
153 MProfileExternalSettingsObserver* iObserver; |
|
154 |
|
155 /// Own: Pointer to Central Repository of Clock App |
|
156 CRepository* iClockSession; |
|
157 |
|
158 /// Own: Pointer to Central Repository of Calendar App |
|
159 CRepository* iCalendarSession; |
|
160 |
|
161 /// Own: Pointer to clock alert tone notify handler |
|
162 CCenRepNotifyHandler* iClockNotifyHandler; |
|
163 |
|
164 /// Own: Pointer to calendar alert tone notify handler |
|
165 CCenRepNotifyHandler* iCalendarNotifyHandler; |
|
166 |
|
167 /// Current Clock alert tone |
|
168 TFileName iClockTone; |
|
169 |
|
170 /// Current Calendar alert tone |
|
171 TFileName iCalendarTone; |
|
172 |
|
173 /// Ref: Pointer to the control environment |
|
174 CCoeEnv* iCoeEnv; |
|
175 |
|
176 /// Own: Interface for File list setting item for calendar tone |
|
177 CProfilesGSTonesPluginCalendarDataInterface* iCalendarInterface; |
|
178 |
|
179 /// Own: Interface for File list setting item for clock tone |
|
180 CProfilesGSTonesPluginClockDataInterface* iClockInterface; |
|
181 |
|
182 /// Own: Drm helper for removing automated content when needed: |
|
183 CDRMHelper* iDrmHelper; |
|
184 |
|
185 /// Own: The variable features of Tones View |
|
186 CProfilesGSTonesViewFeatures* iFeatures; |
|
187 |
|
188 /// Own: The settings only in Tones View |
|
189 CProfilesGSTonesViewSettings* iTonesViewSettings; |
|
190 }; |
|
191 |
|
192 // This friend class of CProfilesGSTonesPluginSettingsHandler provides the |
|
193 // interface for the setting item to actually load and store the Calendar |
|
194 // alert tone name to the handler above. |
|
195 NONSHARABLE_CLASS( CProfilesGSTonesPluginCalendarDataInterface ) |
|
196 : public CBase, |
|
197 public MProfilesGSTonesPluginItemDataInterface |
|
198 { |
|
199 public: // Constructors and destructor |
|
200 |
|
201 /** |
|
202 * C++ constructor. |
|
203 */ |
|
204 CProfilesGSTonesPluginCalendarDataInterface( |
|
205 CProfilesGSTonesPluginSettingsHandler& aSettingsHandler ); |
|
206 |
|
207 /** |
|
208 * Destructor. |
|
209 */ |
|
210 ~CProfilesGSTonesPluginCalendarDataInterface() {}; |
|
211 |
|
212 private: // Functions from base classes |
|
213 |
|
214 /** |
|
215 * From MProfilesGSTonesPluginItemDataInterface |
|
216 */ |
|
217 virtual const TDesC& ItemData(); |
|
218 |
|
219 /** |
|
220 * From MProfilesGSTonesPluginItemDataInterface |
|
221 */ |
|
222 virtual void SetItemDataL( const TDesC& aDataBuf ); |
|
223 |
|
224 private: // Data |
|
225 |
|
226 /// Settings handler containing the setting to be controlled |
|
227 CProfilesGSTonesPluginSettingsHandler& iSettingsHandler; |
|
228 }; |
|
229 |
|
230 // This friend class of CProfilesGSTonesPluginSettingsHandler provides the |
|
231 // interface for the setting item to actually load and store the Clock |
|
232 // alert tone name to the handler above. |
|
233 NONSHARABLE_CLASS( CProfilesGSTonesPluginClockDataInterface ) |
|
234 : public CBase, |
|
235 public MProfilesGSTonesPluginItemDataInterface |
|
236 { |
|
237 public: // Constructors and destructor |
|
238 |
|
239 /** |
|
240 * C++ constructor. |
|
241 */ |
|
242 CProfilesGSTonesPluginClockDataInterface( |
|
243 CProfilesGSTonesPluginSettingsHandler& aSettingsHandler ); |
|
244 |
|
245 /** |
|
246 * Destructor. |
|
247 */ |
|
248 ~CProfilesGSTonesPluginClockDataInterface() {}; |
|
249 |
|
250 private: // Functions from base classes |
|
251 |
|
252 /** |
|
253 * From MProfilesGSTonesPluginItemDataInterface |
|
254 */ |
|
255 virtual const TDesC& ItemData(); |
|
256 |
|
257 /** |
|
258 * From MProfilesGSTonesPluginItemDataInterface |
|
259 */ |
|
260 virtual void SetItemDataL( const TDesC& aDataBuf ); |
|
261 |
|
262 private: // Data |
|
263 |
|
264 /// Settings handler containing the setting to be controlled |
|
265 CProfilesGSTonesPluginSettingsHandler& iSettingsHandler; |
|
266 }; |
|
267 |
|
268 #endif // CPROFILESGSTONESPLUGINSETTINGSHANDLER_H |
|
269 |
|
270 // End of File |
|
271 |