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: Model class of capture setup menu list box.* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMCAPTURESETUPMENULISTBOXMODEL_H |
|
19 #define CAMCAPTURESETUPMENULISTBOXMODEL_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <eiklbm.h> |
|
23 #include <badesca.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 class CFbsBitmap; |
|
27 class CCamAppController; |
|
28 class CCamCaptureSetupMenuListItem; |
|
29 class TResourceReader; |
|
30 |
|
31 /** |
|
32 * Model class of capture setup menu list box |
|
33 * |
|
34 */ |
|
35 class CCamCaptureSetupMenuListBoxModel : public CBase, public MListBoxModel |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @since 2.8 |
|
42 * @param aController used to obtain setting model values for list items. |
|
43 * @param aReader used to construct the model's array of list items from resources. |
|
44 * @return pointer to the created model. |
|
45 */ |
|
46 static CCamCaptureSetupMenuListBoxModel* NewLC |
|
47 ( CCamAppController& aController, TResourceReader& aReader ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 * @since 2.8 |
|
52 */ |
|
53 ~CCamCaptureSetupMenuListBoxModel(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 /** |
|
58 * Queries whether the item has icon text. |
|
59 * @since 2.8 |
|
60 * @return bool result. |
|
61 */ |
|
62 TBool ItemHasIconText( TInt aItemIndex ) const; |
|
63 |
|
64 /** |
|
65 * Returns the bitmap to be used for a particular list item. |
|
66 * @since 2.8 |
|
67 * @param aItemIndex index of the list item. |
|
68 * @param aMask ETrue to return the mask bitmap |
|
69 * @return pointer to the bitmap. |
|
70 */ |
|
71 CFbsBitmap* BitmapForItem( TInt aItemIndex, TBool aMask ); |
|
72 |
|
73 /** |
|
74 * Returns the text to be used for a particular list item. |
|
75 * @since 2.8 |
|
76 * @param aItemIndex index of the list item. |
|
77 * @return Ref to the item text. |
|
78 */ |
|
79 const TDesC& TextForItem( TInt aItemIndex ) const; |
|
80 |
|
81 /** |
|
82 * Returns the text to be used in place of an icon for a particular list item. |
|
83 * @since 2.8 |
|
84 * @param aItemIndex index of the list item. |
|
85 * @return Ref to the icon text. |
|
86 */ |
|
87 const TDesC& IconTextForItem( TInt aItemIndex ) const; |
|
88 |
|
89 /** |
|
90 * Returns the settings model id associated with a particular list item. |
|
91 * @since 2.8 |
|
92 * @param aItemIndex index of the list item. |
|
93 * @return the settings model id. |
|
94 */ |
|
95 TInt SettingsModelIdAssociatedWithItem( TInt aItemIndex ) const; |
|
96 |
|
97 public: // Functions from MListBoxModel |
|
98 |
|
99 /** |
|
100 * From MListBoxModel returns number of items in item array |
|
101 * @since 2.8 |
|
102 * @return Number of items |
|
103 */ |
|
104 TInt NumberOfItems() const; |
|
105 |
|
106 /** |
|
107 * Returns pointer to the MDesCArray |
|
108 * @since 2.8 |
|
109 * @return Handle to MDesCArray |
|
110 */ |
|
111 const MDesCArray* MatchableTextArray() const; |
|
112 |
|
113 private: // Constructors |
|
114 |
|
115 /** |
|
116 * C++ default constructor. |
|
117 * @since 2.8 |
|
118 * @param aController used to obtain setting model values for list items. |
|
119 */ |
|
120 CCamCaptureSetupMenuListBoxModel( CCamAppController& aController ); |
|
121 |
|
122 /** |
|
123 * 2nd phase constructor. |
|
124 * @since 2.8 |
|
125 * @param aReader used to construct the model's array of list items from resources. |
|
126 */ |
|
127 void ConstructFromResourceL( TResourceReader& aReader ); |
|
128 |
|
129 |
|
130 |
|
131 private: //New functions |
|
132 |
|
133 private: // Data |
|
134 |
|
135 // Reference to the controller. |
|
136 CCamAppController& iController; |
|
137 |
|
138 //Matchable text array |
|
139 MDesCArray* iMatchableTextArray; |
|
140 |
|
141 // Array of all the list items. |
|
142 RPointerArray<CCamCaptureSetupMenuListItem> iListItemPtrArray; |
|
143 }; |
|
144 |
|
145 #endif // CAMCAPTURESETUPMENULISTBOXMODEL_H |
|
146 |
|
147 // End of File |
|