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: CLocalDirectory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __LOCALDIRECTORY__ |
|
22 #define __LOCALDIRECTORY__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "XdmDirectory.h" |
|
26 |
|
27 //CONSTANTS |
|
28 |
|
29 //FORWARD DECLARATIONS |
|
30 class CXdmDocument; |
|
31 class CLocalProtocol; |
|
32 class CLocalDirectoryEntry; |
|
33 |
|
34 //CLASS DECLARATION |
|
35 NONSHARABLE_CLASS( CLocalDirectory ) : public CXdmDirectory |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Symbian OS default constructor. |
|
41 * @param TInt Default Access Point ID |
|
42 * @return CXdmDocOperation* |
|
43 */ |
|
44 static CLocalDirectory* NewL( const TDesC& aFilePath, |
|
45 CXdmEngine& aXdmEngine, |
|
46 CLocalProtocol& aLocalProtocol ); |
|
47 |
|
48 /** |
|
49 * Symbian OS default constructor. |
|
50 * @param TInt Default Access Point ID |
|
51 * @return CXdmDocOperation* |
|
52 */ |
|
53 //void CancelUpdate(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CLocalDirectory(); |
|
59 |
|
60 private: //From CXdmDirectory |
|
61 |
|
62 /** |
|
63 * Start updating the contents of this directory model |
|
64 * @param TRequestStatus& Request status of the client |
|
65 * @param TDirUpdatePhase Phase of the update |
|
66 * @return void |
|
67 */ |
|
68 void StartUpdateL(); |
|
69 |
|
70 /** |
|
71 * Cancel a directory update |
|
72 * @return void |
|
73 */ |
|
74 void CancelUpdate(); |
|
75 |
|
76 /** |
|
77 * Save the client's request status and update status |
|
78 * @param TDirUpdatePhase The update phase |
|
79 * @param TRequestStatus The client's request status |
|
80 * @return void |
|
81 */ |
|
82 void SaveRequestData( TDirUpdatePhase aUpdatePhase, |
|
83 TRequestStatus& aClientStatus ); |
|
84 |
|
85 /** |
|
86 * Return the root element of this document |
|
87 */ |
|
88 TInt DocumentCount(); |
|
89 |
|
90 /** |
|
91 * Return the root element of this document |
|
92 */ |
|
93 TPtrC Document( TInt aIndex ) const; |
|
94 |
|
95 /** |
|
96 * Returns the path to this directory |
|
97 * |
|
98 * @return TPtrC8 The path to the directory this object models |
|
99 */ |
|
100 TPtrC DirectoryPath() const; |
|
101 |
|
102 /** |
|
103 * Returns the path to this directory |
|
104 * |
|
105 * @return TPtrC8 The path to the directory this object models |
|
106 */ |
|
107 TXdmDocType DocumentTypeL( TInt aIndex ) const; |
|
108 |
|
109 private: //Methods |
|
110 |
|
111 /** |
|
112 * Symbian OS default constructor. |
|
113 * @param TInt Default Access Point ID |
|
114 * @return CXdmDocOperation* |
|
115 */ |
|
116 CLocalDirectory( CXdmEngine& aXdmEngine, |
|
117 CLocalProtocol& aLocalProtocol ); |
|
118 |
|
119 /** |
|
120 * Symbian OS default constructor. |
|
121 * @param TInt Default Access Point ID |
|
122 * @return CXdmDocOperation* |
|
123 */ |
|
124 void ConstructL(); |
|
125 |
|
126 /** |
|
127 * From CActive. |
|
128 * @return void |
|
129 */ |
|
130 void RunL(); |
|
131 |
|
132 /** |
|
133 * From CActive. |
|
134 * @return void |
|
135 */ |
|
136 void DoCancel(); |
|
137 |
|
138 /** |
|
139 * From CXdmDirectory. |
|
140 * @return void |
|
141 */ |
|
142 void FindTimeStampFilesL( const CDir* aDirectory ); |
|
143 |
|
144 /** |
|
145 * From CXdmDirectory. |
|
146 * @return void |
|
147 */ |
|
148 void MatchWithStampFilesL( const CDir* aDirectory ); |
|
149 |
|
150 /** |
|
151 * From CXdmDirectory. |
|
152 * @return void |
|
153 */ |
|
154 TInt OfferEntryL( const TDesC& aEntryName ); |
|
155 |
|
156 /** |
|
157 * From CXdmDirectory. |
|
158 * @return void |
|
159 */ |
|
160 void RefreshEntryArrayL(); |
|
161 |
|
162 private: //Data |
|
163 |
|
164 TRequestStatus* iClientStatus; |
|
165 TDirUpdatePhase iUpdatePhase; |
|
166 CLocalProtocol& iLocalProtocol; |
|
167 RPointerArray<CLocalDirectoryEntry> iEntryArray; |
|
168 }; |
|
169 |
|
170 #endif //__LOCALDIRECTORY__ |
|
171 |
|
172 // End of File |
|