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: View class for vcommand app |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVCGENERICVIEW_H |
|
20 #define CVCGENERICVIEW_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknview.h> |
|
24 #include <vcommandapi.h> |
|
25 |
|
26 #include "vcmodel.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CVCAppUi; |
|
30 class CVCGenericContainer; |
|
31 class CAknProgressDialog; |
|
32 class CEikProgressInfo; |
|
33 class CCoeEnv; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * CVCGenericView view class. |
|
40 */ |
|
41 class CVCGenericView : public CAknView |
|
42 { |
|
43 |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Constructor. |
|
48 * |
|
49 * @param aService reference to VC API |
|
50 */ |
|
51 CVCGenericView( CVCModel& aModel ); |
|
52 |
|
53 /** |
|
54 * Symbian C++ default constructor. |
|
55 * @param aResource view resource id from the compiled resource file |
|
56 */ |
|
57 void ConstructL( TInt aResourceId ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CVCGenericView(); |
|
63 |
|
64 |
|
65 public: // Function from base classes |
|
66 |
|
67 /** |
|
68 * From CAknView |
|
69 * |
|
70 * @see CAknView for more information |
|
71 */ |
|
72 void HandleCommandL( TInt aCommand ); |
|
73 |
|
74 /** |
|
75 * Handle screen size change. |
|
76 */ |
|
77 void HandleSizeChange(); |
|
78 |
|
79 /** |
|
80 * From CAknView |
|
81 * @see CAknView for more information |
|
82 */ |
|
83 TUid Id() const; |
|
84 |
|
85 |
|
86 public: // New functions |
|
87 |
|
88 /** |
|
89 * Handles basic commands like editing and playing items and opening views. |
|
90 * To make sure only one event is handled each time, HandleCommandL should be |
|
91 * called instead. |
|
92 * |
|
93 * @param aCommand command to handle |
|
94 */ |
|
95 void DoHandleCommandL( TInt aCommand ); |
|
96 |
|
97 /** |
|
98 * Returns the title of the folder where this view is active. |
|
99 * |
|
100 * @return TPtrC name of the item folder in listbox |
|
101 */ |
|
102 const TDesC& FolderTitle() const; |
|
103 |
|
104 /** |
|
105 * Sets the middle softkey label. |
|
106 * @param aIndex index in listbox |
|
107 */ |
|
108 void SetMiddleSoftkeyLabelL( TInt aIndex ) const; |
|
109 |
|
110 /** |
|
111 * Refreshes the view to the current voice commands status |
|
112 */ |
|
113 void RefreshViewL(); |
|
114 |
|
115 |
|
116 private: // Functions from base classes |
|
117 |
|
118 /** |
|
119 * From CAknView |
|
120 * @see CAknView for more information |
|
121 */ |
|
122 void HandleClientRectChange(); |
|
123 |
|
124 /** |
|
125 * From MEikMenuObserver |
|
126 * This function defines how to show menupanel. |
|
127 * |
|
128 * @see MEikMenuObserver for more information |
|
129 */ |
|
130 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
131 |
|
132 /** |
|
133 * From CAknView |
|
134 * |
|
135 * @see CAknView for more information |
|
136 */ |
|
137 void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
138 const TDesC8& aCustomMessage ); |
|
139 |
|
140 /** |
|
141 * From CAknView |
|
142 * @see CAknView for more information |
|
143 */ |
|
144 void DoDeactivate(); |
|
145 |
|
146 |
|
147 private: // New functions |
|
148 |
|
149 /** |
|
150 * Displays cannot delete error note. |
|
151 */ |
|
152 void CannotDeleteNoteL(); |
|
153 |
|
154 /** |
|
155 * Shows playback voice command progress dialog. |
|
156 */ |
|
157 void PlaybackVoiceCommandL(); |
|
158 |
|
159 /** |
|
160 * Launches demo VoiceUI. |
|
161 */ |
|
162 void LaunchDemoVoiceUiL() const; |
|
163 |
|
164 /** |
|
165 * Sets the current folders title |
|
166 * |
|
167 * @see CVCFolderInfo::Title |
|
168 * @param aNewName new name for folder |
|
169 */ |
|
170 void SetFolderTitleL( const TDesC& aNewName ); |
|
171 |
|
172 /** |
|
173 * Sets the middle softkey label. |
|
174 * @param aResourceId Label text from resource file |
|
175 * @param aCommandId Menu c |
|
176 */ |
|
177 void DoSetMiddleSoftKeyLabelL( const TInt aResourceId, |
|
178 const TInt aCommandId ) const; |
|
179 |
|
180 /** |
|
181 * Remove MSK command mappings. |
|
182 */ |
|
183 void RemoveCommandFromMSK() const; |
|
184 |
|
185 private: // data |
|
186 |
|
187 HBufC* iFolderName; |
|
188 CVCModel& iModel; |
|
189 CVCGenericContainer* iContainer; |
|
190 // Array of voice commands |
|
191 CVCommandArray* iCommands; |
|
192 // The focused index in listbox. Used to set the correct focus when |
|
193 // returning from folder or settings view |
|
194 TInt iFocusedIndex; |
|
195 |
|
196 }; |
|
197 |
|
198 #endif // CVCGENERICVIEW_H |
|
199 |
|
200 // End of File |
|
201 |
|