menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h
branchRCL_3
changeset 19 79311d856354
parent 9 f966699dea19
child 23 7be2816dbabd
equal deleted inserted replaced
18:d05a55b217df 19:79311d856354
    28 #include <coecntrl.h>
    28 #include <coecntrl.h>
    29 #include <AknsDrawUtils.h>
    29 #include <AknsDrawUtils.h>
    30 #include <AknsLayeredBackgroundControlContext.h>
    30 #include <AknsLayeredBackgroundControlContext.h>
    31 #include <AknsListBoxBackgroundControlContext.h>
    31 #include <AknsListBoxBackgroundControlContext.h>
    32 #include <aknlongtapdetector.h>
    32 #include <aknlongtapdetector.h>
       
    33 #include <liwgenericparam.h>
    33 
    34 
    34 #include "hnsuiteobserver.h"
    35 #include "hnsuiteobserver.h"
    35 #include "mmvisibilityobserver.h"
    36 #include "mmvisibilityobserver.h"
    36 #include "hnglobals.h"
    37 #include "hnglobals.h"
    37 
    38 
    60  *
    61  *
    61  * @since S60 v5.0
    62  * @since S60 v5.0
    62  * @ingroup group_mmwidgets
    63  * @ingroup group_mmwidgets
    63  */
    64  */
    64 class TMmWidgetPosition
    65 class TMmWidgetPosition
    65 	{
    66   {
    66 public:
    67 public:
    67     /**
    68     /**
    68      * Default constructor.
    69      * Default constructor.
    69      * Initializes member variables with sensible values.
    70      * Initializes member variables with sensible values.
    70      */
    71      */
    71     TMmWidgetPosition();
    72     TMmWidgetPosition();
    72 
    73 
    73 public: // data
    74 public: // data
    74 	/**
    75   /**
    75 	 * The vertical item offset cache.
    76    * The vertical item offset cache.
    76 	 */
    77    */
    77 	TInt iVerticalItemOffset;
    78   TInt iVerticalItemOffset;
    78 
    79 
    79 	/**
    80   /**
    80 	 * The top item index cache.
    81    * The top item index cache.
    81 	 */
    82    */
    82 	TInt iTopItemIndex;
    83   TInt iTopItemIndex;
    83 
    84 
    84 	/**
    85   /**
    85 	 * Tells if the cached values are valid.
    86    * Tells if the cached values are valid.
    86 	 */
    87    */
    87 	TBool iValid;
    88   TBool iValid;
    88 
    89 
    89 	/**
    90   /**
    90 	 * The mode (portrait/landscape) for which the cache is valid.
    91    * The mode (portrait/landscape) for which the cache is valid.
    91 	 */
    92    */
    92 	TBool iLandscape;
    93   TBool iLandscape;
    93 
    94 
    94 	/**
    95   /**
    95 	 * Id from model (not index) of the currently highlighted item.
    96    * Id from model (not index) of the currently highlighted item.
    96 	 * It should only be set if the currently highlighted item is
    97    * It should only be set if the currently highlighted item is
    97 	 * visible (fully or partially), otherwise it must remain
    98    * visible (fully or partially), otherwise it must remain
    98 	 * initialized to KErrNotFound.
    99    * initialized to KErrNotFound.
    99 	 */
   100    */
   100 	TInt iHighlightedItemId;
   101   TInt iHighlightedItemId;
   101 	};
   102   };
   102 
   103 
   103 /**
   104 /**
   104  *  Interface for widget containers.
   105  *  Interface for widget containers.
   105  *
   106  *
   106  *  @code
   107  *  @code
   112 
   113 
   113 NONSHARABLE_CLASS( CMmWidgetContainer ): public CCoeControl,
   114 NONSHARABLE_CLASS( CMmWidgetContainer ): public CCoeControl,
   114                                          public MMmVisibilityObserver,
   115                                          public MMmVisibilityObserver,
   115                                          public MEikListBoxObserver,
   116                                          public MEikListBoxObserver,
   116                                          public MAknLongTapDetectorCallBack
   117                                          public MAknLongTapDetectorCallBack
   117 	{
   118   {
   118 public:
   119 public:
   119 
   120 
   120     /**
   121     /**
   121      * Creates a new grid container.
   122      * Creates a new grid container.
   122      *
   123      *
   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 
   402      *
   403      *
   403      * @since S60 v5.0
   404      * @since S60 v5.0
   404      * @param aPointerEvent Pointer event.
   405      * @param aPointerEvent Pointer event.
   405      */
   406      */
   406     void HandlePointerEventsInEditModeL(const TPointerEvent& aPointerEvent,
   407     void HandlePointerEventsInEditModeL(const TPointerEvent& aPointerEvent,
   407     		TBool aAbortAnimations );
   408         TBool aAbortAnimations );
   408 
   409 
   409     /**
   410     /**
   410      * Set draggable.
   411      * Set draggable.
   411      *
   412      *
   412      * @since S60 v3.0
   413      * @since S60 v3.0
   653     /**
   654     /**
   654      * Sets the iIsFaded member variable, which is used to determine
   655      * Sets the iIsFaded member variable, which is used to determine
   655      * if marquee animation can be enabled.
   656      * if marquee animation can be enabled.
   656      */
   657      */
   657     IMPORT_C void SetIsFaded( TBool aIsFaded );
   658     IMPORT_C void SetIsFaded( TBool aIsFaded );
   658     
   659 
   659     /**
   660     /**
   660      * Determines if long tap is in progress.
   661      * Determines if long tap is in progress.
   661      * 
   662      *
   662      * @return ETrue if long tap is in progress.
   663      * @return ETrue if long tap is in progress.
   663      */
   664      */
   664     TBool LongTapInProgress() const;
   665     TBool LongTapInProgress() const;
       
   666 
       
   667     /**
       
   668      * Determines if folder can be moved to another one.
       
   669      */
       
   670     IMPORT_C TBool AllowMove() const;
       
   671 
       
   672     /**
       
   673      * Sets allow move param.
       
   674      * @param aAllowMove. ETrue if move item is allowed.
       
   675      */
       
   676     void SetAllowMove( TBool aAllowMove );
       
   677 
       
   678     /**
       
   679      * Sets parameters for move event.
       
   680      * @param aRecipientId Item id to be moved.
       
   681      * @param aEventParameters Event parameters.
       
   682      */
       
   683     IMPORT_C void SetTriggerMoveItemL( const TInt aRecipientId,
       
   684                 CLiwGenericParamList* aEventParameters );
       
   685 
       
   686     /**
       
   687      * Calls move event.
       
   688      */
       
   689     void TriggerMoveItemL();
   665 
   690 
   666 public: // from MMmVisibilityObserver
   691 public: // from MMmVisibilityObserver
   667 
   692 
   668     /**
   693     /**
   669      *
   694      *
   701     /**
   726     /**
   702      * Handles additional contruction tasks.
   727      * Handles additional contruction tasks.
   703      *
   728      *
   704      * @since S60 v3.0
   729      * @since S60 v3.0
   705      */
   730      */
   706 	void ConstructL();
   731   void ConstructL();
   707 
   732 
   708     /**
   733     /**
   709      * Sets highlight locally.
   734      * Sets highlight locally.
   710      * Does not modify the avkon behaviur.
   735      * Does not modify the avkon behaviur.
   711      *
   736      *
   712      * @since S60 v3.0
   737      * @since S60 v3.0
   713      * @param aItemIndex Index of the item.
   738      * @param aItemIndex Index of the item.
   714      */
   739      */
   715 	void SetHighlightL(TInt aItemIndex);
   740   void SetHighlightL(TInt aItemIndex);
   716 
   741 
   717 	/**
   742   /**
   718      * Checks whether given point collides with specific item's re-order area.
   743      * Checks whether given point collides with specific item's re-order area.
   719      *
   744      *
   720      * This function gets called during drag-and-drop operations to
   745      * This function gets called during drag-and-drop operations to
   721      * help determine whether item re-ordering is needed.
   746      * help determine whether item re-ordering is needed.
   722      *
   747      *
   753      */
   778      */
   754     void StartOrStopMarquee();
   779     void StartOrStopMarquee();
   755 
   780 
   756 private:
   781 private:
   757 
   782 
   758 	 /**
   783    /**
   759 	 * Called when the number of items in widget model changed.
   784    * Called when the number of items in widget model changed.
   760 	 * @since S60 v5.0
   785    * @since S60 v5.0
   761 	 *
   786    *
   762 	 * @param aChange Type of change
   787    * @param aChange Type of change
   763 	 */
   788    */
   764 	void HandleNumberOfItemsChangedL( TItemsChangeType aChange );
   789   void HandleNumberOfItemsChangedL( TItemsChangeType aChange );
   765 
   790 
   766     /**
   791     /**
   767      * Manages zooming of folder.
   792      * Manages zooming of folder.
   768      *
   793      *
   769      * @since S60 v3.0
   794      * @since S60 v3.0
   770      * @param aDraggedItemOverIcons Is dragged over icons flag.
   795      * @param aDraggedItemOverIcons Is dragged over icons flag.
   771      */
   796      */
   772 	void ManageFolderZoomingL( TBool aDraggedItemOverIcons );
   797   void ManageFolderZoomingL( TBool aDraggedItemOverIcons );
   773 
   798 
   774     /**
   799     /**
   775      * Cancels gragging of item if relevant( Edit Mode is activated )
   800      * Cancels gragging of item if relevant( Edit Mode is activated )
   776      *
   801      *
   777      * @since S60 v3.0
   802      * @since S60 v3.0
   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      */
   998 
  1023 
   999     /**
  1024     /**
  1000      * Observer to notify about long tap events.
  1025      * Observer to notify about long tap events.
  1001      */
  1026      */
  1002     MMmLongTapObserver* iLongTapObserver;
  1027     MMmLongTapObserver* iLongTapObserver;
  1003     
  1028 
  1004     /**
  1029     /**
  1005      * Stores previously set highlight visibility.
  1030      * Stores previously set highlight visibility.
  1006      * ETrue - hightlight visible, EFalse - highlight disabled.
  1031      * ETrue - hightlight visible, EFalse - highlight disabled.
  1007      * Please note that in most cases it is better to read
  1032      * Please note that in most cases it is better to read
  1008      * ESingleClickDisabledHighlight flag of itemdrawer than rely
  1033      * ESingleClickDisabledHighlight flag of itemdrawer than rely
  1009      * on this member variable to determine if highlight is visible
  1034      * on this member variable to determine if highlight is visible
  1010      * (@c IsHighlightVisible).
  1035      * (@c IsHighlightVisible).
  1011      */
  1036      */
  1012     TBool iPreviousHighlightVisibility;
  1037     TBool iPreviousHighlightVisibility;
  1013 
  1038 
  1014 	};
  1039     /**
       
  1040      * Defines if move item is allowed.
       
  1041      */
       
  1042     TBool iAllowMove;
       
  1043 
       
  1044     /**
       
  1045      * Defines item id to be moved.
       
  1046      */
       
  1047     TInt iRecipientId;
       
  1048 
       
  1049     /**
       
  1050      * Event parameters for move item.
       
  1051      */
       
  1052     CLiwGenericParamList *iEventParameters;
       
  1053 
       
  1054   };
  1015 
  1055 
  1016 #endif // MMMWIDGETCONTAINER_H
  1056 #endif // MMMWIDGETCONTAINER_H