akntreelist.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : akntreelist.h
00004 *  Part of     : UI Framework Core / Avkon
00005 *  Description : Abstract base class for hierarchical lists.
00006 *  Version     : %version: 7 %
00007 *
00008 *  Copyright © 2006, 2007 Nokia.  All rights reserved.
00009 *  This material, including documentation and any related computer
00010 *  programs, is protected by copyright controlled by Nokia.  All
00011 *  rights are reserved.  Copying, including reproducing, storing,
00012 *  adapting or translating, any or all of this material requires the
00013 *  prior written consent of Nokia.  This material also contains
00014 *  confidential information which may not be disclosed to others
00015 *  without the prior written consent of Nokia.
00016 * ============================================================================
00017 * Template version: 4.1
00018 */
00019 
00020 #ifndef C_AKNTREELIST_H
00021 #define C_AKNTREELIST_H
00022 
00023 
00024 #include <akncontrol.h>
00025 #include <w32std.h>
00026 #include <akntreelistobserver.h>
00027 #include <akniconutils.h> // TScaleMode
00028 
00029 class CAknTree;
00030 class CAknTreeListView;
00031 class MAknCustomTreeOrdering;
00032 class TAknsItemID;
00033 
00035 const TUint32 KAknTreeListLooping = 0x0001;
00036 
00038 const TUint32 KAknTreeListNoStructureLines = 0x0002;
00039 
00041 const TUint32 KAknTreeListMarqueeScrolling = 0x0004;
00042 
00045 const TUint32 KAknTreeListNoIndention = 0x0008;
00046 
00051 const TUint32 KAknTreeListMarkable = 0x0010;
00052 
00053 
00096 NONSHARABLE_CLASS( CAknTreeList ) : public CAknControl
00097     {
00098 
00099 public:
00100 
00101 
00102         // for focus handling after Sort
00103    enum TFocusBehaviour
00104             {
00105             ESaveFocus,
00106             EMoveFocusToFirstItem
00107             };
00108 
00112     virtual ~CAknTreeList();
00113 
00128     IMPORT_C virtual void SetFlags( TUint32 aFlags );
00129 
00135     IMPORT_C TUint32 Flags() const;
00136 
00171     IMPORT_C void MoveItemL( TAknTreeItemID aItem, TAknTreeItemID aTargetNode,
00172         TBool aDrawNow );
00173 
00194     IMPORT_C void RemoveItem( TAknTreeItemID aItem, TBool aDrawNow );
00195 
00219     IMPORT_C void ExpandNode( TAknTreeItemID aNode, TBool aDrawNow );
00220 
00244     IMPORT_C void CollapseNode( TAknTreeItemID aNode, TBool aDrawNow );
00245 
00257     IMPORT_C TBool IsExpanded( TAknTreeItemID aNode ) const;
00258 
00265     IMPORT_C TAknTreeItemID FocusedItem() const;
00266 
00287     IMPORT_C void SetFocusedItem( TAknTreeItemID aItem, TInt aIndex,
00288         TBool aDrawNow );
00289 
00298     IMPORT_C TRect HighlightRect() const;
00299 
00328     IMPORT_C TInt AddIconL( const TAknsItemID& aId, const TDesC& aFilename,
00329         TInt aBitmapId, TInt aMaskId, TScaleMode aScaleMode );
00330 
00352     IMPORT_C TInt AddIconL( CFbsBitmap* aIcon, CFbsBitmap* aMask,
00353         TBool aTransferOwnership, TScaleMode aScaleMode );
00354 
00388     IMPORT_C TInt AddColorIconL( const TAknsItemID& aId,
00389         const TAknsItemID& aColorId, TInt aColorIndex, const TDesC& aFilename,
00390         TInt aBitmapId, TInt aMaskId, TRgb aDefaultColor,
00391         TScaleMode aScaleMode );
00392 
00421     IMPORT_C void AssignIconL( TInt aIconId, const TAknsItemID& aId,
00422         const TDesC& aFilename, TInt aBitmapId, TInt aMaskId,
00423         TScaleMode aScaleMode );
00424 
00450     IMPORT_C void AssignIconL( TInt aIconId, CFbsBitmap* aIcon,
00451         CFbsBitmap* aMask, TBool aTransferOwnership, TScaleMode aScaleMode );
00452 
00488     IMPORT_C void AssignColorIconL( TInt aIconId, const TAknsItemID& aId,
00489         const TAknsItemID& aColorId, TInt aColorIndex, const TDesC& aFilename,
00490         TInt aBitmapId, TInt aMaskId, TRgb aDefaultColor,
00491         TScaleMode aScaleMode );
00492 
00503     IMPORT_C void RemoveIconL( TInt aIconId );
00504 
00519     IMPORT_C TInt ChildCount( TAknTreeItemID aNode ) const;
00520 
00537     IMPORT_C TAknTreeItemID Child( TAknTreeItemID aNode, TInt aIndex ) const;
00538 
00551     IMPORT_C TAknTreeItemID Parent( TAknTreeItemID aItem ) const;
00552 
00562     IMPORT_C TBool Contains( TAknTreeItemID aItem ) const;
00563 
00573     IMPORT_C TBool IsNode( TAknTreeItemID aItem ) const;
00574 
00584     IMPORT_C TBool IsLeaf( TAknTreeItemID aItem ) const;
00585 
00595     IMPORT_C TBool IsMarked( TAknTreeItemID aItem ) const;
00596 
00614     IMPORT_C void SetMarked( TAknTreeItemID aItem, TBool aMarked,
00615         TBool aDrawNow );
00616 
00635     IMPORT_C void EnableMarking( TAknTreeItemID aItem, TBool aEnable );
00636 
00645     IMPORT_C void GetMarkedItemsL( RArray<TAknTreeItemID>& aMarkedItems ) const;
00646 
00663     IMPORT_C void GetMarkedItemsL( TAknTreeItemID aNode,
00664         RArray<TAknTreeItemID>& aMarkedItems ) const;
00665 
00682     IMPORT_C TBool IsEmpty( TAknTreeItemID aNode ) const;
00683 
00698     IMPORT_C void SetNonEmpty( TAknTreeItemID aNode, TBool aNonEmpty,
00699         TBool aDrawNow );
00700 
00714     IMPORT_C TBool IsPersistent( TAknTreeItemID aItem ) const;
00715 
00726     IMPORT_C void SetPersistent( TAknTreeItemID aItem,
00727         TBool aPersistent );
00728 
00748     IMPORT_C void Sort( MAknCustomTreeOrdering* aOrdering, TBool aDrawNow );
00749 
00770     IMPORT_C void Sort( TAknTreeItemID aNode, TBool aSortDescendants,
00771         TBool aDrawNow );
00772 
00787     IMPORT_C void AddObserverL( MAknTreeListObserver* aObserver );
00788 
00794     IMPORT_C void RemoveObserver( MAknTreeListObserver* aObserver );
00795 
00804     void NotifyObservers( MAknTreeListObserver::TEvent aEvent,
00805         TAknTreeItemID aItem );
00806 
00812     IMPORT_C TBool TabModeFunctionIndicators() const;
00813 
00825     IMPORT_C void EnableTabModeFunctionIndicatorsL( TBool aEnable );
00826     
00827 
00850         IMPORT_C void SetFocusedItem( TAknTreeItemID aItem );
00851                 
00859         IMPORT_C TInt FocusedItemIndex() const;
00860         
00868         IMPORT_C TInt VisibleItemIndex( TAknTreeItemID aItem ) const;
00869 
00870         
00885         IMPORT_C void Sort( MAknCustomTreeOrdering* aOrdering, TFocusBehaviour aFocusBehaviour, TBool aDrawNow );
00886 
00912         IMPORT_C void Sort( TAknTreeItemID aNode, TFocusBehaviour aFocusBehaviour, TBool aSortDescendants, TBool aDrawNow );
00913         
00920         IMPORT_C void SetEmptyTextL(const TDesC& aText);
00921 
00922 
00923 // From base class CCoeControl
00924 
00935     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
00936 
00944     void MakeVisible( TBool aVisible );
00945 
00952     void SetDimmed( TBool aDimmed );
00953 
00961     void SetContainerWindowL( const CCoeControl& aContainer );
00962 
00967     void ActivateL();
00968 
00975     void HandleResourceChange( TInt aType );
00976 
00983     TCoeInputCapabilities InputCapabilities() const;
00984 
00991     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00992 
00999     TInt CountComponentControls() const;
01000 
01009     CCoeControl* ComponentControl( TInt aIndex ) const;
01010 
01011 protected:
01012 
01016     CAknTreeList();
01017 
01023     void BaseConstructL();
01024 
01030     void BaseConstructL( const CCoeControl& aContainer );
01031 
01037     CAknTree& Tree();
01038 
01044     const CAknTree& Tree() const;
01045 
01051     CAknTreeListView& View();
01052 
01058     const CAknTreeListView& View() const;
01059 
01060 // from base class CCoeControl
01061 
01068     void FocusChanged( TDrawNow aDrawNow );
01069 
01074     void SizeChanged();
01075 
01080     void PositionChanged();
01081 
01091     TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
01092 
01093 private:
01094 
01095 // from base class CCoeControl
01096     
01103     void Draw( const TRect& aRect ) const;
01104 
01105 private: // data
01106 
01110     TUint32 iFlags;
01111 
01116     CAknTree* iTree;
01117 
01122     CAknTreeListView* iView;
01123 
01128     RPointerArray<MAknTreeListObserver> iObservers;
01129 
01133     TInt iIndex;
01134 
01135     };
01136 
01137 
01138 #endif // C_AKNTREELIST_H

Copyright © Nokia Corporation 2001-2007
Back to top