|
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: Resource data for DM-settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLDMRESOURCEPROFILE_H |
|
20 #define __NSMLDMRESOURCEPROFILE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "e32base.h" // CBase |
|
24 #include "barsread.h" // TResourceReader @bafl.lib |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CNSmlDMResourceProfile; |
|
30 class CNSmlDMSettings; |
|
31 class CNSmlDMProfile; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CNSmlDMResourceProfiles |
|
37 * For reading profiles from resources |
|
38 */ |
|
39 class CNSmlDMResourceProfiles : public CBase |
|
40 { |
|
41 |
|
42 public: // New functions |
|
43 /** |
|
44 * ~CNSmlDMResourceProfiles(); |
|
45 * Destructor |
|
46 * @param - |
|
47 * @return - |
|
48 */ |
|
49 ~CNSmlDMResourceProfiles(); |
|
50 |
|
51 /** |
|
52 * static CNSmlDMResourceProfiles* NewLC( TResourceReader& aReader, CNSmlDMSettings* aSettings ); |
|
53 * Construction |
|
54 * @param TResourceReader& aReader - Resource to be read |
|
55 * @param CNSmlDMSettings* aSettings - database to save settings into |
|
56 * @return CNSmlDMResourceProfiles* - pointer to new CNSmlDMResourceProfiles |
|
57 */ |
|
58 static CNSmlDMResourceProfiles* NewLC( TResourceReader& aReader, CNSmlDMSettings* aSettings ); |
|
59 |
|
60 /** |
|
61 * TInt RemoveDuplicateEntry() - marks duplicate profiles |
|
62 * @param - |
|
63 * @return - |
|
64 */ |
|
65 void RemoveDuplicateEntry(); |
|
66 |
|
67 /** |
|
68 * Removes OBEX profiles when DM OBEX is not supported |
|
69 * @param - |
|
70 * @return - |
|
71 */ |
|
72 void RemoveObexEntryL(); |
|
73 |
|
74 /** |
|
75 * TInt SaveProfilesL() - saves profiles |
|
76 * @param - |
|
77 * @return - |
|
78 */ |
|
79 void SaveProfilesL(); |
|
80 |
|
81 |
|
82 private: // New functions |
|
83 |
|
84 /** |
|
85 * void ConstructL( TResourceReader& aReader, CNSmlDMSettings* aSettings ); |
|
86 * @param TResourceReader& aReader - Resource to be read |
|
87 * @param CNSmlDMSettings* aSettings - database to save settings into |
|
88 * @return - |
|
89 */ |
|
90 void ConstructL( TResourceReader& aReader, CNSmlDMSettings* aSettings ); |
|
91 |
|
92 /** |
|
93 * void AddDataL( TResourceReader& aReader ) |
|
94 * Gets data from resourcefile |
|
95 * @param TResourceReader& aReader - Resource to be read |
|
96 * @return - |
|
97 */ |
|
98 void AddDataL( TResourceReader& aReader ); |
|
99 |
|
100 |
|
101 private: // Data |
|
102 CArrayPtrFlat<CNSmlDMResourceProfile>* iProfileArray; |
|
103 CNSmlDMSettings* iSettings; |
|
104 |
|
105 }; |
|
106 |
|
107 |
|
108 /** |
|
109 * CNSmlDMResourceProfile |
|
110 * For reading profile from resources |
|
111 */ |
|
112 class CNSmlDMResourceProfile : public CBase |
|
113 { |
|
114 |
|
115 public: // New functions |
|
116 /** |
|
117 * ~CNSmlDMResourceProfile(); |
|
118 * Destructor |
|
119 * @param - |
|
120 * @return - |
|
121 */ |
|
122 ~CNSmlDMResourceProfile(); |
|
123 |
|
124 /** |
|
125 * static CNSmlDMResourceProfile* NewLC(); |
|
126 * Construction |
|
127 * @param - |
|
128 * @return CNSmlDMResourceProfile* - pointer to new object |
|
129 */ |
|
130 static CNSmlDMResourceProfile* NewLC(); |
|
131 |
|
132 /** |
|
133 * static CNSmlDMResourceProfile* NewLC( TResourceReader& aReader ); |
|
134 * Construction |
|
135 * @param TResourceReader& aReader - Resource to be read |
|
136 * @return CNSmlDMResourceProfile* - pointer to new object |
|
137 */ |
|
138 static CNSmlDMResourceProfile* NewLC( TResourceReader& aReader ); |
|
139 |
|
140 /** |
|
141 * TBool SaveProfileL(); |
|
142 * @param CNSmlDMProfile* iProfile - profile to save data to |
|
143 * @return TBool - ETrue if save succesfull |
|
144 */ |
|
145 TBool SaveProfileL( CNSmlDMProfile* aProfile ); |
|
146 |
|
147 /** |
|
148 * HBufC* GetServerId(); |
|
149 * @param |
|
150 * @return HBufC* - ServerId |
|
151 */ |
|
152 |
|
153 HBufC* GetServerId(); |
|
154 |
|
155 friend class CDMProfileContentHandler; |
|
156 friend class CNSmlDMResourceProfiles; |
|
157 |
|
158 private: // New functions |
|
159 |
|
160 /** |
|
161 * void ConstructL( TResourceReader& aReader ); |
|
162 * @param TResourceReader& aReader - Resource to be read |
|
163 * @return - |
|
164 */ |
|
165 void ConstructL( TResourceReader& aReader ); |
|
166 |
|
167 /** |
|
168 * void AddDataL( TResourceReader& aReader ) |
|
169 * Gets data from resourcefile |
|
170 * @param TResourceReader& aReader - Resource to be read |
|
171 * @return - |
|
172 */ |
|
173 void AddDataL( TResourceReader& aReader ); |
|
174 |
|
175 |
|
176 private: // Data |
|
177 HBufC* iProfileDisplayName; |
|
178 TInt iIapId; |
|
179 TInt iTransportId; |
|
180 TInt iDMSessionId; |
|
181 HBufC* iServerId; |
|
182 HBufC* iUserName; |
|
183 HBufC* iPassWord; |
|
184 HBufC* iServerURL; |
|
185 HBufC* iClientPassword; |
|
186 HBufC* iAccessPoint; |
|
187 TBool iServerAlertAction; |
|
188 TInt8 iAuthenticationRequired; |
|
189 TBool iSyncAccepted; |
|
190 TInt iCreatorId; |
|
191 TBool iDeleteAllowed; |
|
192 TBool iProfileHidden; |
|
193 |
|
194 TBool iHttpAuthUsed; |
|
195 HBufC* iHttpAuthUsername; |
|
196 HBufC* iHttpAuthPassword; |
|
197 TBool iProfileLock; |
|
198 }; |
|
199 |
|
200 #endif //__NSMLDMRESOURCEPROFILE_H |