|
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 SIP settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRCSESIPPSETTINGREGISTRYREGISTRY_H |
|
21 #define CRCSESIPPSETTINGREGISTRYREGISTRY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <rcseregistrybase.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CRCSESIPSettingEntry; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Offers getting, setting and updating of sip settings. |
|
34 * |
|
35 * @lib RCSE.lib |
|
36 * @since S60 3.0 |
|
37 */ |
|
38 class CRCSESIPSettingRegistry: public CRCSERegistryBase |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 IMPORT_C static CRCSESIPSettingRegistry* NewL(); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 IMPORT_C static CRCSESIPSettingRegistry* NewLC(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 IMPORT_C virtual ~CRCSESIPSettingRegistry(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Search a SIP setting, which profile id is same as aSIPProfileId. |
|
61 * Leaves with KErrNotFound if such profile is not found. |
|
62 * Default values are reseted to aFoundEntry before the search. |
|
63 * @since S60 3.0. |
|
64 * @param aSIPProfileId Search criteria for SIP setting. |
|
65 * @param aFoundEntry A found SIP setting entry. |
|
66 */ |
|
67 IMPORT_C void FindL( TUint32 aSIPProfileId, |
|
68 CRCSESIPSettingEntry& aFoundEntry ); |
|
69 |
|
70 /** |
|
71 * Gets all SIP setting identifiers which are stored to RCSE. |
|
72 * If there are no profiles stored, aAllIds will contain zero entries. |
|
73 * @since S60 3.0 |
|
74 * @param aAllIds Array, where the SIP setting identifiers are stored. |
|
75 */ |
|
76 IMPORT_C void GetAllIdsL( RArray<TUint32>& aAllIds ); |
|
77 |
|
78 /** |
|
79 * Adds new profile entry. |
|
80 * @since S60 3.0 |
|
81 * @param aNewEntry New entry. |
|
82 * @return SIP setting identifier of the added setting. |
|
83 */ |
|
84 IMPORT_C TUint32 AddL( const CRCSESIPSettingEntry& aNewEntry ); |
|
85 |
|
86 /** |
|
87 * Deletes a profile, which profile id is same than aProfileId. |
|
88 * @since S60 3.0 |
|
89 * @param aId SIP setting identifier |
|
90 */ |
|
91 IMPORT_C void DeleteL( TUint32 aId ); |
|
92 |
|
93 /** |
|
94 * Updates SIP setting, which identifier is same than aId. |
|
95 * Only settings that are set in aUpdateData are updated in profile. |
|
96 * Leaves with KErrNotFound if setting is not found. |
|
97 * @since S60 3.0 |
|
98 * @param aId setting identifier. |
|
99 * @param aUpdateData Updated data, which are updated to SIP Setting. |
|
100 */ |
|
101 IMPORT_C void UpdateL( TUint32 aId, |
|
102 const CRCSESIPSettingEntry& aUpdateData ); |
|
103 |
|
104 /** |
|
105 * Resets default values for SIP profile. Default profile is a profile, |
|
106 * which can be used when no other profile is available. |
|
107 * @since S60 3.0 |
|
108 * @param aDefaultProfile Default profile settings are set to this. |
|
109 */ |
|
110 IMPORT_C void GetDefaultProfile( |
|
111 CRCSESIPSettingEntry& aDefaultProfile ) const; |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * C++ default constructor. |
|
117 */ |
|
118 CRCSESIPSettingRegistry(); |
|
119 |
|
120 /** |
|
121 * By default Symbian 2nd phase constructor is private. |
|
122 */ |
|
123 void ConstructL(); |
|
124 |
|
125 /** |
|
126 * Maps data from database to aEntry. |
|
127 * @since S60 3.0 |
|
128 * @param aColumnIndex Index to a column in database row. |
|
129 * @param aView View to database to access values in column. |
|
130 * @param aEntry SIP entry settings are set to here. |
|
131 */ |
|
132 void MapColumnToEntry( TInt aColumnIndex, const RDbView& aView, |
|
133 CRCSESIPSettingEntry& aEntry ); |
|
134 |
|
135 /** |
|
136 * Initializes database view. |
|
137 * @since S60 3.0 |
|
138 * @param aView View to be initialized- |
|
139 * @param aSqlStatement SQL statement which initializes the database. |
|
140 */ |
|
141 void InitializeDbViewL( RDbView& aView, |
|
142 const TDesC& aSqlStatement ); |
|
143 |
|
144 /** |
|
145 * Initializes the database with aSqlQuery and sets data |
|
146 * from database to aEntry. |
|
147 * @since S60 3.0 |
|
148 * @param aEntry SIP setting entry, which single setting is set. |
|
149 * @param aSqlQuery SQL query used to get the data from database. |
|
150 */ |
|
151 void SetDataFromDbToEntryL( CRCSESIPSettingEntry& aEntry, |
|
152 const TDesC& aSqlQuery ); |
|
153 }; |
|
154 |
|
155 #endif // CRCSESIPPSETTINGREGISTRYREGISTRY_H |
|
156 |
|
157 // End of File |