41 * @ingroup group_mmwidgets |
41 * @ingroup group_mmwidgets |
42 */ |
42 */ |
43 NONSHARABLE_CLASS( CMmListBoxModel ): |
43 NONSHARABLE_CLASS( CMmListBoxModel ): |
44 public CAknFilteredTextListBoxModel, |
44 public CAknFilteredTextListBoxModel, |
45 public MHnSuiteObserver |
45 public MHnSuiteObserver |
46 { |
46 { |
47 public: |
47 public: |
48 // Constructors and destructor |
48 // Constructors and destructor |
49 |
49 |
50 /** |
50 /** |
51 * Destructor. |
51 * Destructor. |
52 */ |
52 */ |
53 ~CMmListBoxModel(); |
53 ~CMmListBoxModel(); |
54 |
54 |
55 /** |
55 /** |
56 * Two-phased constructor. |
56 * Two-phased constructor. |
57 */ |
57 */ |
58 static CMmListBoxModel* NewL( ); |
58 static CMmListBoxModel* NewL( ); |
59 |
59 |
60 /** |
60 /** |
61 * Two-phased constructor. |
61 * Two-phased constructor. |
62 */ |
62 */ |
63 static CMmListBoxModel* NewLC( ); |
63 static CMmListBoxModel* NewLC( ); |
64 |
64 |
65 /** |
65 /** |
66 * Gets the text attribute for a specific item by the name of the attribute. |
66 * Gets the text attribute for a specific item by the name of the attribute. |
67 * |
67 * |
68 * @since S60 v3.0 |
68 * @since S60 v3.0 |
69 * @param aIndex The index of the item for which the text is requested. |
69 * @param aIndex The index of the item for which the text is requested. |
70 * @param aAttributeName The name of the text attribute to be returned. |
70 * @param aAttributeName The name of the text attribute to be returned. |
71 * @return Size of item. |
71 * @return Size of item. |
72 */ |
72 */ |
73 const TDesC8& GetAttributeAsText( TInt aIndex, const TDesC8 & aAttributeName ); |
73 const TDesC8& GetAttributeAsText( TInt aIndex, const TDesC8 & aAttributeName ); |
74 |
74 |
75 /** |
75 /** |
76 * Gets the graphical attribute for a specific item by the name of the attribute. |
76 * Gets the graphical attribute for a specific item by the name of the attribute. |
77 * The attribute is returned as an icon holder. Please see @c CHnIconHolder for |
77 * The attribute is returned as an icon holder. Please see @c CHnIconHolder for |
78 * infomation on what icon holder is and what |
78 * infomation on what icon holder is and what |
79 * it is useful for. |
79 * it is useful for. |
80 * |
80 * |
81 * @param aIndex The index of the item for which the graphic is requested. |
81 * @param aIndex The index of the item for which the graphic is requested. |
82 * @param aAttributeName The name of the graphical attribute to be returned. |
82 * @param aAttributeName The name of the graphical attribute to be returned. |
83 * @param aDesiredIconSize The desired icon size. |
83 * @param aDesiredIconSize The desired icon size. |
84 * @return An icon holder object. |
84 * @return An icon holder object. |
85 */ |
85 */ |
86 CHnIconHolder* GetAttributeAsRefCountedGraphics( TInt aIndex, |
86 CHnIconHolder* GetAttributeAsRefCountedGraphics( TInt aIndex, |
87 const TDesC8& aAttributeName, TSize* aDesiredIconSize = NULL ); |
87 const TDesC8& aAttributeName, TSize* aDesiredIconSize = NULL ); |
88 |
88 |
89 /** |
89 /** |
90 * Sets the suite model. This method is used by matrix menu application when suite is loaded. |
90 * Sets the suite model. This method is used by matrix menu application when suite is loaded. |
91 * |
91 * |
92 * @since S60 v3.0 |
92 * @since S60 v3.0 |
93 * @param aSuiteModel The suite model to be set. |
93 * @param aSuiteModel The suite model to be set. |
94 */ |
94 */ |
95 void SetSuiteModelL( CHnSuiteModel * aSuiteModel ); |
95 void SetSuiteModelL( CHnSuiteModel * aSuiteModel ); |
96 |
96 |
97 /** |
97 /** |
98 * Gets the suite model of the currently visible suite. |
98 * Gets the suite model of the currently visible suite. |
99 * |
99 * |
100 * @since S60 v3.0 |
100 * @since S60 v3.0 |
101 * @return The current suite model. |
101 * @return The current suite model. |
102 */ |
102 */ |
103 CHnSuiteModel* GetSuiteModel(); |
103 CHnSuiteModel* GetSuiteModel(); |
104 |
104 |
105 /** |
105 /** |
106 * Reorders the model when item positions are edited in edit mode. |
106 * Reorders the model when item positions are edited in edit mode. |
107 * |
107 * |
108 * @since S60 v3.0 |
108 * @since S60 v3.0 |
109 * @param aFromIndex The starting index of items to be shifted. |
109 * @param aFromIndex The starting index of items to be shifted. |
110 * @param aToIndex The end index of items to be shifted. |
110 * @param aToIndex The end index of items to be shifted. |
111 */ |
111 */ |
112 void ReorderModelL(TInt aFromIndex, TInt aToIndex); |
112 void ReorderModelL(TInt aFromIndex, TInt aToIndex); |
113 |
113 |
114 /** |
114 /** |
115 * Handle event triggered by suite. |
115 * Handle event triggered by suite. |
116 * |
116 * |
117 * @since S60 v3.0 |
117 * @since S60 v3.0 |
118 * @param aCustomSuiteEvent Type of suite event. |
118 * @param aCustomSuiteEvent Type of suite event. |
119 * @param aModel The suite model that the event concerns. |
119 * @param aModel The suite model that the event concerns. |
120 */ |
120 */ |
121 void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, |
121 void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, |
122 CHnSuiteModel* aModel ); |
122 CHnSuiteModel* aModel ); |
123 |
123 |
124 /** |
124 /** |
125 * Determines the number of item-specific menu items for given item. |
125 * Determines the number of item-specific menu items for given item. |
126 * |
126 * |
127 * @since S60 v3.0 |
127 * @since S60 v3.0 |
128 * @param aItemIndex Item index. |
128 * @param aItemIndex Item index. |
129 * @return Number of item-specific menu items. |
129 * @return Number of item-specific menu items. |
130 */ |
130 */ |
131 TInt GetNumberOfSpecificMenuItemsL( TInt aItemIndex ); |
131 TInt GetNumberOfSpecificMenuItemsL( TInt aItemIndex ); |
132 |
132 |
133 private: |
133 private: |
134 |
134 |
135 /** |
135 /** |
136 * Gets the attribute by name. |
136 * Gets the attribute by name. |
137 * |
137 * |
138 * @since S60 v3.0 |
138 * @since S60 v3.0 |
139 * @param aIndex The index of the item for which the attribute is requested. |
139 * @param aIndex The index of the item for which the attribute is requested. |
140 * @param aAttributeName The name of the requested attribute. |
140 * @param aAttributeName The name of the requested attribute. |
141 * @return Size of item. |
141 * @return Size of item. |
142 */ |
142 */ |
143 CHnAttributeBase* GetAttribute( TInt aIndex, const TDesC8 & aAttributeName ); |
143 CHnAttributeBase* GetAttribute( TInt aIndex, const TDesC8 & aAttributeName ); |
144 |
|
145 /** |
|
146 * Updates the item text array when model is reordered or new model is loaded. |
|
147 * It is important that the number of elements in the array is the same |
|
148 * as number of items in the suite. |
|
149 * |
|
150 * @since S60 v3.0 |
|
151 */ |
|
152 void UpdateDummyArrayDataL(); |
|
153 |
144 |
154 |
145 /** |
|
146 * Updates the item text array when model is reordered or new model is loaded. |
|
147 * It is important that the number of elements in the array is the same |
|
148 * as number of items in the suite. |
|
149 * |
|
150 * @since S60 v3.0 |
|
151 */ |
|
152 void UpdateDummyArrayDataL(); |
|
153 |
|
154 |
155 /** |
155 /** |
156 * Constructor for performing 1st stage construction |
156 * Constructor for performing 1st stage construction |
157 */ |
157 */ |
158 CMmListBoxModel( ); |
158 CMmListBoxModel( ); |
159 |
159 |
160 /** |
160 /** |
161 * Default symbian 2nd stage constructor. |
161 * Default symbian 2nd stage constructor. |
162 */ |
162 */ |
163 void ConstructL(); |
163 void ConstructL(); |
164 |
164 |
165 |
165 |
166 private: |
166 private: |
167 |
167 |
168 /** |
168 /** |
169 * Not own. Suite model being the container for the data. |
169 * Not own. Suite model being the container for the data. |
170 */ |
170 */ |
171 CHnSuiteModel* iSuiteModel; |
171 CHnSuiteModel* iSuiteModel; |
172 |
172 |
173 }; |
173 }; |
174 |
174 |
175 #endif // CMMLISTBOXMODEL_H |
175 #endif // CMMLISTBOXMODEL_H |