|
1 /* |
|
2 * Copyright (c) 2002-2008 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: PKI OMA DM Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __DMADADAPTER_H__ |
|
21 #define __DMADADAPTER_H__ |
|
22 |
|
23 #include <smldmadapter.h> |
|
24 |
|
25 #include "dmadcallbackc.h" |
|
26 #include "DmAdStore.h" |
|
27 #include "dmadddf.h" |
|
28 #include "dmadrtnodedataapic.h" |
|
29 #include "dmadengine.h" |
|
30 |
|
31 //------------------------------------------------------------------------------------------------ |
|
32 // CDmAdAdapter |
|
33 //------------------------------------------------------------------------------------------------ |
|
34 class CDmAdAdapter : public CSmlDmAdapter |
|
35 { |
|
36 public: |
|
37 static CDmAdAdapter* NewL(MSmlDmCallback* aDmCallback); |
|
38 static CDmAdAdapter* NewLC(MSmlDmCallback* aDmCallback); |
|
39 ~CDmAdAdapter(); |
|
40 |
|
41 void DDFVersionL(CBufBase& aVersion); |
|
42 void DDFStructureL(MSmlDmDDFObject& aDDF); |
|
43 |
|
44 void ChildURIListL(const TDesC8& aUri, const TDesC8& aLuid, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef); |
|
45 void AddNodeObjectL(const TDesC8& aUri, const TDesC8& aParentLuid, const TInt aStatusRef); |
|
46 void UpdateLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef); |
|
47 void FetchLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef); |
|
48 void DeleteObjectL(const TDesC8& aUri, const TDesC8& aLuid, TInt aStatusRef); |
|
49 void CompleteOutstandingCmdsL(); |
|
50 void UpdateLeafObjectL(const TDesC8& aUri, |
|
51 const TDesC8& aLuid, |
|
52 RWriteStream*& aStream, |
|
53 const TDesC8& aType, |
|
54 TInt aStatusRef); |
|
55 void FetchLeafObjectSizeL(const TDesC8& aUri, |
|
56 const TDesC8& aLuid, |
|
57 const TDesC8& aType, |
|
58 TInt aResultsRef, |
|
59 TInt aStatusRef); |
|
60 void ExecuteCommandL(const TDesC8& aUri, |
|
61 const TDesC8& aLuid, |
|
62 const TDesC8& aArgument, |
|
63 const TDesC8& aType, |
|
64 TInt aStatusRef); |
|
65 void ExecuteCommandL(const TDesC8& aUri, |
|
66 const TDesC8& aLuid, |
|
67 RWriteStream*& aStream, |
|
68 const TDesC8& aType, |
|
69 TInt aStatusRef); |
|
70 void CopyCommandL(const TDesC8& aTargetUri, |
|
71 const TDesC8& aTargetLuid, |
|
72 const TDesC8& aSourceUri, |
|
73 const TDesC8& aSourceLuid, |
|
74 const TDesC8& aType, |
|
75 TInt aStatusRef); |
|
76 void StartAtomicL(); |
|
77 void CommitAtomicL(); |
|
78 void RollbackAtomicL(); |
|
79 TBool StreamingSupport(TInt& aItemSize); |
|
80 void StreamCommittedL(); |
|
81 |
|
82 private: |
|
83 CDmAdAdapter(MSmlDmCallback* aDmCallback); |
|
84 void ConstructL(MSmlDmCallback* aDmCallback); |
|
85 |
|
86 /** |
|
87 * At the moment, only used for PKCS#12 node identification |
|
88 * purposes |
|
89 * |
|
90 * @return KErrNone if the node can be added, KErrAlreadyExists |
|
91 * if the PKCS#12 node already exists in the luid map. |
|
92 */ |
|
93 TInt CheckNodeStatus(const TDesC8& aUri); |
|
94 |
|
95 /** |
|
96 * Find out whether a luid mapping for the given PKCS#12 URI |
|
97 * already exists. |
|
98 * |
|
99 * @leave Leaves with KErrAlreadyExists if the luid mapping is found |
|
100 */ |
|
101 void CheckPKCS12ExistenceL(const TDesC8& aUri); |
|
102 |
|
103 private: |
|
104 CDmAdCallBack* iCallBack; |
|
105 CDmAdStore* iStore; |
|
106 CDmAdDdf* iDdf; |
|
107 CDmAdRtNodeDataApi* iRtNodeDataApi; |
|
108 CDmAdEngine* iEngine; |
|
109 }; |
|
110 |
|
111 #endif |