|
1 /* |
|
2 * ============================================================================== |
|
3 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 * ============================================================================== |
|
18 */ |
|
19 |
|
20 #ifndef PROXYBRANCH_H_ |
|
21 #define PROXYBRANCH_H_ |
|
22 |
|
23 |
|
24 // ------------------------------------------------------------------------------------------------ |
|
25 // Includes |
|
26 // ------------------------------------------------------------------------------------------------ |
|
27 #include <smldmadapter.h> |
|
28 #include "BranchBase.h" |
|
29 #include "cmmanagerext.h" |
|
30 #include "AddBuffer.h" |
|
31 |
|
32 /** |
|
33 * Class for handling Proxy settings in ConnMo DM tree |
|
34 */ |
|
35 class CProxyBranch : public CBranchBase |
|
36 { |
|
37 public: |
|
38 |
|
39 static CProxyBranch* NewL(MSmlDmCallback* aDmCallback, |
|
40 CAddBuffer* aBuffer, |
|
41 RCmManagerExt* aCmManagerExt ); |
|
42 |
|
43 // Adapter branch interface from CProxyBranch |
|
44 void DDFStructureL( MSmlDmDDFObject& aDDF ); |
|
45 |
|
46 void UpdateLeafObjectL( const TDesC8& aURI, |
|
47 const TDesC8& aLUID, |
|
48 const TDesC8& aObject, |
|
49 const TDesC8& aType, |
|
50 TInt aStatusRef ); |
|
51 |
|
52 void DeleteObjectL( const TDesC8& aURI, |
|
53 const TDesC8& aLUID, |
|
54 TInt aStatusRef ); |
|
55 |
|
56 void FetchLeafObjectL( const TDesC8& aURI, |
|
57 const TDesC8& aLUID, |
|
58 const TDesC8& aType, |
|
59 TInt aResultsRef, |
|
60 TInt aStatusRef ); |
|
61 |
|
62 |
|
63 void FetchLeafObjectSizeL( const TDesC8& aURI, |
|
64 const TDesC8& aLUID, |
|
65 const TDesC8& aType, |
|
66 TInt aResultsRef, |
|
67 TInt aStatusRef); |
|
68 |
|
69 void ChildURIListL( const TDesC8& aURI, |
|
70 const TDesC8& aLUID, |
|
71 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
72 TInt aResultsRef, |
|
73 TInt aStatusRef ); |
|
74 |
|
75 void AddNodeObjectL( const TDesC8& aURI, |
|
76 const TDesC8& aParentLUID, |
|
77 TInt aStatusRef ); |
|
78 |
|
79 /** |
|
80 * The function processes all proxy nodes from add buffer. |
|
81 * @param aCmManagerExt Reference to CmManager session. |
|
82 */ |
|
83 void ProcessBufferL(); |
|
84 |
|
85 virtual ~CProxyBranch(); |
|
86 |
|
87 private: |
|
88 |
|
89 //----------------------------------------------------------------------------- |
|
90 // Private functions |
|
91 //----------------------------------------------------------------------------- |
|
92 CProxyBranch(MSmlDmCallback* aDmCallback, |
|
93 CAddBuffer* aBuffer, |
|
94 RCmManagerExt* aCmManagerExt ); |
|
95 |
|
96 /** |
|
97 * The function returns URI list of dynamic Proxy nodes. The list is returned by |
|
98 * calling the SetResultsL function of MSmlCallback callback interface. |
|
99 * @param aURI URI of the parent object. |
|
100 * @param aPreviousURISegmentList URI list with mapping LUID information. |
|
101 * @param aResultsRef Reference to correct results. |
|
102 * @param aStatusRef Reference to correct command. |
|
103 * @param aCmManagerExt Reference to CmManager session. |
|
104 */ |
|
105 void GetAllDynamicProxyNodesL( const TDesC8& aURI, |
|
106 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
107 TInt aResultsRef, |
|
108 TInt aStatusRef, |
|
109 CBufBase& aCurrentURISegmentList ); |
|
110 |
|
111 /** |
|
112 * The function returns URI list of requested dynamic Proxy node. |
|
113 * @param aLUID LUID of the parent object. |
|
114 * @param aResultsRef Reference to correct results. |
|
115 * @param aStatusRef Reference to correct command. |
|
116 * @param aCmManagerExt Reference to CmManager session. |
|
117 */ |
|
118 void GetURIListForProxyNodeL( const TDesC8& aLUID, |
|
119 TInt aResultsRef, |
|
120 TInt aStatusRef ); |
|
121 |
|
122 /** |
|
123 * The function adjust DM operation return values for hardcoded fields. |
|
124 * @param aURI URI of the object. |
|
125 * @return CSmlDmAdapter::TError Status value for DM operation. |
|
126 */ |
|
127 CSmlDmAdapter::TError CheckForUnmodifiableField( const TDesC8& aUri ); |
|
128 |
|
129 /** |
|
130 * The function returns CMManager's attribute enum that corresponds to uri. |
|
131 * @param aURI URI of the object. |
|
132 * @return TUint32 Attribute enum for CM. |
|
133 */ |
|
134 TUint32 MapUriToCmAttribute( const TDesC8& aUri ); |
|
135 |
|
136 /** |
|
137 * The function searches for connection method that is referenced from proxy buffered |
|
138 * in the addbuffer. |
|
139 * @param aCmManagerExt Reference to CmManager session. |
|
140 * @return TUint32 CM ID. |
|
141 */ |
|
142 TInt32 FindConnectionMethodL(); |
|
143 |
|
144 /** |
|
145 * The function checs that the addbuffer contains all necessary fields |
|
146 * to create new proxy entry. |
|
147 * @return TBool True if all mandatory fields found. |
|
148 */ |
|
149 TBool AllMandatoryProxyFieldsFound(); |
|
150 |
|
151 /** |
|
152 * The function writes information from the addbuffer to connection method. |
|
153 * @param aURI URI of the object. |
|
154 * @param aLUID Local UID of the leaf. |
|
155 * @param aObject objecto to be written in CM. |
|
156 * @param aStatusRef Reference to correct command. |
|
157 * @param aCm Reference to Connection Method. |
|
158 */ |
|
159 void SetLeafDataL( const TDesC8& aURI, |
|
160 const TDesC8& aLUID, |
|
161 const TDesC8& aObject, |
|
162 TInt aStatusRef, |
|
163 RCmConnectionMethodExt& aCm); |
|
164 |
|
165 /** |
|
166 * The function informs framework about new nodes. |
|
167 * @param aNode Node to be saved. |
|
168 * @param aCm Reference to Connection Method. |
|
169 */ |
|
170 void SetNodeDataL( CConnMoNodeElement* aNode, RCmConnectionMethodExt& aCm ); |
|
171 |
|
172 /** |
|
173 * Fethces leaf object data from connection settings |
|
174 * @param aURI Target node |
|
175 * @param aLuid Local UID for target node |
|
176 * @param buffer for returning object data |
|
177 * @return CSmlDmAdapter::TError Return value informs completion status of the operation |
|
178 */ |
|
179 CSmlDmAdapter::TError FetchLeafObjectL( const TDesC8& aURI, |
|
180 const TDesC8& aLUID, |
|
181 CBufBase& aLeafObject ); |
|
182 |
|
183 TPtrC8 GetDynamicProxyNodeUri( const TDesC8& aURI ); |
|
184 |
|
185 TBool IsProxyUriFormatMatchPredefined(const TDesC8 & aURI); |
|
186 |
|
187 TInt GetCmIdFromURIL(const TDesC8& aURI); |
|
188 |
|
189 //----------------------------------------------------------------------------- |
|
190 // Private member variables |
|
191 //----------------------------------------------------------------------------- |
|
192 MSmlDmCallback* iCallback; |
|
193 CAddBuffer* iBuffer; |
|
194 RCmManagerExt* iCmManager; |
|
195 }; |
|
196 |
|
197 #endif /* PROXYBRANCH_H_ */ |