25
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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:
|
|
15 |
* This class contains a collection of small static utility functions
|
|
16 |
* needed all around the application. The class has no prefix letter
|
|
17 |
*
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __VRUTILS_H
|
|
23 |
#define __VRUTILS_H
|
|
24 |
|
|
25 |
// INCLUDES
|
|
26 |
#include <bldvariant.hrh>
|
|
27 |
#include <f32file.h>
|
|
28 |
#include <badesca.h>
|
|
29 |
#include "VRConsts.h"
|
|
30 |
#include "voicerecorder.hrh"
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
|
|
34 |
class TVRDriveInfo
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
TBool iDrivePresent;
|
|
38 |
TBool iDriveLocked;
|
|
39 |
TBool iDriveCorrupted;
|
|
40 |
TBool iDriveReadOnly;
|
|
41 |
TBool iDriveFull;
|
|
42 |
};
|
|
43 |
|
|
44 |
class VRUtils
|
|
45 |
{
|
|
46 |
public: // New functions
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Returns the currently effective path where to store voice memos
|
|
50 |
* The directory is affected by the settings and the availability of MMC
|
|
51 |
*
|
|
52 |
* @return Returns a non-modifiable pointer descriptor containing the
|
|
53 |
* currently effective path where to store voice memos.
|
|
54 |
The descriptor is left on cleanup stack.
|
|
55 |
*/
|
|
56 |
IMPORT_C static void MemoStoreDirectoryL( TDes &aPath );
|
|
57 |
|
|
58 |
/**
|
|
59 |
* This method sets the default memo store setting (Phone Memory / MMC)
|
|
60 |
*
|
|
61 |
* @param aMemory Memory to set as default store
|
|
62 |
*/
|
|
63 |
IMPORT_C static void SetMemoStoreL( TVRMemoStore aMemory );
|
|
64 |
|
|
65 |
/**
|
|
66 |
* This method returns the default memo store setting
|
|
67 |
* @return The default memo store
|
|
68 |
*/
|
|
69 |
IMPORT_C static TVRMemoStore MemoStoreL();
|
|
70 |
|
|
71 |
/**
|
|
72 |
* This method returns the current status of MMC (inserted/locked/etc...)
|
|
73 |
* @param aDriveInfo MMC status
|
|
74 |
*/
|
|
75 |
IMPORT_C static void GetMMCInfo( TVRDriveInfo& aDriveInfo );
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Set the default speaker
|
|
79 |
* @param aSpeaker ESpeakerEarPiece or ESpeakerIhf
|
|
80 |
*/
|
|
81 |
IMPORT_C static void SetDefaultSpeakerL( const TVRSpeaker aSpeaker);
|
|
82 |
|
|
83 |
/**
|
|
84 |
* This method returns the current speaker
|
|
85 |
* @return Default speaker, either ESpeakerEarPiece or ESpeakerIhf
|
|
86 |
*/
|
|
87 |
IMPORT_C static TVRSpeaker DefaultSpeakerL();
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Set the default volume setting for specified speaker
|
|
91 |
* @param aSpeaker ESpeakerEarPiece or ESpeakerIhf
|
|
92 |
* @param aVolume New TInt value to save
|
|
93 |
*/
|
|
94 |
IMPORT_C static void SetDefaultVolumeL( const TVRSpeaker aSpeaker, const TInt aVolume );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* This method returns the default volume setting for specivied speaker
|
|
98 |
* @param aSpeaker ESpeakerEarPiece or ESpeakerIhf
|
|
99 |
* @return The retrieved volume setting value
|
|
100 |
*/
|
|
101 |
IMPORT_C static TInt DefaultVolumeL( const TVRSpeaker aSpeaker );
|
|
102 |
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Set the default quality setting
|
|
106 |
* @param aSpeaker EQualityMMSOptimized or EQualityHigh
|
|
107 |
*/
|
|
108 |
IMPORT_C static void SetQualityL( const TVRQuality aQuality );
|
|
109 |
|
|
110 |
/**
|
|
111 |
* This method returns the current quality setting
|
|
112 |
* @return Default quality, either EQualityMMSOptimized or EQualityHigh
|
|
113 |
*/
|
|
114 |
IMPORT_C static TVRQuality QualityL();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* This method shows the out-of-memory confirmation query
|
|
118 |
* @param aMmc Shows qtn_memlo_not_enough_memory if EFalse or
|
|
119 |
* qtn_memlo_mmc_not_enough_memory if ETrue
|
|
120 |
*/
|
|
121 |
IMPORT_C static void ShowMemoryFullConfirmationQuery( TBool aMmc = EFalse );
|
|
122 |
|
|
123 |
/**
|
|
124 |
* This method checks if video or VOIP call is ongoing
|
|
125 |
* @param aShowNote Show error note if ETrue
|
|
126 |
* @return ETrue if unsupported call is ongoing, EFalse otherwise
|
|
127 |
*/
|
|
128 |
IMPORT_C static TBool UnsupportedCallTypeOngoing( TBool aShowNote = EFalse );
|
|
129 |
|
|
130 |
/**
|
|
131 |
* This method returns the maximum length for a memo
|
|
132 |
* @return Maximum length
|
|
133 |
*/
|
|
134 |
IMPORT_C static TInt MaxLengthL();
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Check if variated feature is configured on
|
|
138 |
* @param aFeature Internal feature id
|
|
139 |
* @return ETrue if feature is enabled
|
|
140 |
*/
|
|
141 |
IMPORT_C static TBool FeatureEnabled( TVRFeature aFeature );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Generate a filename that has unique body in given path.
|
|
145 |
* @param aFs Reference to connected file server session handle
|
|
146 |
* @param aName Path to destination folder. On return contains
|
|
147 |
* a unique file name with full path and extension
|
|
148 |
* @param aType The type of file to be generated. Extension will be
|
|
149 |
appended according to this parameter.
|
|
150 |
*/
|
|
151 |
IMPORT_C static void GenerateUniqueFilenameL( RFs& aFs,
|
|
152 |
TFileName& aName, TVRFiletype aType );
|
|
153 |
|
|
154 |
/**
|
|
155 |
* This method returns the running count of recorded memos
|
|
156 |
* @return Count of recorded memos
|
|
157 |
*/
|
|
158 |
IMPORT_C static TInt MemoCount();
|
|
159 |
|
|
160 |
/**
|
|
161 |
* This method returns the running count of recorded memos
|
|
162 |
* @return Count of recorded memos
|
|
163 |
*/
|
|
164 |
IMPORT_C static void SetMemoCount( TInt aNewCount );
|
|
165 |
|
|
166 |
/**
|
|
167 |
* This method returns the bitrate that is used when recording amr clips
|
|
168 |
* @return Bitrate
|
|
169 |
*/
|
|
170 |
IMPORT_C static TUint AMRBitrateL();
|
|
171 |
|
|
172 |
|
|
173 |
/**
|
|
174 |
* This method returns the bitrate that is used when recording amr clips
|
|
175 |
* @return Bitrate
|
|
176 |
*/
|
|
177 |
IMPORT_C static TUint AACBitrateL();
|
|
178 |
|
|
179 |
|
|
180 |
/**
|
|
181 |
* This method returns the AAC-LC sampling rate that is used when recording AAC-LC clips
|
|
182 |
* @return Sampleing rate
|
|
183 |
*/
|
|
184 |
IMPORT_C static TInt AACSamplerateL();
|
|
185 |
|
|
186 |
/**
|
|
187 |
* This method returns the audio mode that is used when recording AAC-LC clips
|
|
188 |
* @return audio mode
|
|
189 |
*/
|
|
190 |
IMPORT_C static TInt AACAudioModeL();
|
|
191 |
|
|
192 |
/**
|
|
193 |
* This method checks the drive is valid or not
|
|
194 |
* @param aDrive is the drive id
|
|
195 |
* @param aNoteId store the note id
|
|
196 |
* @return The default memo store
|
|
197 |
*/
|
|
198 |
IMPORT_C static TBool DriveValid( const TInt aDrive );
|
|
199 |
|
|
200 |
/**
|
|
201 |
* This method checks which MassStorage is/are valid
|
|
202 |
* @return The MassStorage is multi (ETrue) or only one (EFlase)
|
|
203 |
*/
|
|
204 |
IMPORT_C static TBool MultipleMassStorageAvailable();
|
|
205 |
|
|
206 |
/**
|
|
207 |
* This wrapper method return the removable MassStorage drive
|
|
208 |
* @return the drive
|
|
209 |
*/
|
|
210 |
IMPORT_C static TInt GetRemovableMassStorageL();
|
|
211 |
|
|
212 |
#ifdef RD_MULTIPLE_DRIVE
|
|
213 |
/**
|
|
214 |
* This method sets the default memo store setting (to support multipledrives)
|
|
215 |
*
|
|
216 |
* @param aMemory Memory to set as default store
|
|
217 |
*/
|
|
218 |
IMPORT_C static void SetMemoDriveL( TDriveNumber aDrive );
|
|
219 |
|
|
220 |
/**
|
|
221 |
* This method returns default phone memory drive
|
|
222 |
*
|
|
223 |
*
|
|
224 |
*/
|
|
225 |
IMPORT_C static TInt DefaultMemoDriveL();
|
|
226 |
|
|
227 |
/**
|
|
228 |
* This method returns the current status of Drive (inserted/locked/etc...)
|
|
229 |
* @param aDriveInfo MMC status
|
|
230 |
*/
|
|
231 |
IMPORT_C static TInt GetDriveInfo( TInt aDrive, TUint& aDriveInfo );
|
|
232 |
|
|
233 |
/**
|
|
234 |
* This method returns the default memo drive setting
|
|
235 |
* @return The default memo store
|
|
236 |
*/
|
|
237 |
IMPORT_C static TInt MemoDriveL();
|
|
238 |
#endif
|
|
239 |
|
|
240 |
private:
|
|
241 |
|
|
242 |
/**
|
|
243 |
* Default constructor declared as private to prohibit construction.
|
|
244 |
*/
|
|
245 |
VRUtils();
|
|
246 |
|
|
247 |
/**
|
|
248 |
* Store a setting in Central Repository
|
|
249 |
* @param aKey The Central Repository key
|
|
250 |
* @param aValue The value for the key
|
|
251 |
*/
|
|
252 |
static void SetSettingValueL( const TUint32 aKey, const TInt aValue );
|
|
253 |
|
|
254 |
/**
|
|
255 |
* Get a setting from Central Repository
|
|
256 |
* @param aKey The requested Central Repository key
|
|
257 |
* @param aDefaultValue If key was not found, this is the value used
|
|
258 |
* @return The value of the requested key
|
|
259 |
*/
|
|
260 |
static TInt SettingValueL( const TUint32 aKey, const TInt aValue );
|
|
261 |
|
|
262 |
/**
|
|
263 |
* This method shows the out-of-memory confirmation query
|
|
264 |
* @param aMmc Shows qtn_memlo_not_enough_memory if EFalse or
|
|
265 |
* qtn_memlo_mmc_not_enough_memory if ETrue
|
|
266 |
*/
|
|
267 |
static void ShowMemoryFullConfirmationQueryL( TBool aMmc = EFalse );
|
|
268 |
|
|
269 |
/**
|
|
270 |
* This method is called if video or VOIP call is ongoing and
|
|
271 |
* information note needs to be shown
|
|
272 |
* @param aResourceId
|
|
273 |
*/
|
|
274 |
static void ShowUnsupportedCallTypeNoteL( TInt aResourceId );
|
|
275 |
|
|
276 |
/**
|
|
277 |
* This method appends the requested file type extension to filename
|
|
278 |
* @param aName Contains full file name after completion
|
|
279 |
* @param aType File type that defines the extension to be appended
|
|
280 |
*/
|
|
281 |
static void AppendExtension( TFileName& aName, TVRFiletype aType );
|
|
282 |
|
|
283 |
/**
|
|
284 |
* This method does the full check for the parameter filename existence
|
|
285 |
* @param aFs Reference to connected file server session handle
|
|
286 |
* @param aName Filename to check. No Path nor extension included.
|
|
287 |
* @return ETrue if file exists, EFalse otherwise
|
|
288 |
*/
|
|
289 |
static TBool DoesFileExistL( RFs& aFs, TFileName aName );
|
|
290 |
|
|
291 |
/**
|
|
292 |
* This method checks if parameter filename exists or not
|
|
293 |
* @param aFs Reference to connected file server session handle
|
|
294 |
* @param aName Filename to check. Path included. Extension excluded.
|
|
295 |
* @return ETrue if file exists, EFalse otherwise
|
|
296 |
*/
|
|
297 |
static TBool CheckFileExistence( RFs& aFs, TFileName aName );
|
|
298 |
|
|
299 |
};
|
|
300 |
|
|
301 |
#endif // __VRUTILS_H
|
|
302 |
|
|
303 |
// End of File
|