140 IMPORT_C static CMmWidgetContainer* NewListBoxContainerL( const TRect& aRect, |
141 IMPORT_C static CMmWidgetContainer* NewListBoxContainerL( const TRect& aRect, |
141 MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); |
142 MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); |
142 |
143 |
143 public: // Highlight related methods |
144 public: // Highlight related methods |
144 |
145 |
145 /** |
146 /** |
146 * Sets the default highlight. |
147 * Sets the default highlight. |
147 * |
148 * |
148 * @since S60 v3.0 |
149 * @since S60 v3.0 |
149 * @param aRedraw Is highlight to redraw. |
150 * @param aRedraw Is highlight to redraw. |
150 */ |
151 */ |
151 virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0; |
152 virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0; |
152 |
153 |
153 /** |
154 /** |
154 * Sets the highlight. |
155 * Sets the highlight. |
155 * |
156 * |
156 * @since S60 v3.0 |
157 * @since S60 v3.0 |
157 * @param aItemIndex Index to set the highlight at. |
158 * @param aItemIndex Index to set the highlight at. |
158 * @param aRedraw Is highlight to redraw. |
159 * @param aRedraw Is highlight to redraw. |
159 */ |
160 */ |
160 IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex, TBool aRedraw = ETrue ); |
161 IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex, TBool aRedraw = ETrue ); |
161 |
162 |
162 /** |
163 /** |
163 * Gets the highlight from the widget. |
164 * Gets the highlight from the widget. |
164 * |
165 * |
165 * @since S60 v3.0 |
166 * @since S60 v3.0 |
166 * @return Current Highlight in the widget. |
167 * @return Current Highlight in the widget. |
167 */ |
168 */ |
168 IMPORT_C virtual TInt GetHighlight(); |
169 IMPORT_C virtual TInt GetHighlight(); |
169 |
170 |
170 /** |
171 /** |
171 * Gets the highlight from the widget. |
172 * Gets the highlight from the widget. |
172 * |
173 * |
173 * @since S60 v3.0 |
174 * @since S60 v3.0 |
174 * @return Previous Highlight in the widget. |
175 * @return Previous Highlight in the widget. |
175 */ |
176 */ |
176 IMPORT_C virtual TInt GetPreviousHighlight(); |
177 IMPORT_C virtual TInt GetPreviousHighlight(); |
177 |
178 |
178 /** |
179 /** |
179 * Set highlight visibility. |
180 * Set highlight visibility. |
180 * |
181 * |
181 * @since S60 v3.0 |
182 * @since S60 v3.0 |
182 * @param aVisible Visibility status. |
183 * @param aVisible Visibility status. |
183 */ |
184 */ |
184 IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); |
185 IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); |
185 |
186 |
186 /** |
187 /** |
187 * Set highlight visibility. |
188 * Set highlight visibility. |
188 * |
189 * |
189 * @since S60 v3.0 |
190 * @since S60 v3.0 |
190 * @return Visibility status. |
191 * @return Visibility status. |
191 */ |
192 */ |
192 IMPORT_C virtual TBool IsHighlightVisible(); |
193 IMPORT_C virtual TBool IsHighlightVisible(); |
193 |
194 |
194 /** |
195 /** |
195 * Handle item addition. |
196 * Handle item addition. |
196 * |
197 * |
197 * @since S60 v3.0 |
198 * @since S60 v3.0 |
198 */ |
199 */ |
199 IMPORT_C virtual void HandleItemAdditionL(); |
200 IMPORT_C virtual void HandleItemAdditionL(); |
200 |
201 |
201 |
202 |
202 /** |
203 /** |
203 * Handle item removal. |
204 * Handle item removal. |
204 * |
205 * |
205 * @since S60 v3.0 |
206 * @since S60 v3.0 |
206 */ |
207 */ |
207 IMPORT_C virtual void HandleItemRemovalL(); |
208 IMPORT_C virtual void HandleItemRemovalL(); |
208 |
209 |
209 /** |
210 /** |
210 * Handle item removal. |
211 * Handle item removal. |
211 * |
212 * |
212 * @since S60 v3.0 |
213 * @since S60 v3.0 |
213 */ |
214 */ |
214 IMPORT_C CHnSuiteModel* GetSuiteModelL(); |
215 IMPORT_C CHnSuiteModel* GetSuiteModelL(); |
215 |
216 |
216 /** |
217 /** |
217 * Retrieve type of widget. |
218 * Retrieve type of widget. |
218 * |
219 * |
219 * @since S60 v3.0 |
220 * @since S60 v3.0 |
220 * @return Type of widget. |
221 * @return Type of widget. |
221 */ |
222 */ |
222 IMPORT_C virtual THnSuiteWidgetType WidgetType(); |
223 IMPORT_C virtual THnSuiteWidgetType WidgetType(); |
223 |
224 |
224 /** |
225 /** |
225 * Removes all LIW objects owned by this object. |
226 * Removes all LIW objects owned by this object. |
226 * |
227 * |
227 * LIW objects owned by non-LIW objects that are owned by |
228 * LIW objects owned by non-LIW objects that are owned by |
228 * this object are also removed. |
229 * this object are also removed. |
229 */ |
230 */ |
230 virtual void RemoveLiwObjects(); |
231 virtual void RemoveLiwObjects(); |
231 |
232 |
232 /** |
233 /** |
233 * Sets the long tap observer. |
234 * Sets the long tap observer. |
234 * |
235 * |
235 * @param aObserver Observer to receive long tap events. |
236 * @param aObserver Observer to receive long tap events. |
236 */ |
237 */ |
237 IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver ); |
238 IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver ); |
238 |
239 |
239 /** |
240 /** |
240 * Informs the container that long tap event is finished (e.g. because |
241 * Informs the container that long tap event is finished (e.g. because |
241 * a command from the context menu has been issued). |
242 * a command from the context menu has been issued). |
242 * |
243 * |
243 * @param aStopTimer ETrue when the highlight timer should be stopped. |
244 * @param aStopTimer ETrue when the highlight timer should be stopped. |
244 */ |
245 */ |
245 IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue ); |
246 IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue ); |
246 |
247 |
247 public: |
248 public: |
248 |
249 |
249 /** |
250 /** |
250 * Sets suite model. |
251 * Sets suite model. |
251 * |
252 * |
252 * @since S60 v3.0 |
253 * @since S60 v3.0 |
253 * @param aModel Suite model. |
254 * @param aModel Suite model. |
254 */ |
255 */ |
255 virtual void SetSuiteModelL( CHnSuiteModel* aModel ); |
256 virtual void SetSuiteModelL( CHnSuiteModel* aModel ); |
256 |
257 |
257 /** |
258 /** |
258 * Gets Multimedia Menu model. |
259 * Gets Multimedia Menu model. |
259 * |
260 * |
260 * @since S60 v3.0 |
261 * @since S60 v3.0 |
261 * @return Model. |
262 * @return Model. |
262 */ |
263 */ |
263 virtual CMmListBoxModel* GetMmModel() = 0; |
264 virtual CMmListBoxModel* GetMmModel() = 0; |
264 |
265 |
265 /** |
266 /** |
266 * Sets widget observer. |
267 * Sets widget observer. |
267 * |
268 * |
268 * @since S60 v3.0 |
269 * @since S60 v3.0 |
269 * @param aObserver Widget observer. |
270 * @param aObserver Widget observer. |
270 */ |
271 */ |
271 IMPORT_C virtual void SetObserver( MMmWidgetObserver* aObserver); |
272 IMPORT_C virtual void SetObserver( MMmWidgetObserver* aObserver); |
272 |
273 |
273 /** |
274 /** |
274 * Gets item rectangle according to item index. |
275 * Gets item rectangle according to item index. |
275 * |
276 * |
276 * @since S60 v3.0 |
277 * @since S60 v3.0 |
277 * @param aItemIndex Item index. |
278 * @param aItemIndex Item index. |
278 * @return Item rectangle. |
279 * @return Item rectangle. |
279 */ |
280 */ |
280 IMPORT_C TRect GetItemRectL( TInt aItemIndex ); |
281 IMPORT_C TRect GetItemRectL( TInt aItemIndex ); |
281 |
282 |
282 /** |
283 /** |
283 * Sets empty text visible when model has no items. |
284 * Sets empty text visible when model has no items. |
284 * |
285 * |
285 * @since S60 v3.0 |
286 * @since S60 v3.0 |
286 * @param aText Text to be shown when view is empty. |
287 * @param aText Text to be shown when view is empty. |
287 */ |
288 */ |
288 virtual void SetEmptyTextL(const TDesC& aText) = 0 ; |
289 virtual void SetEmptyTextL(const TDesC& aText) = 0 ; |
289 |
290 |
290 /** |
291 /** |
291 * Sets flag. |
292 * Sets flag. |
292 * |
293 * |
293 * @since S60 v3.0 |
294 * @since S60 v3.0 |
294 * @param Flag Flag. |
295 * @param Flag Flag. |
295 */ |
296 */ |
296 virtual void SetFlag(TInt Flag); |
297 virtual void SetFlag(TInt Flag); |
297 |
298 |
298 /** |
299 /** |
299 * Gets widget. |
300 * Gets widget. |
300 * |
301 * |
301 * @since S60 v3.0 |
302 * @since S60 v3.0 |
302 * @return Widget. |
303 * @return Widget. |
303 */ |
304 */ |
304 virtual CEikListBox* Widget(); |
305 virtual CEikListBox* Widget(); |
305 |
306 |
306 /** |
307 /** |
307 * Sets background context for item drawer and view. |
308 * Sets background context for item drawer and view. |
308 * |
309 * |
309 * @since S60 v3.0 |
310 * @since S60 v3.0 |
310 * @param aBgContext Background context. |
311 * @param aBgContext Background context. |
311 */ |
312 */ |
312 virtual void SetItemDrawerAndViewBgContext( |
313 virtual void SetItemDrawerAndViewBgContext( |
313 CAknsBasicBackgroundControlContext * aBgContext ) =0; |
314 CAknsBasicBackgroundControlContext * aBgContext ) =0; |
314 |
315 |
315 /** |
316 /** |
316 * Sets edit mode so UI is aware. |
317 * Sets edit mode so UI is aware. |
317 * |
318 * |
318 * @since S60 v3.0 |
319 * @since S60 v3.0 |
319 * @param aIsEditMode Is edit mode. |
320 * @param aIsEditMode Is edit mode. |
320 */ |
321 */ |
321 virtual void SetEditModeL( TBool aIsEditMode ); |
322 virtual void SetEditModeL( TBool aIsEditMode ); |
322 |
323 |
323 /** |
324 /** |
324 * Tells if UI is aware of edit mode. |
325 * Tells if UI is aware of edit mode. |
325 * |
326 * |
326 * @since S60 v5.0 |
327 * @since S60 v5.0 |
327 * @return Edit mode status. |
328 * @return Edit mode status. |
328 */ |
329 */ |
329 virtual TBool IsEditMode() const; |
330 virtual TBool IsEditMode() const; |
330 |
331 |
331 /** |
332 /** |
332 * Sets up widget layout (needed for grid). |
333 * Sets up widget layout (needed for grid). |
333 * |
334 * |
334 * @since S60 v3.0 |
335 * @since S60 v3.0 |
335 */ |
336 */ |
336 virtual void SetupWidgetLayoutL() =0; |
337 virtual void SetupWidgetLayoutL() =0; |
337 |
338 |
338 /** |
339 /** |
339 * Constructor. |
340 * Constructor. |
340 */ |
341 */ |
341 CMmWidgetContainer(); |
342 CMmWidgetContainer(); |
342 |
343 |
343 /** |
344 /** |
344 * Destructor. |
345 * Destructor. |
345 */ |
346 */ |
346 ~CMmWidgetContainer(); |
347 ~CMmWidgetContainer(); |
347 |
348 |
348 /** |
349 /** |
349 * Enables/disables animation during long tap. |
350 * Enables/disables animation during long tap. |
350 * Tactile feedback is also enabled and disabled with the animation. |
351 * Tactile feedback is also enabled and disabled with the animation. |
351 * Changes made with this method will be effective on the next long |
352 * Changes made with this method will be effective on the next long |
352 * tap, i.e. it is not possible to stop an already started animation |
353 * tap, i.e. it is not possible to stop an already started animation |
353 * by using this method. |
354 * by using this method. |
354 * |
355 * |
355 * @param aEnable ETrue - enable, EFalse - disable long tap animation |
356 * @param aEnable ETrue - enable, EFalse - disable long tap animation |
356 * and long tap tactile feedback |
357 * and long tap tactile feedback |
357 */ |
358 */ |
358 IMPORT_C void EnableLongTapAnimation( TBool aEnable ); |
359 IMPORT_C void EnableLongTapAnimation( TBool aEnable ); |
359 |
360 |
805 * @param aPos Current position. |
830 * @param aPos Current position. |
806 * @param aTapPoint Point of the tap. |
831 * @param aTapPoint Point of the tap. |
807 * @return Distance between two points in pixels. |
832 * @return Distance between two points in pixels. |
808 */ |
833 */ |
809 TInt DeltaSquare( const TPoint aTapPoint, |
834 TInt DeltaSquare( const TPoint aTapPoint, |
810 const TPoint aPos ); |
835 const TPoint aPos ); |
811 |
836 |
812 /** |
837 /** |
813 * Checks, whether given item is a folder or root folder. |
838 * Checks, whether given item is a folder or root folder. |
814 * @param aItemIndex Item index to check. |
839 * @param aItemIndex Item index to check. |
815 * @returns True, if given item is a folder or root folder, false otherwise. |
840 * @returns True, if given item is a folder or root folder, false otherwise. |
816 */ |
841 */ |
817 TBool IsFolderL( TInt aItemIndex ); |
842 TBool IsFolderL( TInt aItemIndex ); |
818 |
843 |
819 /** |
844 /** |
820 * Checks, whether given item has IsDeleteLockedL flag set. |
845 * Checks, whether given item has IsDeleteLockedL flag set. |
821 * @param aItemIndex Item index to check. |
846 * @param aItemIndex Item index to check. |
822 * @returns IsDeleteLockedL flag |
847 * @returns IsDeleteLockedL flag |
823 */ |
848 */ |
824 TBool IsDeleteLockedL( TInt aItemIndex ); |
849 TBool IsDeleteLockedL( TInt aItemIndex ); |
825 |
850 |
826 /** |
851 /** |
827 * Gets column count in current view. |
852 * Gets column count in current view. |
828 * @returns Column count in current view. |
853 * @returns Column count in current view. |
829 */ |
854 */ |
830 virtual TInt ColumnsInCurrentView(); |
855 virtual TInt ColumnsInCurrentView(); |
831 |
856 |
832 /** |
857 /** |
833 * Gets row count in current view. |
858 * Gets row count in current view. |
834 * @returns Row count in current view. |
859 * @returns Row count in current view. |
835 */ |
860 */ |
836 virtual TInt RowsInCurrentView(); |
861 virtual TInt RowsInCurrentView(); |
837 |
862 |
838 /** |
863 /** |
839 * Scrolls the view move mode non-touch so that move indicators are visible. |
864 * Scrolls the view move mode non-touch so that move indicators are visible. |
840 */ |
865 */ |
841 void ScrollViewIfNeededL(); |
866 void ScrollViewIfNeededL(); |
842 |
867 |
843 /** |
868 /** |
844 * Scrolls the view in pixels. |
869 * Scrolls the view in pixels. |
845 * @param aPixels THe number of pixels to scroll. If negative, the view is scrolled down. |
870 * @param aPixels THe number of pixels to scroll. If negative, the view is scrolled down. |
846 */ |
871 */ |
847 void ScrollInPixelsL( TInt aPixels ); |
872 void ScrollInPixelsL( TInt aPixels ); |
848 |
873 |
849 /** |
874 /** |
850 * Sets up the scrolling effect movement type. |
875 * Sets up the scrolling effect movement type. |
851 * @param aDown True if scrolling is downwards. |
876 * @param aDown True if scrolling is downwards. |
852 */ |
877 */ |
853 void SetupScrollingEffectsL( TBool aDown ); |
878 void SetupScrollingEffectsL( TBool aDown ); |
854 |
879 |
855 protected: |
880 protected: |
856 |
881 |
857 |
882 |
858 /** |
883 /** |
859 * Own. |
884 * Own. |
860 */ |
885 */ |
861 CEikListBox* iWidget; |
886 CEikListBox* iWidget; |
862 |
887 |
863 /** |
888 /** |
864 * Key event observer. |
889 * Key event observer. |
865 */ |
890 */ |
866 MMmKeyEventObserver* iKeyEventObserver; |
891 MMmKeyEventObserver* iKeyEventObserver; |
867 |
892 |
868 /** |
893 /** |
869 * Drag and drop observer. |
894 * Drag and drop observer. |
870 */ |
895 */ |
871 MMmDragAndDropObserver* iDragAndDropObserver; |
896 MMmDragAndDropObserver* iDragAndDropObserver; |
886 */ |
911 */ |
887 CMmListBoxItemDrawer* iDrawer; |
912 CMmListBoxItemDrawer* iDrawer; |
888 |
913 |
889 protected: |
914 protected: |
890 |
915 |
891 /** |
916 /** |
892 * Current Highlight. |
917 * Current Highlight. |
893 */ |
918 */ |
894 TInt iCurrentHighlight; |
919 TInt iCurrentHighlight; |
895 |
920 |
896 /** |
921 /** |
897 * Has drag occurred. |
922 * Has drag occurred. |
898 */ |
923 */ |
899 TBool iDragOccured; |
924 TBool iDragOccured; |
900 |
925 |
901 /** |
926 /** |
902 * Processed display elelments for better performance. |
927 * Processed display elelments for better performance. |
903 */ |
928 */ |
904 CMmPostEvaluationProcessor* iPostProcessor; |
929 CMmPostEvaluationProcessor* iPostProcessor; |
905 |
930 |
906 /** |
931 /** |
907 * Set when long tap is in progress (stylus popup displayed over container) |
932 * Set when long tap is in progress (stylus popup displayed over container) |
908 */ |
933 */ |
909 TBool iLongTapInProgress; |
934 TBool iLongTapInProgress; |
910 |
935 |
911 private: |
936 private: |
912 |
937 |
913 |
938 |
914 /** |
939 /** |
915 * Background context. |
940 * Background context. |
916 * Own. |
941 * Own. |
917 */ |
942 */ |
918 CAknsBasicBackgroundControlContext* iBgContext; |
943 CAknsBasicBackgroundControlContext* iBgContext; |
919 |
944 |
920 /** |
945 /** |
921 * Last drag point. |
946 * Last drag point. |
922 */ |
947 */ |
923 TPoint iLastDragPoint; |
948 TPoint iLastDragPoint; |
924 |
949 |
925 /** |
950 /** |
926 * First tap point. |
951 * First tap point. |
927 */ |
952 */ |
928 TPoint iTapPoint; |
953 TPoint iTapPoint; |
929 |
954 |
930 /** |
955 /** |
931 * First tap point. |
956 * First tap point. |
932 */ |
957 */ |
933 TPoint iItemRelativeTapPoint; |
958 TPoint iItemRelativeTapPoint; |
934 |
959 |
935 /** |
960 /** |
936 * Last drag highlight. |
961 * Last drag highlight. |
937 */ |
962 */ |
938 TInt iLastDragHighlight; |
963 TInt iLastDragHighlight; |
939 |
964 |
940 /** |
965 /** |
941 * Dragged item index. |
966 * Dragged item index. |
942 */ |
967 */ |
943 TBool iDraggedIndex; |
968 TBool iDraggedIndex; |
944 |
969 |
945 /** |
970 /** |
946 * Edit mode status. |
971 * Edit mode status. |
947 */ |
972 */ |
948 TBool iIsEditMode; |
973 TBool iIsEditMode; |
949 |
974 |
950 /** |
975 /** |
951 * Destination of item index. |
976 * Destination of item index. |
952 */ |
977 */ |
953 TInt iItemIndexDestination; |
978 TInt iItemIndexDestination; |
954 |
979 |
955 /** |
980 /** |
956 * Previous Highlight. |
981 * Previous Highlight. |
957 */ |
982 */ |
958 TInt iPreviousHighlight; |
983 TInt iPreviousHighlight; |
959 |
984 |
960 /** |
985 /** |
961 * The current rect of the widget control. |
986 * The current rect of the widget control. |
962 */ |
987 */ |
963 TRect iWidgetRect; |
988 TRect iWidgetRect; |
964 |
989 |
965 /** |
990 /** |
966 * Longpress allowed flag. We only accept long press (EEventKey+iRepeats) |
991 * Longpress allowed flag. We only accept long press (EEventKey+iRepeats) |
967 * when there was no highlight visible before EEventKeyDown, otherwise |
992 * when there was no highlight visible before EEventKeyDown, otherwise |
968 * we react only to EEventKeyDown |
993 * we react only to EEventKeyDown |
969 */ |
994 */ |
970 TBool iAllowLongPress; |
995 TBool iAllowLongPress; |
971 |
996 |
972 /** |
997 /** |
973 * Cache for widget position. |
998 * Cache for widget position. |
974 */ |
999 */ |
975 TMmWidgetPosition iWidgetPositionCache; |
1000 TMmWidgetPosition iWidgetPositionCache; |
976 |
1001 |
977 /** |
1002 /** |
978 * ETrue if Matrix menu window is faded. |
1003 * ETrue if Matrix menu window is faded. |
979 */ |
1004 */ |