|
1 /* |
|
2 * Copyright (c) 2002-2007 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: Offers API for storing, getting and updating Audio Codec entry. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRCSEAUDIOCODECREGISTRY_H |
|
21 #define CRCSEAUDIOCODECREGISTRY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <rcseregistrybase.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CRCSEAudioCodecEntry; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Offers getting, setting and updating of Audio codec entries. |
|
34 * |
|
35 * @lib RCSE.lib |
|
36 * @since S60 v3.0 |
|
37 */ |
|
38 class CRCSEAudioCodecRegistry: public CRCSERegistryBase |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 IMPORT_C static CRCSEAudioCodecRegistry* NewLC(); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 IMPORT_C static CRCSEAudioCodecRegistry* NewL(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 IMPORT_C virtual ~CRCSEAudioCodecRegistry(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Adds new audio codec entry. |
|
61 * |
|
62 * @since S60 v3.0 |
|
63 * @param aCodecEntry New entry. |
|
64 * @return Codec identifier of the added audio codec entry. |
|
65 */ |
|
66 |
|
67 IMPORT_C TUint32 AddL(const CRCSEAudioCodecEntry& aCodecEntry ); |
|
68 |
|
69 /** |
|
70 * Gets all codec identifiers which are stored to RCSE. If there are |
|
71 * no codecs stored, aAllIds will contain zero entries. |
|
72 * |
|
73 * @since S60 v3.0 |
|
74 * @param aAllIds Array, where the codec identifiers are stored. |
|
75 */ |
|
76 IMPORT_C void GetAllCodecIdsL( RArray<TUint32>& aAllIds ); |
|
77 |
|
78 /** |
|
79 * Search a Audio Codec entry, which id is same as aCodecId. |
|
80 * Leaves with KErrNotFound if such profile is not found. |
|
81 * Default values are reseted to aFoundEntry before the search. |
|
82 * the new values are set to it. |
|
83 * |
|
84 * @since S60 v3.0 |
|
85 * @param aCodecId Search criteria for Audio Codec. |
|
86 * @param aFoundEntry A found audio codec entry. |
|
87 */ |
|
88 IMPORT_C void FindL( TUint32 aCodecId, |
|
89 CRCSEAudioCodecEntry& aFoundEntry ); |
|
90 |
|
91 /** |
|
92 * Deletes a codec, which codec id is same than aCodecId. |
|
93 * |
|
94 * @since S60 v3.0 |
|
95 * @param aCodecId Audio Codec identifier |
|
96 */ |
|
97 IMPORT_C void DeleteL( TUint32 aCodecId ); |
|
98 |
|
99 /** |
|
100 * Updates codec, which codec identifier is same than aCodecId. |
|
101 * Only settings that are set in aUpdateData are updated in codec. |
|
102 * Leaves with KErrNotFound if codec is not found. |
|
103 * |
|
104 * @since S60 v3.0 |
|
105 * @param aCodecId codec identifier. |
|
106 * @param aUpdateData Updated data, which are updated to codec. |
|
107 */ |
|
108 IMPORT_C void UpdateL( TUint32 aCodecId, |
|
109 const CRCSEAudioCodecEntry& aUpdateData ); |
|
110 |
|
111 /** |
|
112 * Gets default codec. Default codec is a codec, which |
|
113 * can be used when no other codec is available. AFoundEntrys |
|
114 * buffers and arrays are freed, before the new values are set to it. |
|
115 * |
|
116 * @since S60 v3.0 |
|
117 * @param aDefaultCodec Default codec settings are set to this. |
|
118 */ |
|
119 IMPORT_C void GetDefaultCodec( |
|
120 CRCSEAudioCodecEntry& aDefaultCodec ) const; |
|
121 |
|
122 |
|
123 /** |
|
124 * Adds bunch of audio codec entries to store in one transaction. |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @param aEntries |
|
128 */ |
|
129 void AddL( RPointerArray<CRCSEAudioCodecEntry>& aEntries ); |
|
130 |
|
131 /** |
|
132 * Delete bunch of audio codec entries from store in one transaction. |
|
133 * |
|
134 * @since S60 v3.2 |
|
135 * @param aIds Codec IDs |
|
136 */ |
|
137 void DeleteL( const RArray<TUint32>& aIds ); |
|
138 |
|
139 protected: // New functions |
|
140 |
|
141 /** |
|
142 * C++ default constructor. |
|
143 */ |
|
144 CRCSEAudioCodecRegistry(); |
|
145 |
|
146 private: |
|
147 |
|
148 /** |
|
149 * By default Symbian 2nd phase constructor is private. |
|
150 */ |
|
151 void ConstructL(); |
|
152 |
|
153 /** |
|
154 * Do actual search of requested entry. |
|
155 * Leaves with KErrNotFound if such profile is not found. |
|
156 * Default values are reseted to aFoundEntry before the search. |
|
157 * |
|
158 * @since S60 v3.0. |
|
159 * @param aProfileId Search criteria for profiles. |
|
160 * @param aFoundEntry A found profile entry |
|
161 * @leave KErrNotFound if audio codec doesn't exist. |
|
162 */ |
|
163 void FindEntryL( TUint32 aProfileId, CRCSEAudioCodecEntry& aFoundEntry ); |
|
164 |
|
165 /** |
|
166 * Adds or updates settings entry to storage depending of the aId |
|
167 * parameter. Entry is stored as new entry if aId parameter have |
|
168 * been set to KNoEntryId, otherwise existing entry is updated. |
|
169 * |
|
170 * @since S60 v3.2 |
|
171 * @param aId ID of entry if exists. |
|
172 * @param aEntry Entry to be added to storage. |
|
173 * @param aUpdate Determines add or update operation. |
|
174 * New entry is added when value is set to EFalse (default). |
|
175 * @return ID of entry. |
|
176 */ |
|
177 void AddOrUpdateEntryL( TUint32& aId, |
|
178 const CRCSEAudioCodecEntry& aEntry ); |
|
179 |
|
180 |
|
181 /** |
|
182 * Convert xxx |
|
183 * . |
|
184 * |
|
185 * @since S60 v3.2. |
|
186 * @param aEntry |
|
187 * @param aProperties |
|
188 */ |
|
189 void ConvertPropertiesToEntryL( CRCSEAudioCodecEntry& aEntry, |
|
190 RIpAppPropArray& aProperties ); |
|
191 |
|
192 |
|
193 /** |
|
194 * Convert xxx |
|
195 * . |
|
196 * |
|
197 * @since S60 v3.2. |
|
198 * @param aEntry |
|
199 * @param aProperties |
|
200 */ |
|
201 void ConvertEntryToPropertiesL( const CRCSEAudioCodecEntry& aEntry, |
|
202 RIpAppPropArray& properties ); |
|
203 |
|
204 |
|
205 // For testing |
|
206 #ifdef TEST_EUNIT |
|
207 friend class UT_CRCSEAudioCodecRegistry; |
|
208 #endif |
|
209 |
|
210 }; |
|
211 |
|
212 #endif // CRCSEAUDIOCODECREGISTRY_H |
|
213 |
|
214 // End of File |