1 /* |
|
2 * Copyright (c) 2002-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: |
|
15 * Base class for settings views. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef GSBASEVIEW_H |
|
21 #define GSBASEVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <gsplugininterface.h> |
|
25 |
|
26 #include <aknnavi.h> |
|
27 #include <aknview.h> |
|
28 #include <bldvariant.hrh> |
|
29 #include <ConeResLoader.h> |
|
30 #include <eikclb.h> |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CGSBaseContainer; |
|
34 class CAknNavigationDecorator; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * CGSBaseView view class |
|
40 * Base class for GS plugin views. |
|
41 * |
|
42 * @lib GSFramework.lib |
|
43 * @since Series60_3.1 |
|
44 */ |
|
45 class CGSBaseView : public CGSPluginInterface , public MEikListBoxObserver |
|
46 { |
|
47 public: |
|
48 |
|
49 // Panic code used in this class |
|
50 enum KGSViewPanicCodes |
|
51 { |
|
52 EGSViewPanicNullPtr = 1 |
|
53 }; |
|
54 |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * C++ default constructor |
|
59 */ |
|
60 IMPORT_C CGSBaseView(); |
|
61 |
|
62 /** |
|
63 * Symbian OS default constructor. |
|
64 */ |
|
65 IMPORT_C virtual void ConstructL()=0; |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 IMPORT_C ~CGSBaseView(); |
|
71 |
|
72 public: // New |
|
73 |
|
74 /** |
|
75 * This function is used to set the current item in the listbox. |
|
76 * @param aIndex Current item. Default value is 0 i.e. the first item |
|
77 * of the list. |
|
78 */ |
|
79 IMPORT_C virtual void SetCurrentItem( TInt aIndex = 0 ); |
|
80 |
|
81 /** |
|
82 * Returns the container this view has. |
|
83 * @return pointer to container, does not transfer ownership. |
|
84 */ |
|
85 IMPORT_C CGSBaseContainer* Container(); |
|
86 |
|
87 /** |
|
88 * Opens the nearest localized resourcefile using aResourceLoader. |
|
89 * aResourceLoader should be opened only once before closing it. |
|
90 * Otherwise it will raise a panic. Therefore it is better to have |
|
91 * multiple resource loaders. Uses KDC_RESOURCE_FILES_DIR. |
|
92 * |
|
93 * @param aResourceFileName Drive and name of resource file in format |
|
94 * <path>:<rsc_file_name> |
|
95 * @param aResourceLoader Resource loader for the resource. The loader |
|
96 * must not be opened allready or it will raise |
|
97 * a panic. It is caller's responsibility to |
|
98 * close the resource loader after using the |
|
99 * resource. |
|
100 */ |
|
101 IMPORT_C void OpenLocalizedResourceFileL( |
|
102 const TDesC& aResourceFileName, |
|
103 RConeResourceLoader& aResourceLoader ); |
|
104 |
|
105 public: // From CGSPluginInterface |
|
106 |
|
107 /** |
|
108 * See base class. |
|
109 */ |
|
110 IMPORT_C virtual void ResetSelectedItemIndex(); |
|
111 |
|
112 public: // From CAknView |
|
113 |
|
114 /** |
|
115 * See base class. |
|
116 */ |
|
117 IMPORT_C void DoActivateL( const TVwsViewId& aPrevViewId, |
|
118 TUid /*aCustomMessageId*/, |
|
119 const TDesC8& /*aCustomMessage*/ ); |
|
120 |
|
121 /** |
|
122 * See base class. |
|
123 */ |
|
124 IMPORT_C void DoDeactivate(); |
|
125 |
|
126 protected: // New |
|
127 |
|
128 /** |
|
129 * Sets the correct navi pane for the view (eg. tabs, string etc.). |
|
130 */ |
|
131 IMPORT_C virtual void SetNaviPaneL(); |
|
132 |
|
133 /** |
|
134 * Creates context for view's navi pane. |
|
135 * @param aResourceId Resource id for navi pane context's resource. |
|
136 */ |
|
137 IMPORT_C virtual void CreateNaviPaneContextL( TInt aResourceId ); |
|
138 |
|
139 /** |
|
140 * Creates container, |
|
141 */ |
|
142 IMPORT_C virtual void CreateContainerL(); |
|
143 |
|
144 /** |
|
145 * Functionality for creating a container. Called by DoActivateL(). |
|
146 * Implemented by sub-class. |
|
147 */ |
|
148 IMPORT_C virtual void NewContainerL() = 0; |
|
149 |
|
150 protected: // From CAknView |
|
151 |
|
152 /** |
|
153 * See base class. |
|
154 */ |
|
155 void HandleClientRectChange(); |
|
156 |
|
157 protected: // From MEikListBoxObserver |
|
158 |
|
159 /** |
|
160 * See base class. |
|
161 */ |
|
162 IMPORT_C void HandleListBoxEventL( CEikListBox* aListBox, |
|
163 TListBoxEvent aEventType ); |
|
164 |
|
165 private: // New |
|
166 |
|
167 /** |
|
168 * Handles listbox selection. Called by HandleListBoxEventL. |
|
169 * Implement by sub-class. |
|
170 */ |
|
171 virtual void HandleListBoxSelectionL() = 0; |
|
172 |
|
173 /** |
|
174 * Creates navi control container when needed |
|
175 */ |
|
176 CAknNavigationControlContainer* NaviControlContainerL(); |
|
177 |
|
178 public: // Data |
|
179 |
|
180 TVwsViewId iPrevViewId; // Previous view UID |
|
181 |
|
182 protected: // Data |
|
183 |
|
184 // Pointer to application UI. |
|
185 CAknViewAppUi* iAppUi; |
|
186 |
|
187 // Pointer to the container |
|
188 CGSBaseContainer* iContainer; |
|
189 |
|
190 // Navi pane |
|
191 CAknNavigationDecorator* iNaviPaneContext; |
|
192 |
|
193 // Pointer to the navi control container |
|
194 CAknNavigationControlContainer* iNaviControlContainer; |
|
195 |
|
196 // Currently selected listbox item |
|
197 TInt iCurrentItem; |
|
198 |
|
199 // First item in the listbox |
|
200 TInt iTopItemIndex; |
|
201 |
|
202 // European look and feel |
|
203 TBool iElaf; |
|
204 |
|
205 // Resource loader |
|
206 RConeResourceLoader iResourceLoader; |
|
207 |
|
208 private: // Data |
|
209 |
|
210 }; |
|
211 |
|
212 #endif // GSBASEVIEW_H |
|
213 // End of File |
|