|
1 /* |
|
2 * Copyright (c) 2005 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: COMASuplDMAdapter is an ecom plugin that implements the interface CSmlDmAdapter to handle SUPL SyncML DM settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_COMASUPLDMADAPTER_H |
|
22 #define C_COMASUPLDMADAPTER_H |
|
23 |
|
24 #include <smldmadapter.h> |
|
25 #include <centralrepository.h> |
|
26 #include <s32file.h> |
|
27 |
|
28 #include "epos_tomasuplsettingsmap.h" |
|
29 #include "epos_comasupldmparam.h" |
|
30 |
|
31 |
|
32 typedef RPointerArray<COMASuplDMParam> RSuplDMParams; |
|
33 |
|
34 class COMASuplTrace; |
|
35 class COMASuplDMRepository; |
|
36 |
|
37 /** |
|
38 * COMASuplDMAdapter is an ecom plugin that implements the interface |
|
39 * CSmlDmAdapter to handle SUPL SyncML DM settings |
|
40 * @since S60 v3.1 |
|
41 */ |
|
42 class COMASuplDMAdapter : public CSmlDmAdapter |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 static COMASuplDMAdapter* NewL(MSmlDmCallback* aDmCallback); |
|
48 |
|
49 ~COMASuplDMAdapter(); |
|
50 |
|
51 void DDFVersionL( CBufBase& aVersion ); |
|
52 |
|
53 void DDFStructureL( MSmlDmDDFObject& aDDF ); |
|
54 |
|
55 void UpdateLeafObjectL( const TDesC8& aURI, |
|
56 const TDesC8& aLUID, |
|
57 const TDesC8& aObject, |
|
58 const TDesC8& aType, |
|
59 TInt aStatusRef ); |
|
60 |
|
61 void UpdateLeafObjectL( const TDesC8& aURI, |
|
62 const TDesC8& aLUID, |
|
63 RWriteStream*& aStream, |
|
64 const TDesC8& aType, |
|
65 TInt aStatusRef ); |
|
66 |
|
67 void DeleteObjectL( const TDesC8& aURI, |
|
68 const TDesC8& aLUID, |
|
69 TInt aStatusRef ); |
|
70 |
|
71 void FetchLeafObjectL( const TDesC8& aURI, |
|
72 const TDesC8& aLUID, |
|
73 const TDesC8& aType, |
|
74 TInt aResultsRef, |
|
75 TInt aStatusRef ); |
|
76 |
|
77 void FetchLeafObjectSizeL( const TDesC8& aURI, |
|
78 const TDesC8& aLUID, |
|
79 const TDesC8& aType, |
|
80 TInt aResultsRef, |
|
81 TInt aStatusRef ); |
|
82 |
|
83 void ChildURIListL( const TDesC8& aURI, |
|
84 const TDesC8& aLUID, |
|
85 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
86 TInt aResultsRef, |
|
87 TInt aStatusRef ); |
|
88 |
|
89 void AddNodeObjectL( const TDesC8& aURI, |
|
90 const TDesC8& aParentLUID, |
|
91 TInt aStatusRef ); |
|
92 |
|
93 void ExecuteCommandL( const TDesC8& aURI, |
|
94 const TDesC8& aLUID, |
|
95 const TDesC8& aArgument, |
|
96 const TDesC8& aType, |
|
97 TInt aStatusRef ); |
|
98 |
|
99 void ExecuteCommandL( const TDesC8& aURI, |
|
100 const TDesC8& aLUID, |
|
101 RWriteStream*& aStream, |
|
102 const TDesC8& aType, |
|
103 TInt aStatusRef ); |
|
104 |
|
105 void CopyCommandL( const TDesC8& aTargetURI, |
|
106 const TDesC8& aTargetLUID, |
|
107 const TDesC8& aSourceURI, |
|
108 const TDesC8& aSourceLUID, |
|
109 const TDesC8& aType, |
|
110 TInt aStatusRef ); |
|
111 |
|
112 void StartAtomicL(); |
|
113 |
|
114 |
|
115 void CommitAtomicL(); |
|
116 |
|
117 |
|
118 void RollbackAtomicL(); |
|
119 |
|
120 |
|
121 TBool StreamingSupport( TInt& aItemSize ); |
|
122 |
|
123 |
|
124 void StreamCommittedL(); |
|
125 |
|
126 |
|
127 void CompleteOutstandingCmdsL(); |
|
128 |
|
129 private: |
|
130 |
|
131 typedef enum |
|
132 { |
|
133 ENone, |
|
134 EProcessing, |
|
135 EStarting, |
|
136 ECommitting, |
|
137 ECommitted, |
|
138 EAborted |
|
139 } TSuplSmlDMAdapterState; |
|
140 |
|
141 COMASuplDMAdapter( MSmlDmCallback* aDmCallback ); |
|
142 |
|
143 void ConstructL(); |
|
144 |
|
145 void FillNodeInfoL( MSmlDmDDFObject& aDDFObject, |
|
146 TSmlDmAccessTypes& aAccessTypes, |
|
147 MSmlDmDDFObject::TScope aScope, |
|
148 MSmlDmDDFObject::TDFFormat aFormat, |
|
149 MSmlDmDDFObject::TOccurence aOccurence, |
|
150 const TDesC8& aMIMEType ); |
|
151 |
|
152 TInt ProcessL( const TDesC8& aURI, |
|
153 const TDesC8& aLUID, |
|
154 const TDesC8& aObject, |
|
155 const TDesC8& aType, |
|
156 TInt aStatusRef ); |
|
157 |
|
158 TInt GetIapIdL( TInt& aVal, const TDesC8& aToNapId ); |
|
159 |
|
160 TInt GetIapStrL( TInt& aVal, TDes8& aToNapId ); |
|
161 |
|
162 TInt GetLeafObjectLC( const TDesC8& aURI, |
|
163 const TDesC8& aLUID, |
|
164 const TDesC8& aType, |
|
165 TDesC8*& aValue, |
|
166 TInt aResultsRef, |
|
167 TInt aStatusRef ); |
|
168 |
|
169 void SetVariation(); |
|
170 |
|
171 private: // data |
|
172 |
|
173 COMASuplDMRepository* iRepository; |
|
174 |
|
175 TOMASuplSettingsMap iSuplSettingsMap; |
|
176 |
|
177 RSuplDMParams iSuplParams; |
|
178 |
|
179 TBool iIsAtomic; |
|
180 |
|
181 TSuplSmlDMAdapterState iSuplSmlDMAdapterState; |
|
182 |
|
183 RFs iFs; |
|
184 |
|
185 RFileWriteStream iFileWriteStream; |
|
186 |
|
187 TDesC8* iFileName; |
|
188 |
|
189 COMASuplDMParam* iHelperStreaming; |
|
190 |
|
191 TInt iLastIndex; |
|
192 |
|
193 /** |
|
194 * Handle to an instance of COMASuplTrace used for tracing |
|
195 */ |
|
196 COMASuplTrace* iTrace; |
|
197 |
|
198 /** |
|
199 * Flag value specifying the local variation settings |
|
200 */ |
|
201 TBool iVariantEnabled; |
|
202 |
|
203 }; |
|
204 |
|
205 #endif // C_COMASUPLDMADAPTER_H |