uifw/AvKon/aknhlist/inc/akntreelistview.h
branchRCL_3
changeset 20 d48ab3b357f1
parent 19 aecbbf00d063
equal deleted inserted replaced
19:aecbbf00d063 20:d48ab3b357f1
    38 class TAknWindowComponentLayout;
    38 class TAknWindowComponentLayout;
    39 class CAknsBasicBackgroundControlContext;
    39 class CAknsBasicBackgroundControlContext;
    40 class CEikScrollBarFrame;
    40 class CEikScrollBarFrame;
    41 class CAknTreeListPhysicsHandler;
    41 class CAknTreeListPhysicsHandler;
    42 class CAknItemActionMenu;
    42 class CAknItemActionMenu;
       
    43 class CAknIconArray;
    43 
    44 
    44 /**
    45 /**
    45  *  Hierarchical list view.
    46  *  Hierarchical list view.
    46  *
    47  *
    47  *  The hierarchical list view is responsible of maintaining the set of tree
    48  *  The hierarchical list view is responsible of maintaining the set of tree
    56                                         public MEikScrollBarObserver,
    57                                         public MEikScrollBarObserver,
    57                                         public MAknTreeObserver,
    58                                         public MAknTreeObserver,
    58                                         public MAknsEffectAnimObserver,
    59                                         public MAknsEffectAnimObserver,
    59                                         public MEikCommandObserver,
    60                                         public MEikCommandObserver,
    60                                         public MAknCollection,
    61                                         public MAknCollection,
    61                                         public MAknLongTapDetectorCallBack
    62                                         public MAknLongTapDetectorCallBack,
    62                                         
    63                                         public MAknMarkingCollection
    63     {
    64     {
    64 
    65 
    65 public:
    66 public:
    66 
    67 
    67     /**
    68     /**
   446 TInt& ItemCountLimit();
   447 TInt& ItemCountLimit();
   447 TInt& HighlightIndex();
   448 TInt& HighlightIndex();
   448 TInt& TopIndex();
   449 TInt& TopIndex();
   449 TInt& BottomIndex();
   450 TInt& BottomIndex();
   450 
   451 
   451 void UpdateIndexes();
       
   452 
       
   453 TInt iItemCountLimit;
   452 TInt iItemCountLimit;
   454 TInt iHighlightIndex;
   453 TInt iHighlightIndex;
   455 TInt iTopIndex;
   454 TInt iTopIndex;
   456 TInt iBottomIndex;
       
   457 
   455 
   458 #endif //RD_UI_TRANSITION_EFFECTS_LIST
   456 #endif //RD_UI_TRANSITION_EFFECTS_LIST
   459 
   457 
   460 public:  // new method
   458 public:  // new method
   461     /**
   459     /**
   643      */
   641      */
   644     void LayoutView();
   642     void LayoutView();
   645 
   643 
   646     /**
   644     /**
   647      * Updates scrollbars.
   645      * Updates scrollbars.
   648      */
   646      * 
   649     void UpdateScrollbars();
   647      * @param  aDrawNow  Whether or not to draw the scrollbar.
       
   648      */
       
   649     void UpdateScrollbars( TBool aDrawNow );
   650 
   650 
   651     /**
   651     /**
   652      * Updates the horizontal position of the view so that the beginning of
   652      * Updates the horizontal position of the view so that the beginning of
   653      * the currently focused item can be seen. If the focused item is not in
   653      * the currently focused item can be seen. If the focused item is not in
   654      * the set of visible items, this method has no effect.
   654      * the set of visible items, this method has no effect.
   812      * view object given as parameter.
   812      * view object given as parameter.
   813      */
   813      */
   814     void DoHandleLongPressL();
   814     void DoHandleLongPressL();
   815 
   815 
   816     /**
   816     /**
   817      * Enters marking mode. When in marking mode, the list controls the MSK
   817      * Enters normal marking. When in marking state, the list controls the MSK
   818      * commands depending on whether the currently focused item is marked or
   818      * commands depending on whether the currently focused item is marked or
   819      * unmarked. Marking mode is entered after specified timeout, when user
   819      * unmarked. Marking state is entered after specified timeout, when user
   820      * keeps one of the marking modifier keys pressed.
   820      * keeps one of the marking modifier keys pressed.
   821      *
   821      *
   822      * Notifications of the beginning and ending of marking mode is sent to
   822      * Notifications of the beginning and ending of marking mode is sent to
   823      * list observers, so that they would not update the MSK commands, when
   823      * list observers, so that they would not update the MSK commands, when
   824      * they are handled by the list.
   824      * they are handled by the list.
   825      */
   825      */
   826     void EnterMarkingMode();
   826     void EnterMarking();
   827 
   827 
   828     /**
   828     /**
   829      * Exits marking mode. Marking mode is exited when user releases
   829      * Exits marking state. Marking state is exited when user releases
   830      * all the marking modifier keys. After that, the list no longer
   830      * all the marking modifier keys. After that, the list no longer
   831      * handles the MSK commands.
   831      * handles the MSK commands.
   832      */
   832      */
   833     void ExitMarkingMode();
   833     void ExitMarking();
   834 
   834 
   835     /**
   835     /**
   836      * Updates correct mark/unmark command to MSK depending on the marking
   836      * Updates correct mark/unmark command to MSK depending on the marking
   837      * of current focused item.
   837      * of current focused item.
   838      */
   838      */
   864      *
   864      *
   865      * @param aItem Tree item that should be visible.
   865      * @param aItem Tree item that should be visible.
   866      */
   866      */
   867     void UpdateViewItemAsVisible( CAknTreeItem* aItem );
   867     void UpdateViewItemAsVisible( CAknTreeItem* aItem );
   868 
   868 
       
   869     /**
       
   870      * Updates indexes 
       
   871      */
       
   872 	void UpdateIndexes();
       
   873 	
       
   874 	/**
       
   875 	 * Loads marking mode icons.
       
   876 	 */
       
   877     void LoadMarkingIconsL();
       
   878 	
   869 // from base class CCoeControl
   879 // from base class CCoeControl
   870 
   880 
   871     /**
   881     /**
   872      * From CCoeControl.
   882      * From CCoeControl.
   873      * Draws the tree list view.
   883      * Draws the tree list view.
   887     
   897     
   888     /**
   898     /**
   889      * Enables or disables highlight
   899      * Enables or disables highlight
   890      * 
   900      * 
   891      * @param ETrue to enable highlight, EFalse to disable
   901      * @param ETrue to enable highlight, EFalse to disable
   892      */
   902      * @param aPointerEnabled ETrue if highlight was enabled by pointer event.
   893     void EnableHighlight( TBool aEnabled );
   903      */    
       
   904     void EnableHighlight( TBool aEnabled, TBool aPointerEnabled = EFalse );
   894 
   905 
   895     /**
   906     /**
   896      * Is highlight enabled
   907      * Is highlight enabled
   897      * 
   908      * 
   898      * @return ETrue if highlight is enabled
   909      * @return ETrue if highlight is enabled
   915     /**
   926     /**
   916      * Has list marked items
   927      * Has list marked items
   917      * 
   928      * 
   918      * @return ETrue if list has marked items
   929      * @return ETrue if list has marked items
   919      */    
   930      */    
   920     TBool HasMarkedItemsL();    
   931     TBool HasMarkedItemsL() const;
   921     
   932     
   922 // From MAknCollection
   933 // From MAknCollection
   923     /**
   934     /**
   924      * Returns the collection state. The state is combination of
   935      * Returns the collection state. The state is combination of
   925      * flags defined in MAknCollection::TStateFlag. 
   936      * flags defined in MAknCollection::TStateFlag. 
   941      * @param  a0            First extension method parameter.
   952      * @param  a0            First extension method parameter.
   942      * @param  a1            Second extension method parameter.
   953      * @param  a1            Second extension method parameter.
   943      */    
   954      */    
   944     TInt CollectionExtension( TUint aExtensionId, TAny*& a0, TAny* a1 );    
   955     TInt CollectionExtension( TUint aExtensionId, TAny*& a0, TAny* a1 );    
   945 
   956 
       
   957 // From MAknMarkingCollection
       
   958     /**
       
   959      * Sets multiple marking state.
       
   960      *
       
   961      * @param aActive ETrue if multiple marking should be active.
       
   962      */
       
   963     void SetMultipleMarkingState( TBool aActive );
       
   964 
       
   965     /**
       
   966      * Returns the collection marking state. The state is combination of
       
   967      * flags defined in @c TStateFlag. 
       
   968      *
       
   969      * @return  Collection state.
       
   970      */
       
   971     TUint MarkingState() const;
       
   972 
       
   973     /**
       
   974      * Marks the currently selected item.
       
   975      */
       
   976     void MarkCurrentItemL();
       
   977      
       
   978     /**
       
   979      * Marks all items in the collection.
       
   980      */
       
   981     void MarkAllL(); 
       
   982 
       
   983     /**
       
   984      * Unmarks all items in the collection.
       
   985      */
       
   986     void UnmarkAll();
       
   987     
       
   988     /*
       
   989      * Can current item be marked.
       
   990      */
       
   991     TBool CurrentItemMarkable();    
       
   992 
       
   993     /**
       
   994      * Returns whether the observer accepts ending of marking mode
       
   995      * 
       
   996      * @return ETrue if observer accepts exiting marking mode
       
   997      */
       
   998     TBool ExitMarkingMode();
       
   999 
       
  1000     /**
       
  1001      * Reports collection change event.
       
  1002      */    
       
  1003     void ReportCollectionChangedEvent();   
       
  1004 
       
  1005 
   946 // From MAknLongTapDetectorCallBack
  1006 // From MAknLongTapDetectorCallBack
   947     /**
  1007     /**
   948      * Long tap detector callback 
  1008      * Long tap detector callback 
   949      *
  1009      *
   950      * @param aPenEventLocation Long tap event location relative to parent control.
  1010      * @param aPenEventLocation Long tap event location relative to parent control.
  1050      * Pointer to the list item that was focused before EButton1Down event.
  1110      * Pointer to the list item that was focused before EButton1Down event.
  1051      * Not own.
  1111      * Not own.
  1052      */
  1112      */
  1053     CAknTreeItem* iPreviouslyFocusedItem;
  1113     CAknTreeItem* iPreviouslyFocusedItem;
  1054 
  1114 
  1055     TBool iIsPressedDownState;
       
  1056     
       
  1057     TBool iIsDragged;
       
  1058     
  1115     
  1059     /**
  1116     /**
  1060      * Physics handler. Used only when physics feature is enabled.
  1117      * Physics handler. Used only when physics feature is enabled.
  1061      * Own.
  1118      * Own.
  1062      */
  1119      */
  1063     CAknTreeListPhysicsHandler* iPhysicsHandler;
  1120     CAknTreeListPhysicsHandler* iPhysicsHandler;
  1064 
  1121 
  1065     /**
       
  1066      * ETrue if physics view should be adjusted according to top item.
       
  1067      */
       
  1068     TBool iScrollPhysicsTop;
       
  1069 
  1122 
  1070     /**
  1123     /**
  1071     * Pointer to tfx redirect gc for effects
  1124     * Pointer to tfx redirect gc for effects
  1072     *
  1125     *
  1073     */
  1126     */
  1081     
  1134     
  1082    /**
  1135    /**
  1083     * Long tap detector
  1136     * Long tap detector
  1084     */
  1137     */
  1085     CAknLongTapDetector* iLongTapDetector;
  1138     CAknLongTapDetector* iLongTapDetector;
       
  1139 
       
  1140    /**
       
  1141     * Last visible item index
       
  1142 	*/
       
  1143 	TInt iBottomIndex;
       
  1144 	
       
  1145 	
       
  1146     /**
       
  1147      * Remember pointer to bottom item. Use for drawing line seperator only.
       
  1148      * iBottomIndex is not valid in some case becaue of iItems already changed.
       
  1149      * Not own.
       
  1150      */
       
  1151 	CAknTreeItem* iBottomItem;	
       
  1152 
       
  1153 	
       
  1154 	/**
       
  1155 	 * Array for marking mode icons.
       
  1156 	 * Own.
       
  1157 	 */
       
  1158     CAknIconArray* iMarkingIconArray;
       
  1159     
       
  1160     /**
       
  1161      * Ordinal position of window, before stylus menu is opened.
       
  1162      */
       
  1163     TInt iOldWinPos;
  1086     };
  1164     };
  1087 
  1165 
  1088 
       
  1089 #endif // C_AKNTREELISTVIEW_H
  1166 #endif // C_AKNTREELISTVIEW_H