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: A model class for CCamCaptureSetupListBox* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMCAPTURESETUPISTBOXMODEL_H |
|
19 #define CAMCAPTURESETUPISTBOXMODEL_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <AknUtils.h> |
|
24 |
|
25 #ifndef CAMERAAPP_PLUGIN_BUILD |
|
26 #include "CamAppController.h" |
|
27 #else |
|
28 #include "MCamAppController.h" |
|
29 #endif //CAMERAAPP_PLUGIN_BUILD |
|
30 #include "mcamlistboxmodel.h" |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CCamInfoListboxItemBase; |
|
35 class CFbsBitmap; |
|
36 class TAknLayoutRect; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Model class of CCamCaptureSetupListBox |
|
42 * |
|
43 * @since 2.8 |
|
44 */ |
|
45 class CCamCaptureSetupListBoxModel : public CBase, |
|
46 public MCamListboxModel |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * @since 2.8 |
|
53 * @param aController Controller reference |
|
54 * @param aArrayResourceId Id of resource used to populate the list |
|
55 * @param aSettingItem setting item |
|
56 * @param aShootingModeListBox ETrue if the model represents a shooting mode capture setup listbox |
|
57 * @return pointer to the created CCamCaptureSetupListBoxModel object |
|
58 */ |
|
59 static CCamCaptureSetupListBoxModel* NewLC( |
|
60 #ifndef CAMERAAPP_PLUGIN_BUILD |
|
61 CCamAppController& aController, |
|
62 #else // location setting will be moved to the plugin |
|
63 MCamAppController& aController, |
|
64 #endif |
|
65 TInt aArrayResourceId, |
|
66 TInt aSettingItem, |
|
67 TBool aShootingModeListBox, |
|
68 TBool aLocationSettingListBox, |
|
69 TRect aListBoxRect |
|
70 ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CCamCaptureSetupListBoxModel(); |
|
76 |
|
77 |
|
78 public: // from MCamListboxModel |
|
79 |
|
80 /** |
|
81 * @since 2.8 |
|
82 * Returns number of items in item array |
|
83 * @return Number of items |
|
84 */ |
|
85 virtual TInt NumberOfItems() const; |
|
86 |
|
87 /** |
|
88 * Returns pointer to the MDesCArray |
|
89 * @since 2.8 |
|
90 * @return Handle to MDesCArray |
|
91 */ |
|
92 virtual const MDesCArray* MatchableTextArray() const; |
|
93 |
|
94 /** |
|
95 * Returns pointer to the item text |
|
96 * @param aItemIndex index of the item |
|
97 * @return pointer to the item text |
|
98 */ |
|
99 virtual TPtrC ItemText( TInt aItemIndex ) const; |
|
100 |
|
101 /** |
|
102 * Returns the value id of the specified item |
|
103 * @param aItemIndex index of the item |
|
104 * @return the item's value id |
|
105 */ |
|
106 virtual TInt ItemValue( TInt aItemIndex ) const; |
|
107 |
|
108 /** |
|
109 * Returns the bitmap for the specified item |
|
110 * @param aItemIndex index of the item |
|
111 * @return pointer to the icon bitmap |
|
112 */ |
|
113 virtual CFbsBitmap* Bitmap( TInt aItemIndex ) const; |
|
114 |
|
115 /** |
|
116 * Returns the bitmap mask for the specified item |
|
117 * @param aItemIndex index of the item |
|
118 * @return pointer to the icon mask |
|
119 */ |
|
120 virtual CFbsBitmap* BitmapMask( TInt aItemIndex ) const; |
|
121 |
|
122 /** |
|
123 * Returns the index of the item with the specified |
|
124 * value id |
|
125 * @param aValueId the value to find |
|
126 * @return index of the matching item |
|
127 */ |
|
128 virtual TInt ValueIndex( TInt aValueId ) const; |
|
129 |
|
130 |
|
131 /** |
|
132 * Returns whether the model represents a shooting mode selection listbox |
|
133 * @since 2.8 |
|
134 * @return TBool ETrue if the model is representing a shooting mode listbox instead of a general settings listbox |
|
135 */ |
|
136 virtual TBool ShootingModeListBox() const; |
|
137 |
|
138 virtual TAknLayoutRect IconLayoutData() const; |
|
139 virtual TAknLayoutRect RadioButtonLayoutData() const; |
|
140 virtual TAknLayoutText TextLayoutData() const; |
|
141 virtual TAknLayoutRect ListItemLayoutData() const; |
|
142 |
|
143 |
|
144 protected: |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 * @since 2.8 |
|
149 * @param aController Controller reference |
|
150 * @param aShootingModeListBox is ETrue if the model represents a shooting mode settings listbox |
|
151 */ |
|
152 CCamCaptureSetupListBoxModel( |
|
153 #ifndef CAMERAAPP_PLUGIN_BUILD |
|
154 CCamAppController& aController, |
|
155 #else // location setting will be moved to the plugin |
|
156 MCamAppController& aController, |
|
157 #endif //CAMERAAPP_PLUGIN_BUILD |
|
158 TBool aShootingModeListBox, |
|
159 TBool aLocationSettingListBox = EFalse |
|
160 ); |
|
161 |
|
162 private: // Methods |
|
163 |
|
164 |
|
165 /** |
|
166 * Second phase constructor |
|
167 * @since 2.8 |
|
168 * @param aArrayResourceId Resource used to populate the list |
|
169 * @param aSettingItem setting item |
|
170 */ |
|
171 void ConstructL( TInt aArrayResourceId, TInt aSettingItem, TRect aListBoxRect ); |
|
172 |
|
173 protected: |
|
174 /** |
|
175 * Read in layout data from resource |
|
176 * @since 2.8 |
|
177 */ |
|
178 void ReadLayoutData( TRect aListBoxRect ); |
|
179 |
|
180 /** |
|
181 * |
|
182 * |
|
183 */ |
|
184 TBool SettingValueSupportedL( CCamInfoListboxItemBase* aItem, TInt aSettingItem ); |
|
185 |
|
186 protected: // Data |
|
187 |
|
188 // Array of items in the listbox |
|
189 RPointerArray<CCamInfoListboxItemBase> iItemArray; |
|
190 |
|
191 |
|
192 |
|
193 // layout data for listbox item icon |
|
194 TAknLayoutRect iIconLayoutData; |
|
195 |
|
196 // layout data for listbox item radio button |
|
197 TAknLayoutRect iRadioButtonLayoutData; |
|
198 |
|
199 // layout data for listbox item text |
|
200 TAknLayoutText iTextLayoutData; |
|
201 |
|
202 TAknLayoutRect iListItemLayoutData; |
|
203 |
|
204 |
|
205 |
|
206 #ifndef CAMERAAPP_PLUGIN_BUILD |
|
207 CCamAppController& iController; |
|
208 #else |
|
209 MCamAppController& iController; |
|
210 #endif //CAMERAAPP_PLUGIN_BUILD |
|
211 // Flag as to whether the model is for a shooting mode listbox |
|
212 TBool iShootingModeListBox; |
|
213 // Flag as to whether the model is for a location setting listbox |
|
214 TBool iLocationSettingListBox; |
|
215 |
|
216 TUint32 iSupportedFlashModes; |
|
217 |
|
218 TUint32 iSupportedWBModes; |
|
219 |
|
220 }; |
|
221 |
|
222 #endif // CAMCAPTURESETUPISTBOXMODEL_H |
|
223 |
|
224 // End of File |
|