|
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: XDM directory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __XDMDIRECTORY__ |
|
22 #define __XDMDIRECTORY__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <XdmDocument.h> |
|
26 |
|
27 enum TDirUpdatePhase |
|
28 { |
|
29 EDirPhaseIdle = 0, |
|
30 EUpdateDocumentList, |
|
31 ERefreshDocuments |
|
32 }; |
|
33 |
|
34 //FORWARD DECLARATION |
|
35 class CXdmEngine; |
|
36 class CXdmDocumentNode; |
|
37 class CXdmOperationFactory; |
|
38 |
|
39 class CXdmDirectory : public CActive |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 IMPORT_C ~CXdmDirectory(); |
|
47 |
|
48 public: //The abstract directory API |
|
49 |
|
50 /** |
|
51 * Return the number of documents in this directory |
|
52 * @return TInt Number of documents |
|
53 */ |
|
54 virtual TInt DocumentCount() = 0; |
|
55 |
|
56 /** |
|
57 * Return the name of the specified document |
|
58 * @param TInt Index of the desired document |
|
59 * @return TPtrC Name of the specified document |
|
60 */ |
|
61 virtual TPtrC Document( TInt aIndex ) const = 0; |
|
62 |
|
63 /** |
|
64 * Returns the path to this directory |
|
65 * @return TPtrC8 The path to the directory this object models |
|
66 */ |
|
67 virtual TPtrC DirectoryPath() const = 0; |
|
68 |
|
69 /* |
|
70 * Return the type of the specified document |
|
71 * @param TInt Index of the desired document |
|
72 * @return TXdmDocType Type of the document |
|
73 */ |
|
74 virtual TXdmDocType DocumentTypeL( TInt aIndex ) const = 0; |
|
75 |
|
76 protected: |
|
77 |
|
78 /** |
|
79 * By default Symbian OS constructor is private. |
|
80 * @param TDesC& The directory path |
|
81 * @return void |
|
82 */ |
|
83 IMPORT_C void BaseConstructL( const TDesC& aDirectoryPath ); |
|
84 |
|
85 /** |
|
86 * C++ constructor is protected. |
|
87 */ |
|
88 IMPORT_C CXdmDirectory( CXdmEngine& aXdmEngine ); |
|
89 |
|
90 private: //Methods which need to be accessible from the CXdmEngine |
|
91 //but NOT from the client application => friend class |
|
92 |
|
93 /** |
|
94 * Start updating the contents of this directory model |
|
95 * @param TRequestStatus& Request status of the client |
|
96 * @param TDirUpdatePhase Phase of the update |
|
97 * @return void |
|
98 */ |
|
99 virtual void StartUpdateL() = 0; |
|
100 |
|
101 /** |
|
102 * Cancel a directory update |
|
103 * @return void |
|
104 */ |
|
105 virtual void CancelUpdate() = 0; |
|
106 |
|
107 /** |
|
108 * Save the client's request status and update status |
|
109 * @param TDirUpdatePhase The update phase |
|
110 * @param TRequestStatus The client's request status |
|
111 * @return void |
|
112 */ |
|
113 virtual void SaveRequestData( TDirUpdatePhase aUpdatePhase, |
|
114 TRequestStatus& aClientStatus ) = 0; |
|
115 |
|
116 protected: |
|
117 |
|
118 TInt iFileCount; |
|
119 HBufC* iDirectoryPath; |
|
120 CXdmEngine& iXdmEngine; |
|
121 TDirUpdatePhase iUpdatePhase; |
|
122 friend class CXdmEngine; |
|
123 }; |
|
124 |
|
125 #endif //__XDMDIRECTORY__ |
|
126 |
|
127 // End of File |