|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __DMADENGINE_H__ |
|
21 #define __DMADENGINE_H__ |
|
22 |
|
23 #include <smldmadapter.h> |
|
24 #include "dmadengineexportdef.h" |
|
25 #include "dmadcallback.h" |
|
26 #include "dmadstoreapi.h" |
|
27 #include "dmadddfapi.h" |
|
28 #include "dmadrtnodedataapi.h" |
|
29 #include "DmAdRtNode.h" |
|
30 |
|
31 //------------------------------------------------------------------------------------------------ |
|
32 // CDmAdEngine |
|
33 //------------------------------------------------------------------------------------------------ |
|
34 class CDmAdEngine : public CBase |
|
35 { |
|
36 public: |
|
37 DMAD_IMPORT_C static CDmAdEngine* NewL(MDmAdCallBack* aDmAdCallBack, |
|
38 MDmAdStoreApi* aStoreApi, |
|
39 MDmAdDdfApi* aDdfApi, |
|
40 MDmAdRtNodeDataApi* aRtNodeDataApi); |
|
41 |
|
42 DMAD_IMPORT_C static CDmAdEngine* NewLC(MDmAdCallBack* aDmAdCallBack, |
|
43 MDmAdStoreApi* aStoreApi, |
|
44 MDmAdDdfApi* aDdfApi, |
|
45 MDmAdRtNodeDataApi* aRtNodeDataApi); |
|
46 DMAD_IMPORT_C ~CDmAdEngine(); |
|
47 |
|
48 DMAD_IMPORT_C void ChildURIListL(const TDesC8& aUri, const TDesC8& aLuid, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef); |
|
49 DMAD_IMPORT_C void AddNodeObjectL(const TDesC8& aUri, const TDesC8& aParentLuid, const TInt aStatusRef); |
|
50 DMAD_IMPORT_C void UpdateLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef); |
|
51 DMAD_IMPORT_C void FetchLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef); |
|
52 DMAD_IMPORT_C void DeleteObjectL(const TDesC8& aUri, const TDesC8& aLuid, TInt aStatusRef); |
|
53 DMAD_IMPORT_C void CompleteOutstandingCmdsL(); |
|
54 |
|
55 DMAD_IMPORT_C void ChildURIListL(const TDesC& aUri, const TDesC& aLuid, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, const TInt aResultsRef, const TInt aStatusRef); |
|
56 DMAD_IMPORT_C void AddNodeObjectL(const TDesC& aUri, const TDesC& aParentLuid, const TInt aStatusRef); |
|
57 DMAD_IMPORT_C void AddLeafObjectL(const TDesC& aUri, const TDesC& aParentLuid, const TDesC8& aObject, const TDesC& aType, const TInt aStatusRef); |
|
58 DMAD_IMPORT_C void UpdateLeafObjectL(const TDesC& aUri, const TDesC& aLuid, const TDesC8& aObject, const TDesC& aType, const TInt aStatusRef); |
|
59 DMAD_IMPORT_C void FetchLeafObjectL(const TDesC& aUri, const TDesC& aLuid, const TDesC& aType, const TInt aResultsRef, const TInt aStatusRef); |
|
60 DMAD_IMPORT_C void DeleteObjectL(const TDesC& aUri, const TDesC& aLuid, const TInt aStatusRef); |
|
61 DMAD_IMPORT_C void EndMessageL(); |
|
62 |
|
63 DMAD_IMPORT_C void UpdateLeafObjectL(const TDesC8& aUri, |
|
64 const TDesC8& aLuid, |
|
65 RWriteStream*& aStream, |
|
66 const TDesC8& aType, |
|
67 TInt aStatusRef); |
|
68 DMAD_IMPORT_C void FetchLeafObjectSizeL(const TDesC8& aUri, |
|
69 const TDesC8& aLuid, |
|
70 const TDesC8& aType, |
|
71 TInt aResultsRef, |
|
72 TInt aStatusRef); |
|
73 DMAD_IMPORT_C void ExecuteCommandL(const TDesC8& aUri, |
|
74 const TDesC8& aLuid, |
|
75 const TDesC8& aArgument, |
|
76 const TDesC8& aType, |
|
77 TInt aStatusRef); |
|
78 DMAD_IMPORT_C void ExecuteCommandL(const TDesC8& aUri, |
|
79 const TDesC8& aLuid, |
|
80 RWriteStream*& aStream, |
|
81 const TDesC8& aType, |
|
82 TInt aStatusRef); |
|
83 DMAD_IMPORT_C void CopyCommandL(const TDesC8& aTargetUri, |
|
84 const TDesC8& aTargetLuid, |
|
85 const TDesC8& aSourceUri, |
|
86 const TDesC8& aSourceLuid, |
|
87 const TDesC8& aType, |
|
88 TInt aStatusRef); |
|
89 DMAD_IMPORT_C void StartAtomicL(); |
|
90 DMAD_IMPORT_C void CommitAtomicL(); |
|
91 DMAD_IMPORT_C void RollbackAtomicL(); |
|
92 DMAD_IMPORT_C TBool StreamingSupport(TInt& aItemSize); |
|
93 DMAD_IMPORT_C void StreamCommittedL(); |
|
94 |
|
95 private: |
|
96 void ConstructL(); |
|
97 CDmAdEngine(MDmAdCallBack* aDmAdCallBack, |
|
98 MDmAdStoreApi* aStoreApi, |
|
99 MDmAdDdfApi* aDdfApi, |
|
100 MDmAdRtNodeDataApi* aRtNodeDataApi); |
|
101 |
|
102 void DoChildUriListL(const TDesC8& aUri, const TDesC8& aParentLuid, const CArrayFix<TSmlDmMappingInfo>& aPreviousUriSegmentList, TInt aResultsRef, TInt aStatusRef); |
|
103 void DoAddNodeObjectL(const TDesC8& aUri, const TDesC8& aParentLuid, TInt aStatusRef); |
|
104 void DoUpdateLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef); |
|
105 void DoFetchLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef); |
|
106 TInt DoFetchLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aType, CBufBase*& aObject); |
|
107 void DoDeleteObjectL(const TDesC8& aUri, const TDesC8& aLuid, TInt aStatusRef); |
|
108 void DoCompleteOutstandingCmdsL(); |
|
109 |
|
110 |
|
111 CDmAdRtNode* FindRtNodeInBuffer(const TDesC8& aUri); |
|
112 CDmAdRtNode* FindRtNodeInBufferByLuid(const TDesC8& aLuid, const TDesC8& aUri); |
|
113 CDmAdRtNode* RestoreRtNodeInBufferIfNotDoneL(const TDesC8& aUri, const TDesC8& aLuid); |
|
114 CDmAdRtNode* FetchRtNodeInBufferL(const TDesC8& aUri, const TDesC8& aLuid); |
|
115 void CompleteCommandsL(CDmAdRtNode& aRtNode, TInt aStatus); |
|
116 void CompleteCommandsL(CArrayPtr<CDmAdRtNode>& aRtNodes, TInt aStatus); |
|
117 void BuildTopLevelRtNodesListLC(CArrayPtr<CDmAdRtNode>* aRtNodes, |
|
118 CArrayPtr<CDmAdRtNode>*& aTopLevelRtNodes); |
|
119 void BuildChildRtNodesListLC(CArrayPtr<CDmAdRtNode>* aRtNodes, |
|
120 const TDesC8& aSomeParentUri, |
|
121 CArrayPtr<CDmAdRtNode>*& aChildRtNodes); |
|
122 |
|
123 void SaveRtNodesL(void); |
|
124 TBool FindRtNodeInStoreL(const TDesC8& aLuid, const TDesC8& aUri); |
|
125 HBufC8* ParentRtNodeLuidForRtNodeLC(const TDesC8& aUri); |
|
126 |
|
127 private: |
|
128 MDmAdCallBack* iCallBack; |
|
129 MDmAdStoreApi* iStoreApi; |
|
130 MDmAdDdfApi* iDdfApi; |
|
131 MDmAdRtNodeDataApi* iRtNodeDataApi; |
|
132 |
|
133 CArrayPtr<CDmAdRtNode>* iRtNodes; |
|
134 }; |
|
135 |
|
136 #endif |