1 /* |
|
2 * Copyright (c) 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: Application UI class for vcommand app |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVCAPPUI_H |
|
20 #define CVCAPPUI_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikapp.h> |
|
24 #include <eikdoc.h> |
|
25 #include <e32std.h> |
|
26 #include <coeccntx.h> |
|
27 #include <aknViewAppUi.h> |
|
28 #include <AknWaitDialog.h> |
|
29 #include <vcommandapi.h> |
|
30 #include "vcmodelappuiinterface.h" |
|
31 |
|
32 class CVCModel; |
|
33 class CAppCloser; |
|
34 class CVCGenericView; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Application UI class. |
|
40 * Provides support for the following features: |
|
41 * - EIKON control architecture |
|
42 * - view architecture |
|
43 * - status pane |
|
44 */ |
|
45 class CVCAppUi : public CAknViewAppUi, public MVcModelAppUiInterface |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Symbian C++ default constructor. |
|
51 */ |
|
52 void ConstructL(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CVCAppUi(); |
|
58 |
|
59 public: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From MVcModelAppUiInterface |
|
63 * Notifies the the command set has changed and the view may need to be |
|
64 * updated |
|
65 */ |
|
66 virtual void CommandSetChanged(); |
|
67 |
|
68 /** |
|
69 * Called before starting VCommandHandler operations that should be |
|
70 * executed fully before application can be exited. Leave safe operation. |
|
71 * A subsequent call to CleanupStack::PopAndDestroy should be done |
|
72 * after such operations have completed |
|
73 */ |
|
74 virtual void StartAtomicOperationLC(); |
|
75 |
|
76 /** |
|
77 * From CAknViewAppUi |
|
78 */ |
|
79 TBool IsDisplayingMenuOrDialog(); |
|
80 |
|
81 public: // New Functions |
|
82 |
|
83 /** |
|
84 * Sets titlepane text |
|
85 * @param aResourceId id for resource |
|
86 * @return void |
|
87 */ |
|
88 void SetTitleL( TInt aResourceId ); |
|
89 |
|
90 /** |
|
91 * Displays command too short note |
|
92 * @return void |
|
93 */ |
|
94 void ShowErrorNoteL( TInt aResourceId ); |
|
95 |
|
96 /** |
|
97 * Displays name already in use note |
|
98 * @return void |
|
99 */ |
|
100 void NameAlreadyInUseNoteL( const TDesC& aName ); |
|
101 |
|
102 /** |
|
103 * Displays wait note |
|
104 * @param aText text to be displayed |
|
105 * @return void |
|
106 */ |
|
107 void ShowWaitNoteL( const TDesC& aText ); |
|
108 |
|
109 /** |
|
110 * Deletes wait note |
|
111 * @return void |
|
112 */ |
|
113 void DeleteWaitNoteL(); |
|
114 |
|
115 /** |
|
116 * Checks if there's call in progress. |
|
117 * @return TInt ESACallNone if there's no active call |
|
118 */ |
|
119 TInt CheckCallStateL(); |
|
120 |
|
121 /** |
|
122 * Displays call in progress note |
|
123 * @return void |
|
124 */ |
|
125 void CallInProgressNoteL(); |
|
126 |
|
127 /** |
|
128 * |
|
129 * @return TBool ETrue if there is a video call |
|
130 */ |
|
131 TBool IsVideoCallL(); |
|
132 |
|
133 /** |
|
134 * Exits the application correctly, taking into account whether a call |
|
135 * has been made to NotifyStartOfAtomicOperation |
|
136 * @return void |
|
137 */ |
|
138 void ExitProgram(); |
|
139 |
|
140 /** |
|
141 * Exits the application |
|
142 */ |
|
143 void DoExitProgram(); |
|
144 |
|
145 /** |
|
146 * Calls CAppCloser::Call. CAppCloser::RunL will eventually exit the |
|
147 * application. |
|
148 */ |
|
149 void ExitProgramDeferred(); |
|
150 |
|
151 |
|
152 private: // Functions from base classes |
|
153 |
|
154 /** |
|
155 * From MEikMenuObserver |
|
156 * @see MEikMenuObserver for more information |
|
157 */ |
|
158 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
159 |
|
160 /** |
|
161 * From CEikAppUi |
|
162 * @see CEikAppUi for more information |
|
163 */ |
|
164 void HandleCommandL( TInt aCommand ); |
|
165 |
|
166 /** |
|
167 * From CEikAppUi |
|
168 * Handle skin change event. |
|
169 */ |
|
170 void HandleResourceChangeL( TInt aType ); |
|
171 |
|
172 private: // New functions |
|
173 |
|
174 /** |
|
175 * Runs the EndAtomicOperation when calling CleanupStack::PopAndDestroy after |
|
176 * a call to StartAtomicOperationLC |
|
177 */ |
|
178 static void CleanupEndAtomicOperation( TAny* aService ); |
|
179 |
|
180 /** |
|
181 * Creates and pushes to cleanup stack a TCleanupItem that calls |
|
182 * EndAtomicOperation when CleanupStack::PopAndDestroy is called |
|
183 */ |
|
184 void CreateAndPushEndAtomicCleanupItemL(); |
|
185 |
|
186 /** |
|
187 * Called after VCommandHandler operations that need to be operated |
|
188 * fully before application can be exited have been completed. |
|
189 */ |
|
190 void EndAtomicOperation(); |
|
191 |
|
192 |
|
193 private: // data |
|
194 |
|
195 // Wait dialog for command editing |
|
196 CAknWaitDialog* iWaitNote; |
|
197 |
|
198 // Indicates that an operation has to be finished before the |
|
199 // application can be exited |
|
200 TBool iOperationInProgress; |
|
201 |
|
202 // Indicates that an request for exiting the application has been made |
|
203 TBool iExitRequested; |
|
204 |
|
205 // Active object used to close the application |
|
206 CAppCloser* iCloser; |
|
207 |
|
208 friend class CAppCloser; |
|
209 |
|
210 CVCGenericView* iMainView; |
|
211 |
|
212 CVCGenericView* iFolderView; |
|
213 |
|
214 CVCModel* iModel; |
|
215 }; |
|
216 |
|
217 #endif // CVCAPPUI_H |
|
218 |
|
219 // End of File |
|
220 |
|
221 |
|