|
1 /* |
|
2 * Copyright (c) 2003 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: CLocalOperationBase |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __LOCALOPERATIONBASE__ |
|
22 #define __LOCALOPERATIONBASE__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "XdmOperation.h" |
|
26 |
|
27 //FORWARD DECLARATIONS |
|
28 class CXdmXmlParser; |
|
29 class CLocalDocument; |
|
30 class CXdmDocumentNode; |
|
31 class CLocalDocumentNode; |
|
32 class CLocalOperationFactory; |
|
33 |
|
34 //CLASS DECLARATION |
|
35 NONSHARABLE_CLASS( CLocalOperationBase ) : public CBase, |
|
36 public MXdmOperation |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 virtual ~CLocalOperationBase(); |
|
44 |
|
45 protected: //Methods |
|
46 |
|
47 /** |
|
48 * Symbian OS default constructor. |
|
49 * @param TInt Default Access Point ID |
|
50 * @return CXdmDocOperation* |
|
51 */ |
|
52 CLocalOperationBase( const CLocalDocument& aTargetDoc, |
|
53 CLocalOperationFactory& aOperationFactory ); |
|
54 |
|
55 /** |
|
56 * Symbian OS default constructor. |
|
57 * @param TInt Default Access Point ID |
|
58 * @return CXdmDocOperation* |
|
59 */ |
|
60 void BaseConstructL(); |
|
61 |
|
62 /** |
|
63 * Symbian OS default constructor. |
|
64 * @param TInt Default Access Point ID |
|
65 * @return CXdmDocOperation* |
|
66 */ |
|
67 void WriteFileL( const CXdmDocumentNode* aRootNode ); |
|
68 |
|
69 /** |
|
70 * Symbian OS default constructor. |
|
71 * @param TInt Default Access Point ID |
|
72 * @return CXdmDocOperation* |
|
73 */ |
|
74 HBufC8* FetchXmlDataL( TInt aFileSize ); |
|
75 |
|
76 /** |
|
77 * Symbian OS default constructor. |
|
78 * @param TInt Default Access Point ID |
|
79 * @return CXdmDocOperation* |
|
80 */ |
|
81 void ReplaceDataFileL(); |
|
82 |
|
83 /** |
|
84 * Symbian OS default constructor. |
|
85 * @param TInt Default Access Point ID |
|
86 * @return CXdmDocOperation* |
|
87 */ |
|
88 void DeleteDataFileL(); |
|
89 |
|
90 /** |
|
91 * Symbian OS default constructor. |
|
92 * @param TInt Default Access Point ID |
|
93 * @return CXdmDocOperation* |
|
94 */ |
|
95 TInt OpenDataFileL( const TDesC& aFilePath ); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Execute this operation asynchronously. |
|
101 */ |
|
102 void ExecuteL( TRequestStatus& aStatus, TUint aOptions ); |
|
103 |
|
104 /** |
|
105 * Cancel this operation. |
|
106 */ |
|
107 void CancelOperation(); |
|
108 |
|
109 /** |
|
110 * Get the result of this operation. |
|
111 */ |
|
112 TInt Result() const; |
|
113 |
|
114 /** |
|
115 * Get the completion data of this operation. |
|
116 */ |
|
117 const TXdmCompletionData& CompletionData() const; |
|
118 |
|
119 /** |
|
120 * Set this operation to completed state. |
|
121 */ |
|
122 TBool IsCompleted() const; |
|
123 |
|
124 /** |
|
125 * Set this operation to completed state. |
|
126 */ |
|
127 CXdmDocumentNode* TargetNode() const; |
|
128 |
|
129 /** |
|
130 * Set this operation to completed state. |
|
131 */ |
|
132 void GenerateTimeStampL(); |
|
133 |
|
134 HBufC* ConstructTimestampNameL(); |
|
135 |
|
136 /** |
|
137 * Set this operation to completed state. |
|
138 */ |
|
139 HBufC8* TimeLC(); |
|
140 |
|
141 protected: //Data |
|
142 |
|
143 RFile iXmlFile; |
|
144 TPtrC iFullPath; |
|
145 CFileMan* iFileManager; |
|
146 CLocalDocument& iTargetDoc; |
|
147 CXdmXmlParser* iXmlParser; |
|
148 TXdmOperationType iOperationType; |
|
149 TXdmCompletionData iCompletionData; |
|
150 CLocalOperationFactory& iOperationFactory; |
|
151 }; |
|
152 |
|
153 #endif //__LOCALOPERATIONBASE__ |
|
154 |
|
155 // End of File |