1 /* |
|
2 * Copyright (c) 2002-2004 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: Profile Aiw service provider. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPROFILEAIWPROVIDER_H__ |
|
20 #define __CPROFILEAIWPROVIDER_H__ |
|
21 |
|
22 // INTERNAL INCLUDES |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <AiwServiceIfMenu.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CProfileToneHandler; |
|
29 class CProfileEngineHandler; |
|
30 class CAknPopupList; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Profiles AIW Provider |
|
36 * AIW Provider for seting files as ringingtone |
|
37 * |
|
38 * @lib ProfileSettingsView.lib |
|
39 * @since 3.1 |
|
40 */ |
|
41 |
|
42 NONSHARABLE_CLASS( CProfileAiwProvider ) |
|
43 : public CAiwServiceIfMenu |
|
44 { |
|
45 public: // Constructors and destructors |
|
46 |
|
47 /** |
|
48 * Two-phase static constructor |
|
49 * @return A pointer to a fully constructed CProfileAiwProvider instance |
|
50 */ |
|
51 static CProfileAiwProvider* NewL(); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~CProfileAiwProvider(); |
|
57 |
|
58 private: // From CAiwServiceIfMenu |
|
59 |
|
60 void InitialiseL( MAiwNotifyCallback& aFrameworkCallback, |
|
61 const RCriteriaArray& aInterest ); |
|
62 |
|
63 void HandleServiceCmdL( const TInt& aCmdId, |
|
64 const CAiwGenericParamList& aInParamList, |
|
65 CAiwGenericParamList& aOutParamList, |
|
66 TUint aCmdOptions = 0, |
|
67 const MAiwNotifyCallback* aCallback = NULL ); |
|
68 |
|
69 void InitializeMenuPaneL( CAiwMenuPane& aMenuPane, |
|
70 TInt aIndex, |
|
71 TInt aCascadeId, |
|
72 const CAiwGenericParamList& aInParamList ); |
|
73 |
|
74 void HandleMenuCmdL( TInt aMenuCmdId, |
|
75 const CAiwGenericParamList& aInParamList, |
|
76 CAiwGenericParamList& aOutParamList, |
|
77 TUint aCmdOptions = 0, |
|
78 const MAiwNotifyCallback* aCallback = NULL ); |
|
79 |
|
80 private: // Constructors and destructors |
|
81 |
|
82 /** |
|
83 * Constructor |
|
84 */ |
|
85 CProfileAiwProvider(); |
|
86 |
|
87 /** |
|
88 * Second phase constructor |
|
89 */ |
|
90 void ConstructL(); |
|
91 |
|
92 private: // New functions |
|
93 |
|
94 /* |
|
95 * Reads AIW parameters |
|
96 * @param aParamList Generic parameterlist |
|
97 * @param aParamType Generic parameterID |
|
98 * @return Parameter in text form |
|
99 */ |
|
100 TPtrC GetAiwParamAsDescriptor( |
|
101 const CAiwGenericParamList& aParamList, |
|
102 TGenericParamId aParamType); |
|
103 /* |
|
104 * Checks MIME type |
|
105 * @param aMimeTypeString MIME type to be checked |
|
106 * @return Returns ETrue if MIME type is valid ( audio or video ) |
|
107 */ |
|
108 TBool CheckMimeTypeL(const TDesC& aMimeTypeString); |
|
109 |
|
110 /* |
|
111 * Launches multiselection popup listbox containing profile names |
|
112 * @param aPopupTitle Listbox title |
|
113 * @param aFilename Filename to be assigned as ringing tone |
|
114 */ |
|
115 void LaunchL( const TDesC& aPopupTitle, const TDesC& aFileName ); |
|
116 /* |
|
117 * Populates listbox |
|
118 * @param aItems Pointer to constructed listbox item array |
|
119 */ |
|
120 void PopulateListBoxL( CDesCArrayFlat* aItems ); |
|
121 /* |
|
122 * Performs the setting of ringing tone through ProfileSettingsView API |
|
123 * @param aFileName Filename to be assigned as ringing tone |
|
124 * @param aChangeAllProfiles Boolean value defines whether all |
|
125 * profiles are changed |
|
126 */ |
|
127 void PerformProfileChangeL( |
|
128 const TDesC& aFileName, const TBool& aChangeAllProfiles ) const; |
|
129 |
|
130 /** |
|
131 * Checks that the size of the tone file does not exceed the set limit |
|
132 * (if one has been set). |
|
133 * @param aFileName the name of the file to be assigned as ringing tone |
|
134 * @return ETrue if the size of the file does not rule the file out to |
|
135 * be set as ringing tone |
|
136 */ |
|
137 TBool IsToneFileSizeOkL( const TDesC& aFile ); |
|
138 |
|
139 /** |
|
140 * Displays an error note. |
|
141 * @param aResourceId Resource ID to a TBUF resource. |
|
142 */ |
|
143 void ShowErrorNoteL( const TDesC& aErrorText ) const; |
|
144 |
|
145 /** |
|
146 * Checks if file is WMDRM protected. |
|
147 * @param aFileName Name of the file to be checked. |
|
148 * @return ETrue if file is WMDRM protected, EFalse otherwise. |
|
149 */ |
|
150 TBool IsFileWMDRMProtectedL( const TDesC& aFileName ) const; |
|
151 |
|
152 /** |
|
153 * Checks if file is located on a remote drive and copies it if so. |
|
154 * @param aFileName Name of the file to be checked/copied. |
|
155 * @param aTarget File name on device after copying. |
|
156 * @return ETrue if file is remote, EFalse otherwise. |
|
157 */ |
|
158 TBool CopyIfRemoteL( const TDesC& aFileName, TFileName& aTarget ) const; |
|
159 |
|
160 private: // Data |
|
161 |
|
162 /// Own: Profile tone handler |
|
163 CProfileToneHandler* iProfileToneHandler; |
|
164 |
|
165 /// Own: Engine handler. |
|
166 CProfileEngineHandler* iEngineHandler; |
|
167 |
|
168 /// Ref: AIWCallback |
|
169 MAiwNotifyCallback* iConstNotifyCallback; |
|
170 |
|
171 /// Own: WMA Error text |
|
172 HBufC* iWMAErrorText; |
|
173 |
|
174 /// Own: MP4 Error text |
|
175 HBufC* iMP4ErrorText; |
|
176 |
|
177 /// Own: Unprotected Error text |
|
178 HBufC* iUnprotectedErrorText; |
|
179 |
|
180 /// Own: Not supported Error text |
|
181 HBufC* iNotSupportedErrorText; |
|
182 |
|
183 /// Own: Popup |
|
184 CAknPopupList* iPopup; |
|
185 |
|
186 /// Own: Popup title text |
|
187 HBufC* iPopupTitle; |
|
188 |
|
189 /// Own: Changed profile information text |
|
190 HBufC* iChangedProfilesText; |
|
191 |
|
192 /// Own: File was copied and set |
|
193 HBufC* iCopiedAndChangedText; |
|
194 |
|
195 /// Own: Tone file size too big error text |
|
196 HBufC* iSizeErrorText; |
|
197 |
|
198 /// Own: ListBox selection array |
|
199 const CArrayFix<TInt>* iSelectionArray; |
|
200 |
|
201 /// Own: Array for mapping of original indexes in Profile name array |
|
202 /// to Profile IDs |
|
203 CArrayFixFlat<TInt>* iIndexToIdArray; |
|
204 |
|
205 /// Resource offset |
|
206 TInt iResourceOffset; |
|
207 |
|
208 /// Maximum allowed size for tone files: |
|
209 TInt iMaxSize; |
|
210 |
|
211 /// Is file video: |
|
212 TBool iIsVideo; |
|
213 |
|
214 }; |
|
215 |
|
216 #endif // __CPROFILEAIWPROVIDER_H__ |
|