|
1 /* |
|
2 * Copyright (c) 2004 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 the License "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: Declaration of class CCodDocument. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef COD_DOCUMENT_H |
|
20 #define COD_DOCUMENT_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <GenericParamConsumer.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 class CEikAppUi; |
|
30 class CCodEngBase; |
|
31 class CRequestCompleteCallback; |
|
32 class CCodAppUi; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Dummy document class COD Viewer application (application is not file-based). |
|
38 */ |
|
39 NONSHARABLE_CLASS( CCodDocument ): public CAiwGenericParamConsumer |
|
40 { |
|
41 |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. Leaves on failure. |
|
46 * @param aApp Application. |
|
47 * @param aCod COD or DD? |
|
48 * @return The created document. |
|
49 */ |
|
50 static CCodDocument* NewL( CEikApplication& aApp, TBool aCod ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CCodDocument(); |
|
56 |
|
57 public: // Member access |
|
58 |
|
59 /** |
|
60 * Access the model. |
|
61 * @return The model. |
|
62 */ |
|
63 CCodEngBase& Model(); |
|
64 |
|
65 public: // from CEikDocument |
|
66 |
|
67 /** |
|
68 * Create Application Ui. |
|
69 * @return App Ui. |
|
70 */ |
|
71 CEikAppUi* CreateAppUiL(); |
|
72 |
|
73 /** |
|
74 * Open a file. |
|
75 * @param aDoOpen Don't know what it is. |
|
76 * @param aFilename File name. |
|
77 * @param aFs File Server Session to be used. |
|
78 * @return NULL (COD file is not EPOC-style store based). |
|
79 */ |
|
80 CFileStore* OpenFileL |
|
81 ( |
|
82 TBool aDoOpen, |
|
83 const TDesC& aFilename, |
|
84 RFs& aFs |
|
85 ); |
|
86 |
|
87 /** |
|
88 * Open a file. |
|
89 * @param aFs File Server Session to be used. |
|
90 * @param aFile File. |
|
91 * @return NULL (COD file is not EPOC-style store based). |
|
92 */ |
|
93 CFileStore* OpenFileL( RFs& aFs, RFile& aFile ); |
|
94 |
|
95 /** |
|
96 * Open a file. |
|
97 * @param aFile File. |
|
98 * @param aFileStore Return value placeholder. |
|
99 * Returns NULL (COD file is not EPOC-style store based). |
|
100 */ |
|
101 void OpenFileL( CFileStore*& aFileStore, RFile& aFile ); |
|
102 |
|
103 private: // Constructors and destructor |
|
104 |
|
105 /** |
|
106 * Constructor. |
|
107 * @param aCod COD or DD? |
|
108 * @param aApp Application. |
|
109 */ |
|
110 CCodDocument( CEikApplication& aApp, TBool aCod ); |
|
111 |
|
112 /** |
|
113 * Second phase constructor. Leaves on failure. |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 private: // new methods |
|
118 |
|
119 /** |
|
120 * Get AppUi upcasted to real type. |
|
121 * @return App UI. |
|
122 */ |
|
123 inline CCodAppUi* CodAppUi(); |
|
124 |
|
125 /** |
|
126 * Handle file opening completion (display descriptor or exit). |
|
127 */ |
|
128 void OpenFileDone(); |
|
129 |
|
130 /** |
|
131 * Handle file opening completion (static wrapper for TCallBack use). |
|
132 * @param aPtr Pointer passed to the callback (this object as TAny*). |
|
133 * @return EFalse (as TInt). |
|
134 */ |
|
135 static TInt StaticOpenFileDone( TAny* aPtr ); |
|
136 |
|
137 private: // data |
|
138 |
|
139 /// COD or DD? |
|
140 TBool iCod; |
|
141 /// Model (data & semantics). Owned. |
|
142 CCodEngBase* iModel; |
|
143 /// Callback object. Owned. |
|
144 CRequestCompleteCallback* iCallback; |
|
145 }; |
|
146 |
|
147 #endif /* def COD_DOCUMENT_H */ |