email/imum/Utils/Src/ImumNaviPaneFolderIndicator.h
changeset 79 2981cb3aa489
parent 0 72b543305e3a
equal deleted inserted replaced
25:84d9eb65b26f 79:2981cb3aa489
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Folder navigation depth decorator for navipane
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IMUMNAVIPANEOLDERINDICATOR_H
       
    20 #define IMUMNAVIPANEOLDERINDICATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <coecntrl.h>
       
    25 #include <AknUtils.h>
       
    26 //#include <MSVAPI.H>
       
    27 
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KImumNaviPaneMaxDepth = 5;
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CFbsBitmap;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  This class implements a navipane decorator for displaying folder navigation
       
    39 *  depth indicator
       
    40 *
       
    41 */
       
    42 NONSHARABLE_CLASS( CImumNaviPaneFolderIndicator ) : public CCoeControl
       
    43     {
       
    44     public: // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49         static CImumNaviPaneFolderIndicator* NewL(
       
    50             TBool aPhoneMemory,
       
    51             const TInt aDepth );
       
    52 
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static CImumNaviPaneFolderIndicator* NewLC(
       
    57             TBool aPhoneMemory,
       
    58             const TInt aDepth );
       
    59 
       
    60         /**
       
    61          *  Destructor.
       
    62          */
       
    63         virtual ~CImumNaviPaneFolderIndicator();
       
    64 
       
    65 
       
    66     public:
       
    67 
       
    68         /**
       
    69         * Specifies how many subfolder icons are displayed.
       
    70         * Depth range is 0..n ( 0 = root, 1 = root+subfolder, etc. )
       
    71         * Depth over 4 is displayed just as tree dots at the end of navipane.
       
    72         * @param aDepth set current depth
       
    73         */
       
    74         void SetFolderDepth( const TInt aDepth );
       
    75 
       
    76         /**
       
    77         * Changes the active root
       
    78         * @param aRoot for the root ( ETrue == phone memory, EFalse == memory card )
       
    79         */
       
    80         void ChangeRootL( TBool aPhoneMemory );
       
    81 
       
    82         /**
       
    83         * From CCoeControl Receives notification on resource changes
       
    84         * @param aType type of the resource change
       
    85         */
       
    86         void HandleResourceChange( TInt aType );
       
    87 
       
    88     protected: // Functions from base classes
       
    89 
       
    90         /**
       
    91         * From CCoeControl Handles the size change events.
       
    92         */
       
    93         void SizeChanged();
       
    94 
       
    95         /**
       
    96         * From CCoeControl Draws a control.
       
    97         * @param aRect The region of the control to be redrawn.
       
    98         */
       
    99         void Draw( const TRect& aRect ) const;
       
   100 
       
   101 
       
   102     private:
       
   103 
       
   104         /**
       
   105         * C++ default constructor.
       
   106         */
       
   107         CImumNaviPaneFolderIndicator(
       
   108             TBool aPhoneMemory,
       
   109             const TInt aDepth );
       
   110 
       
   111         /**
       
   112         * By default Symbian 2nd phase constructor is private.
       
   113         */
       
   114         void ConstructL();
       
   115 
       
   116         /**
       
   117         * Load folder bitmap
       
   118         */
       
   119         void LoadFolderBitmapL();
       
   120 
       
   121     public:
       
   122         /**
       
   123         * Notifies CCoeControl to redraw the pane
       
   124         */
       
   125         void ReportChange();
       
   126 
       
   127 
       
   128     private: // Data
       
   129 
       
   130         CFbsBitmap* iFolderBitmap;
       
   131         CFbsBitmap* iFolderMask;
       
   132         TFileName           iFilename;
       
   133         HBufC* iSeparator;
       
   134         HBufC* iEndChar;
       
   135         TInt                iMaxDepth;
       
   136         CFbsBitmap* iRootBitmap;
       
   137         CFbsBitmap* iRootMask;
       
   138         TBool               iPhoneMemory; // ETrue if msg store on phone memory
       
   139         TFixedArray<TAknLayoutRect, KImumNaviPaneMaxDepth> iBitmapLayout;
       
   140         TFixedArray<TAknLayoutText, KImumNaviPaneMaxDepth + 1> iTextLayout;
       
   141         TInt iDepth;
       
   142 
       
   143     };
       
   144 
       
   145 #endif // IMUMNAVIPANEOLDERINDICATOR_H
       
   146 
       
   147 // End of File