|
1 /* |
|
2 * Copyright (c) 2007 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: CTruiMainView class of TrainingUI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_TRUIMAINVIEW_H |
|
20 #define C_TRUIMAINVIEW_H |
|
21 |
|
22 #include <aknview.h> |
|
23 #include <akntoolbarobserver.h> |
|
24 |
|
25 class CTruiMainViewContainer; |
|
26 |
|
27 // UID of view |
|
28 const TUid KTruiMainViewId = {1}; |
|
29 |
|
30 /** |
|
31 * CTruiMainView view class. |
|
32 * |
|
33 * @code |
|
34 * CTruiMainView* view = CTruiMainView::NewLC(); |
|
35 * AddViewL( view ); |
|
36 * CleanupStack::Pop(); |
|
37 * @endcode |
|
38 * |
|
39 */ |
|
40 class CTruiMainView : public CAknView, public MAknToolbarObserver |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two phase construction. |
|
46 * |
|
47 * @return Pointer to CTruiMainView's instance |
|
48 */ |
|
49 static CTruiMainView* NewL(); |
|
50 |
|
51 /** |
|
52 * Two phase construction. |
|
53 * |
|
54 * @return Pointer to CTruiMainView's instance |
|
55 */ |
|
56 static CTruiMainView* NewLC(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CTruiMainView(); |
|
62 |
|
63 // from base class CAknView |
|
64 |
|
65 /** |
|
66 * Returns views id. |
|
67 * |
|
68 * @return id for this view. |
|
69 */ |
|
70 TUid Id() const; |
|
71 |
|
72 /** |
|
73 * Command handling function. |
|
74 * |
|
75 * @param aCommand ID of the command to respond to. |
|
76 */ |
|
77 void HandleCommandL( TInt aCommand ); |
|
78 |
|
79 // from MEikMenuObserver |
|
80 /** |
|
81 * Dynamically initialises a menu pane. |
|
82 * |
|
83 * @param aResourceId The resource Id. |
|
84 * @param aMenuPane The in-memory representation of the menu pane. |
|
85 */ |
|
86 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * Constructor. |
|
92 */ |
|
93 CTruiMainView(); |
|
94 |
|
95 /** |
|
96 * Perform the second phase construction of a CTruiMainView object. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 /** |
|
101 * Dynamically initialises the character range menu pane. |
|
102 * |
|
103 * @param aScriptId Language script Id. |
|
104 * @param aMenuPane The in-memory representation of the menu pane. |
|
105 */ |
|
106 void InitCharRangeSubMenuL( TInt aScriptId, CEikMenuPane* aMenuPane); |
|
107 |
|
108 /** |
|
109 * Get reource ID of menu items for initializing menu pane. |
|
110 * |
|
111 * @param aScriptId Language script Id. |
|
112 * @return resource Id of menu items. |
|
113 */ |
|
114 TInt MenuItemsReourceId( TInt aScriptId ); |
|
115 |
|
116 /** |
|
117 * Check menu item dimmed by menu item id. |
|
118 * |
|
119 * @param aMenuPane Pointer to menu pane. |
|
120 * @param aMenuItemId Menu item id of menu. |
|
121 * @return ETrue: menu item is dimmed |
|
122 */ |
|
123 TBool IsMenuItemDimmed( CEikMenuPane* aMenuPane, TInt aMenuItemId ); |
|
124 |
|
125 // from base class CAknView |
|
126 /** |
|
127 * Called by the framework when view is activated. |
|
128 * |
|
129 * @param aPrevViewId This is not used now. |
|
130 * @param aCustomMessage This is not used now. |
|
131 * @param aCustomMessage This is not used now. |
|
132 */ |
|
133 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
134 TUid aCustomMessageId, |
|
135 const TDesC8& aCustomMessage ); |
|
136 |
|
137 /** |
|
138 * Called by the framework when view is deactivated. |
|
139 * |
|
140 */ |
|
141 void DoDeactivate(); |
|
142 |
|
143 /** |
|
144 * From MAknToolbarObserver. |
|
145 * Handles toolbar events for a certain toolbar item. |
|
146 * |
|
147 * @param aCommand The command ID of some toolbar item. |
|
148 */ |
|
149 void OfferToolbarEventL( TInt aCommand ); |
|
150 |
|
151 private: // data |
|
152 |
|
153 /** |
|
154 * Pointer to the component control |
|
155 * own. |
|
156 */ |
|
157 CTruiMainViewContainer* iContainer; |
|
158 |
|
159 /** |
|
160 * Indicates whether all delete is dimmed |
|
161 */ |
|
162 TBool iDimAllDelete; |
|
163 }; |
|
164 |
|
165 #endif // C_TRUIMAINVIEW_H |
|
166 |