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: Implements container for the user scene setup list.* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMUSERSCENESETUPCONTAINER_H |
|
19 #define CAMUSERSCENESETUPCONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "CamContainerBase.h" |
|
23 #include <coecntrl.h> |
|
24 #include <eiklbo.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CAknSettingStyleListBox; |
|
28 class CCamUserSceneSetupItemArray; |
|
29 class CEikFormattedCellListBox; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CCamUserSceneSetupContainer container control class. |
|
35 * |
|
36 */ |
|
37 class CCamUserSceneSetupContainer : public CCamContainerBase, |
|
38 public MEikListBoxObserver |
|
39 //, public MCoeControlObserver |
|
40 { |
|
41 /* enum TVfState moved to CCamContainerBase. |
|
42 */ |
|
43 |
|
44 // ======================================================= |
|
45 // Constructors and destructor |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Symbian two-phased constructor. |
|
50 * @param aRect reference to the rectangular area for the container. |
|
51 * @param aSettingsModel reference to the settings model. |
|
52 * @return pointer to the created CCamUserSceneSetupContainer object. |
|
53 * @since 2.8 |
|
54 */ |
|
55 static CCamUserSceneSetupContainer* NewLC( const TRect& aRect, |
|
56 TInt aResourceId, |
|
57 CCamAppController& aController, |
|
58 CAknView& aView ); |
|
59 /** |
|
60 * Symbian two-phased constructor. |
|
61 * @param aRect reference to the rectangular area for the container. |
|
62 * @param aSettingsModel reference to the settings model. |
|
63 * @return pointer to the created CCamUserSceneSetupContainer object. |
|
64 * @since 2.8 |
|
65 */ |
|
66 static CCamUserSceneSetupContainer* NewL( const TRect& aRect, |
|
67 TInt aResourceId, |
|
68 CCamAppController& aController, |
|
69 CAknView& aView ); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 * @since 2.8 |
|
74 */ |
|
75 virtual ~CCamUserSceneSetupContainer(); |
|
76 |
|
77 // ------------------------------------------------------- |
|
78 // From CCoeControl |
|
79 private: |
|
80 |
|
81 /** |
|
82 * @since 2.8 |
|
83 */ |
|
84 TInt CountComponentControls() const; |
|
85 |
|
86 /** |
|
87 * @since 2.8 |
|
88 */ |
|
89 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
90 |
|
91 /** |
|
92 * @since 2.8 |
|
93 * @param aKeyEvent the key event |
|
94 * @param aType the type of the event |
|
95 * @return TKeyResponse key event was used by this control or not |
|
96 */ |
|
97 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
98 |
|
99 // ------------------------------------------------------- |
|
100 // From MEikListBoxObserver |
|
101 public: |
|
102 |
|
103 /** |
|
104 * Handles a list box event. |
|
105 * @param aListBox a reference to the list box. |
|
106 * @param aEventType the type of event. |
|
107 * @since 2.8 |
|
108 */ |
|
109 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
110 |
|
111 /** |
|
112 * Handles the user selection of a list item. |
|
113 * @since 2.8 |
|
114 */ |
|
115 void HandleSelectionL(); |
|
116 |
|
117 // ------------------------------------------------------- |
|
118 // New functions |
|
119 public: |
|
120 |
|
121 /** |
|
122 * Handles a change in the item list visibility. |
|
123 * @since 2.8 |
|
124 */ |
|
125 void UpdateDisplayL(); |
|
126 |
|
127 /** |
|
128 * Returns the resource Id of the title for this container. |
|
129 * @return the resource Id |
|
130 * @since 2.8 |
|
131 */ |
|
132 TInt TitlePaneTextResourceId(); |
|
133 |
|
134 /** |
|
135 * Updates the list items with the settings model values. |
|
136 * @since 2.8 |
|
137 */ |
|
138 void UpdateListItems(); |
|
139 |
|
140 /** |
|
141 * Updates the current list item with it's associated |
|
142 * settings model value. |
|
143 * @since 2.8 |
|
144 */ |
|
145 void UpdateCurrentListItem(); |
|
146 |
|
147 /** |
|
148 * Returns wheather user scene restore is highlighted |
|
149 */ |
|
150 TBool IsUserSceneResetHighlighted(); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * Updates a list item with its corresponding settings model value. |
|
156 * @param aIndex the index of the list item. |
|
157 * @since 2.8 |
|
158 */ |
|
159 void UpdateListItem( TInt aIndex ); |
|
160 |
|
161 /** |
|
162 * Returns the command id for activating the UI control that is |
|
163 * associated with the currently selected list item. |
|
164 * @return the command id. |
|
165 * @since 2.8 |
|
166 */ |
|
167 TInt CommandIdForActivatingCurrentItemControl(); |
|
168 |
|
169 /** |
|
170 * Returns a pointer to the list box. |
|
171 * @return the list box pointer. |
|
172 * @since 2.8 |
|
173 */ |
|
174 CEikFormattedCellListBox* ListBox(); |
|
175 |
|
176 // ------------------------------------------------------- |
|
177 // Constructors |
|
178 private: |
|
179 |
|
180 /** |
|
181 * C++ Constructor |
|
182 * @param aController a reference to the controller. |
|
183 * @param aView a reference to the view that contains this container. |
|
184 * @since 2.8 |
|
185 */ |
|
186 CCamUserSceneSetupContainer( CCamAppController& aController, CAknView& aView ); |
|
187 |
|
188 /** |
|
189 * 2nd phase constructor. |
|
190 * @since 2.8 |
|
191 * @param aRect reference to the rectangular area for the container. |
|
192 * @param aSettingsModel reference to the settings model. |
|
193 */ |
|
194 void ConstructL( const TRect& aRect, TInt aResourceId ); |
|
195 |
|
196 // ======================================================= |
|
197 // Data |
|
198 private: |
|
199 |
|
200 // User scene setup list owned by this container. |
|
201 CAknSettingStyleListBox* iUserSceneSetupList; |
|
202 |
|
203 // Array of user scene setup list items owned by this container. |
|
204 CCamUserSceneSetupItemArray* iUserSceneSetupItemArray; |
|
205 |
|
206 // The resource if for the title of the scene setup list. |
|
207 TInt iTitleResourceId; |
|
208 |
|
209 // ======================================================= |
|
210 }; |
|
211 |
|
212 #endif |
|
213 |
|
214 // End of File |
|