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: Main view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef GSMAINVIEW_H |
|
21 #define GSMAINVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "gspluginloader.h" |
|
25 #include "gschildviewmanager.h" |
|
26 #include <data_caging_path_literals.hrh> |
|
27 #include <ConeResLoader.h> |
|
28 #include <gstabbedviewowner.h> |
|
29 #include <aknview.h> |
|
30 #include <eikmenup.h> |
|
31 |
|
32 // CONSTANTS |
|
33 _LIT( KGSMainViewResourceFileName, "z:GSApp.rsc" ); |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CGSMainContainer; |
|
37 class CGSPluginInterface; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CGSMainView view class |
|
43 * |
|
44 * Main view of GS |
|
45 * |
|
46 * This view is responsible for visualizing the first level of settings |
|
47 * plugins. |
|
48 * |
|
49 */ |
|
50 class CGSMainView : |
|
51 public CAknView, |
|
52 public MGSPluginLoadObserver, |
|
53 public MGSTabbedViewOwner, |
|
54 public MGSChildViewManager |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 CGSMainView(); |
|
59 |
|
60 /** |
|
61 * Symbian OS two-phased constructor |
|
62 * @return GS main view. |
|
63 */ |
|
64 static CGSMainView* NewL(); |
|
65 |
|
66 /** |
|
67 * Symbian OS two-phased constructor |
|
68 * @return GS main view. |
|
69 */ |
|
70 static CGSMainView* NewLC(); |
|
71 |
|
72 /** |
|
73 * Symbian OS default constructor. |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 /** |
|
78 * Destructor |
|
79 */ |
|
80 ~CGSMainView(); |
|
81 |
|
82 public: // New |
|
83 |
|
84 /** |
|
85 * Returns pointer to the owned plugins. |
|
86 */ |
|
87 CArrayPtrFlat<CGSPluginInterface>* Plugins(); |
|
88 |
|
89 /** |
|
90 * Updates plugin's view. This can be used when child plugin's values |
|
91 * are changed. |
|
92 */ |
|
93 void UpdateView(); |
|
94 |
|
95 public: // From CAknView |
|
96 |
|
97 /** |
|
98 * See base view. |
|
99 */ |
|
100 TUid Id() const; |
|
101 |
|
102 public: // From MGSPluginLoadObserver |
|
103 |
|
104 /** |
|
105 * See base view. |
|
106 */ |
|
107 void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); |
|
108 |
|
109 public: // From MGSChildViewManager |
|
110 |
|
111 /** |
|
112 * See base view. |
|
113 */ |
|
114 void TransferDynamicPluginL( CGSPluginInterface* aPlugin ); |
|
115 |
|
116 public: // From MGSTabbedViewOwner |
|
117 |
|
118 /** |
|
119 * See base view. |
|
120 */ |
|
121 CArrayPtrFlat<CGSPluginInterface>* TabbedViews(); |
|
122 |
|
123 /** |
|
124 * See base class. |
|
125 */ |
|
126 void TabChangedL( TUid selectedTabUid ); |
|
127 |
|
128 protected: // From CAknView |
|
129 |
|
130 /** |
|
131 * See base view. |
|
132 */ |
|
133 void DoActivateL( |
|
134 const TVwsViewId& aPrevViewId, |
|
135 TUid aCustomMessageId, |
|
136 const TDesC8& aCustomMessage ); |
|
137 |
|
138 /** |
|
139 * See base view. |
|
140 */ |
|
141 void DoDeactivate(); |
|
142 |
|
143 /** |
|
144 * See base view. |
|
145 */ |
|
146 void HandleCommandL( TInt aCommand ); |
|
147 |
|
148 protected: // From MEikMenuObserver |
|
149 |
|
150 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * Opens the nearest localized resourcefile. |
|
156 */ |
|
157 void OpenLocalizedResourceFileL( const TDesC& aResourceFileName ); |
|
158 |
|
159 /** |
|
160 * Creates new container. |
|
161 */ |
|
162 void NewContainerL(); |
|
163 |
|
164 private: // Data |
|
165 |
|
166 // Pointer to Application UI. Not owned. |
|
167 CAknViewAppUi* iAppUi; |
|
168 |
|
169 // Pointer to owned container. |
|
170 CGSMainContainer* iContainer; |
|
171 |
|
172 // GS plug-ins owned by this view. CGSPluginLoader defines the |
|
173 // ordering of items. |
|
174 CArrayPtrFlat<CGSPluginInterface>* iPluginArray; |
|
175 |
|
176 // Asynchronous loader for the GS plug-ins. |
|
177 CGSPluginLoader* iPluginLoader; |
|
178 |
|
179 // Resource loader. |
|
180 RConeResourceLoader iResourceLoader; |
|
181 |
|
182 // UID of the selected plugin in the container's lbx. |
|
183 TUid iSelectedPluginUid; |
|
184 }; |
|
185 |
|
186 #endif // GSMAINVIEW_H |
|
187 // End of File |
|