menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h
branchRCL_3
changeset 26 1b758917cafc
parent 23 7be2816dbabd
equal deleted inserted replaced
25:137ebc85284b 26:1b758917cafc
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *  Version     : %version: MM_48.1.40 % << Don't touch! Updated by Synergy at check-out.
    15 *  Version     : %version: MM_48.1.43 % << Don't touch! Updated by Synergy at check-out.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #ifndef MMMWIDGETCONTAINER_H
    20 #ifndef MMMWIDGETCONTAINER_H
    70      * Initializes member variables with sensible values.
    70      * Initializes member variables with sensible values.
    71      */
    71      */
    72     TMmWidgetPosition();
    72     TMmWidgetPosition();
    73 
    73 
    74 public: // data
    74 public: // data
    75   /**
    75     /**
    76    * The vertical item offset cache.
    76      * The vertical item offset cache.
    77    */
    77      */
    78   TInt iVerticalItemOffset;
    78     TInt iVerticalItemOffset;
    79 
    79 
    80   /**
    80     /**
    81    * The top item index cache.
    81      * The top item index cache.
    82    */
    82      */
    83   TInt iTopItemIndex;
    83     TInt iTopItemIndex;
    84 
    84 
    85   /**
    85     /**
    86    * Tells if the cached values are valid.
    86      * Tells if the cached values are valid.
    87    */
    87      */
    88   TBool iValid;
    88     TBool iValid;
    89 
    89 
    90   /**
    90     /**
    91    * The mode (portrait/landscape) for which the cache is valid.
    91      * The mode (portrait/landscape) for which the cache is valid.
    92    */
    92      */
    93   TBool iLandscape;
    93     TBool iLandscape;
    94 
    94 
    95   /**
    95     /**
    96    * Id from model (not index) of the currently highlighted item.
    96      * Id from model (not index) of the currently highlighted item.
    97    * It should only be set if the currently highlighted item is
    97      * It should only be set if the currently highlighted item is
    98    * visible (fully or partially), otherwise it must remain
    98      * visible (fully or partially), otherwise it must remain
    99    * initialized to KErrNotFound.
    99      * initialized to KErrNotFound.
   100    */
   100      */
   101   TInt iHighlightedItemId;
   101     TInt iHighlightedItemId;
   102   };
   102     };
   103 
   103 
   104 /**
   104 /**
   105  *  Interface for widget containers.
   105  *  Interface for widget containers.
   106  *
   106  *
   107  *  @code
   107  *  @code
   141      IMPORT_C static CMmWidgetContainer* NewListBoxContainerL( const TRect& aRect,
   141      IMPORT_C static CMmWidgetContainer* NewListBoxContainerL( const TRect& aRect,
   142             MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary );
   142             MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary );
   143 
   143 
   144 public: // Highlight related methods
   144 public: // Highlight related methods
   145 
   145 
   146   /**
   146     /**
   147    * Sets the default highlight.
   147      * Sets the default highlight.
   148    *
   148      *
   149      * @since S60 v3.0
   149      * @since S60 v3.0
   150      * @param aRedraw Is highlight to redraw.
   150      * @param aRedraw Is highlight to redraw.
   151      */
   151     */
   152   virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0;
   152     virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0;
   153 
   153 
   154     /**
   154     /**
   155      * Sets the highlight.
   155      * Sets the highlight.
   156      *
   156      *
   157      * @since S60 v3.0
   157      * @since S60 v3.0
   158      * @param aItemIndex Index to set the highlight at.
   158      * @param aItemIndex Index to set the highlight at.
   159      * @param aRedraw Is highlight to redraw.
   159      * @param aRedraw Is highlight to redraw.
   160      */
   160      */
   161   IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex,  TBool aRedraw = ETrue );
   161     IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex,  TBool aRedraw = ETrue );
   162 
   162 
   163     /**
   163     /**
   164      * Gets the highlight from the widget.
   164      * Gets the highlight from the widget.
   165      *
   165      *
   166      * @since S60 v3.0
   166      * @since S60 v3.0
   167      * @return Current Highlight in the widget.
   167      * @return Current Highlight in the widget.
   168      */
   168      */
   169   IMPORT_C virtual TInt GetHighlight();
   169     IMPORT_C virtual TInt GetHighlight();
   170 
   170 
   171     /**
   171     /**
   172      * Gets the highlight from the widget.
   172      * Gets the highlight from the widget.
   173      *
   173      *
   174      * @since S60 v3.0
   174      * @since S60 v3.0
   175      * @return Previous Highlight in the widget.
   175      * @return Previous Highlight in the widget.
   176      */
   176      */
   177   IMPORT_C virtual TInt GetPreviousHighlight();
   177     IMPORT_C virtual TInt GetPreviousHighlight();
   178 
   178 
   179     /**
   179     /**
   180      * Set highlight visibility.
   180      * Set highlight visibility.
   181      *
   181      *
   182      * @since S60 v3.0
   182      * @since S60 v3.0
   183      * @param aVisible Visibility status.
   183      * @param aVisible Visibility status.
   184      */
   184      */
   185   IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible );
   185     IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible );
   186 
   186 
   187     /**
   187     /**
   188      * Set highlight visibility.
   188      * Set highlight visibility.
   189      *
   189      *
   190      * @since S60 v3.0
   190      * @since S60 v3.0
   191      * @return Visibility status.
   191      * @return Visibility status.
   192      */
   192      */
   193   IMPORT_C virtual TBool IsHighlightVisible();
   193     IMPORT_C virtual TBool IsHighlightVisible();
   194 
   194 
   195     /**
   195     /**
   196      * Handle item addition.
   196      * Handle item addition.
   197      *
   197      *
   198      * @since S60 v3.0
   198      * @since S60 v3.0
   199      */
   199      */
   200   IMPORT_C virtual void HandleItemAdditionL();
   200     IMPORT_C virtual void HandleItemAdditionL();
   201 
   201 
   202 
   202 
   203     /**
   203     /**
   204      * Handle item removal.
   204      * Handle item removal.
   205      *
   205      *
   206      * @since S60 v3.0
   206      * @since S60 v3.0
   207      */
   207      */
   208   IMPORT_C virtual void HandleItemRemovalL();
   208     IMPORT_C virtual void HandleItemRemovalL();
   209 
   209 
   210     /**
   210     /**
   211      * Handle item removal.
   211      * Handle item removal.
   212      *
   212      *
   213      * @since S60 v3.0
   213      * @since S60 v3.0
   214      */
   214      */
   215   IMPORT_C CHnSuiteModel* GetSuiteModelL();
   215     IMPORT_C CHnSuiteModel* GetSuiteModelL();
   216 
   216 
   217     /**
   217     /**
   218      * Retrieve type of widget.
   218      * Retrieve type of widget.
   219      *
   219      *
   220      * @since S60 v3.0
   220      * @since S60 v3.0
   221      * @return Type of widget.
   221      * @return Type of widget.
   222      */
   222      */
   223   IMPORT_C virtual THnSuiteWidgetType WidgetType();
   223     IMPORT_C virtual THnSuiteWidgetType WidgetType();
   224 
   224 
   225   /**
   225     /**
   226    * Removes all LIW objects owned by this object.
   226      * Removes all LIW objects owned by this object.
   227      *
   227      *
   228      * LIW objects owned by non-LIW objects that are owned by
   228      * LIW objects owned by non-LIW objects that are owned by
   229      * this object are also removed.
   229      * this object are also removed.
   230    */
   230     */
   231   virtual void RemoveLiwObjects();
   231     virtual void RemoveLiwObjects();
   232 
   232 
   233   /**
   233     /**
   234    * Sets the long tap observer.
   234      * Sets the long tap observer.
   235      *
   235      *
   236      * @param aObserver Observer to receive long tap events.
   236      * @param aObserver Observer to receive long tap events.
   237    */
   237      */
   238   IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver );
   238     IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver );
   239 
   239 
   240   /**
   240     /**
   241    * 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
   242    * a command from the context menu has been issued).
   242      * a command from the context menu has been issued).
   243    *
   243      *
   244    * @param aStopTimer ETrue when the highlight timer should be stopped.
   244      * @param aStopTimer ETrue when the highlight timer should be stopped.
   245    */
   245      */
   246   IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue );
   246     IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue );
   247 
   247 
   248 public:
   248 public:
   249 
   249 
   250   /**
   250     /**
   251    * Sets suite model.
   251      * Sets suite model.
   252    *
   252      *
   253    * @since S60 v3.0
   253      * @since S60 v3.0
   254    * @param aModel Suite model.
   254      * @param aModel Suite model.
   255    */
   255      */
   256   virtual void SetSuiteModelL( CHnSuiteModel* aModel );
   256     virtual void SetSuiteModelL( CHnSuiteModel* aModel );
   257 
   257 
   258     /**
   258     /**
   259      * Gets Multimedia Menu model.
   259      * Gets Multimedia Menu model.
   260      *
   260      *
   261      * @since S60 v3.0
   261      * @since S60 v3.0
   262      * @return Model.
   262      * @return Model.
   263      */
   263      */
   264   virtual CMmListBoxModel* GetMmModel() = 0;
   264     virtual CMmListBoxModel* GetMmModel() = 0;
   265 
   265 
   266     /**
   266     /**
   267      * Sets widget observer.
   267      * Sets widget observer.
   268      *
   268      *
   269      * @since S60 v3.0
   269      * @since S60 v3.0
   270      * @param aObserver Widget observer.
   270      * @param aObserver Widget observer.
   271      */
   271      */
   272   IMPORT_C virtual void SetObserver( MMmWidgetObserver*  aObserver);
   272     IMPORT_C virtual void SetObserver( MMmWidgetObserver*  aObserver);
   273 
   273 
   274     /**
   274     /**
   275      * Gets item rectangle according to item index.
   275      * Gets item rectangle according to item index.
   276      *
   276      *
   277      * @since S60 v3.0
   277      * @since S60 v3.0
   278      * @param aItemIndex Item index.
   278      * @param aItemIndex Item index.
   279      * @return Item rectangle.
   279      * @return Item rectangle.
   280      */
   280      */
   281   IMPORT_C TRect GetItemRectL( TInt aItemIndex );
   281     IMPORT_C TRect GetItemRectL( TInt aItemIndex );
   282 
   282 
   283     /**
   283     /**
   284      * Sets empty text visible when model has no items.
   284      * Sets empty text visible when model has no items.
   285      *
   285      *
   286      * @since S60 v3.0
   286      * @since S60 v3.0
   287      * @param aText Text to be shown when view is empty.
   287      * @param aText Text to be shown when view is empty.
   288      */
   288      */
   289   virtual void SetEmptyTextL(const TDesC& aText) = 0 ;
   289     virtual void SetEmptyTextL(const TDesC& aText) = 0 ;
   290 
   290 
   291     /**
   291     /**
   292      * Sets flag.
   292      * Sets flag.
   293      *
   293      *
   294      * @since S60 v3.0
   294      * @since S60 v3.0
   295      * @param Flag Flag.
   295      * @param Flag Flag.
   296      */
   296      */
   297   virtual void SetFlag(TInt Flag);
   297     virtual void SetFlag(TInt Flag);
   298 
   298 
   299     /**
   299     /**
   300      * Gets widget.
   300      * Gets widget.
   301      *
   301      *
   302      * @since S60 v3.0
   302      * @since S60 v3.0
   303      * @return Widget.
   303      * @return Widget.
   304      */
   304      */
   305   virtual CEikListBox* Widget();
   305     virtual CEikListBox* Widget();
   306 
   306 
   307     /**
   307     /**
   308      * Sets background context for item drawer and view.
   308      * Sets background context for item drawer and view.
   309      *
   309      *
   310      * @since S60 v3.0
   310      * @since S60 v3.0
   311      * @param aBgContext Background context.
   311      * @param aBgContext Background context.
   312      */
   312      */
   313   virtual void SetItemDrawerAndViewBgContext(
   313     virtual void SetItemDrawerAndViewBgContext(
   314       CAknsBasicBackgroundControlContext * aBgContext ) =0;
   314       CAknsBasicBackgroundControlContext * aBgContext ) =0;
   315 
   315 
   316     /**
   316     /**
   317      * Sets edit mode so UI is aware.
   317      * Sets edit mode so UI is aware.
   318      *
   318      *
   691     /**
   691     /**
   692      * Sets if extention dialog is opened.
   692      * Sets if extention dialog is opened.
   693      */
   693      */
   694     IMPORT_C void SetExDialogOpened( TBool aOpened );
   694     IMPORT_C void SetExDialogOpened( TBool aOpened );
   695 
   695 
       
   696     /**
       
   697      * Widget position cache.
       
   698      */
       
   699     TMmWidgetPosition WidgetPositionCache() const;
       
   700 
   696 public: // from MMmVisibilityObserver
   701 public: // from MMmVisibilityObserver
   697 
   702 
   698     /**
   703     /**
   699      *
   704      *
   700      * @since S60 v3.0
   705      * @since S60 v3.0
   845      * @returns True, if given item is a folder or root folder, false otherwise.
   850      * @returns True, if given item is a folder or root folder, false otherwise.
   846      */
   851      */
   847     TBool IsFolderL( TInt aItemIndex );
   852     TBool IsFolderL( TInt aItemIndex );
   848 
   853 
   849     /**
   854     /**
   850    * Checks, whether given item has IsDeleteLockedL flag set.
   855      * Checks, whether given item has IsDeleteLockedL flag set.
   851    * @param aItemIndex Item index to check.
   856      * @param aItemIndex Item index to check.
   852    * @returns IsDeleteLockedL flag
   857      * @returns IsDeleteLockedL flag
   853    */
   858      */
   854   TBool IsDeleteLockedL( TInt aItemIndex );
   859     TBool IsDeleteLocked( TInt aItemIndex );
   855 
   860 
   856   /**
   861   /**
   857    * Gets column count in current view.
   862    * Gets column count in current view.
   858    * @returns Column count in current view.
   863    * @returns Column count in current view.
   859    */
   864    */
   883   void SetupScrollingEffectsL( TBool aDown );
   888   void SetupScrollingEffectsL( TBool aDown );
   884 
   889 
   885 protected:
   890 protected:
   886 
   891 
   887 
   892 
   888   /**
   893     /**
   889    * Own.
   894      * Own.
   890    */
   895      */
   891   CEikListBox* iWidget;
   896     CEikListBox* iWidget;
   892 
   897 
   893     /**
   898     /**
   894      * Key event observer.
   899      * Key event observer.
   895      */
   900      */
   896   MMmKeyEventObserver* iKeyEventObserver;
   901     MMmKeyEventObserver* iKeyEventObserver;
   897 
   902 
   898     /**
   903     /**
   899      * Drag and drop observer.
   904      * Drag and drop observer.
   900      */
   905      */
   901      MMmDragAndDropObserver* iDragAndDropObserver;
   906     MMmDragAndDropObserver* iDragAndDropObserver;
   902      /**
   907      /**
   903       * List box observer.
   908       * List box observer.
   904       */
   909       */
   905      MEikListBoxObserver* iListBoxObserver;
   910     MEikListBoxObserver* iListBoxObserver;
   906 
   911 
   907     /**
   912     /**
   908      * Marquee adapter.
   913      * Marquee adapter.
   909      * Own.
   914      * Own.
   910      */
   915      */
   916      */
   921      */
   917     CMmListBoxItemDrawer* iDrawer;
   922     CMmListBoxItemDrawer* iDrawer;
   918 
   923 
   919 protected:
   924 protected:
   920 
   925 
   921   /**
   926     /**
   922    * Current Highlight.
   927      * Current Highlight.
   923    */
   928      */
   924   TInt iCurrentHighlight;
   929     TInt iCurrentHighlight;
       
   930 
       
   931     /**
       
   932      * Processed display elelments for better performance.
       
   933      */
       
   934     CMmPostEvaluationProcessor* iPostProcessor;
       
   935 
       
   936     /**
       
   937      * Set when long tap is in progress (stylus popup displayed over container)
       
   938      */
       
   939     TBool iLongTapInProgress;
       
   940 
       
   941 private:
   925 
   942 
   926     /**
   943     /**
   927      * Has drag occurred.
   944      * Has drag occurred.
   928      */
   945      */
   929     TBool iDragOccured;
   946     TBool iDragOccured;
   930 
       
   931   /**
       
   932    * Processed display elelments for better performance.
       
   933    */
       
   934     CMmPostEvaluationProcessor* iPostProcessor;
       
   935 
       
   936   /**
       
   937    * Set when long tap is in progress (stylus popup displayed over container)
       
   938    */
       
   939     TBool iLongTapInProgress;
       
   940 
       
   941 private:
       
   942 
       
   943 
   947 
   944     /**
   948     /**
   945      * Background context.
   949      * Background context.
   946      * Own.
   950      * Own.
   947      */
   951      */
   968   TInt iLastDragHighlight;
   972   TInt iLastDragHighlight;
   969 
   973 
   970     /**
   974     /**
   971      * Dragged item index.
   975      * Dragged item index.
   972      */
   976      */
   973   TBool iDraggedIndex;
   977     TInt iDraggedIndex;
   974 
   978 
   975     /**
   979     /**
   976      * Edit mode status.
   980      * Edit mode status.
   977      */
   981      */
   978   TBool iIsEditMode;
   982   TBool iIsEditMode;