messagingappbase/mce/inc/MceNaviPaneFolderIndicator.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 
       
    20 #ifndef MCENAVIPANEOLDERINDICATOR_H
       
    21 #define MCENAVIPANEOLDERINDICATOR_H
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include <coecntrl.h>
       
    26 #include <AknUtils.h>
       
    27 #include <msvapi.h>
       
    28 #include "MceBitmapResolver.h"
       
    29 
       
    30 // CONSTANTS
       
    31 const TInt KMceNaviPaneMaxDepth = 5;
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CFbsBitmap;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  This class implements a navipane decorator for displaying folder navigation
       
    40 *  depth indicator
       
    41 *
       
    42 */
       
    43 class CMceNaviPaneFolderIndicator : public CCoeControl
       
    44     {
       
    45     public: // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         */
       
    50         static CMceNaviPaneFolderIndicator* NewL( 
       
    51             TBool aPhoneMemory,
       
    52             const TInt aDepth );
       
    53 
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         */
       
    57         static CMceNaviPaneFolderIndicator* NewLC( 
       
    58             TBool aPhoneMemory,
       
    59             const TInt aDepth );
       
    60 
       
    61         /**
       
    62          *  Destructor.
       
    63          */
       
    64         virtual ~CMceNaviPaneFolderIndicator();
       
    65 
       
    66 
       
    67     public:
       
    68 
       
    69         /**
       
    70         * Specifies how many subfolder icons are displayed.
       
    71         * Depth range is 0..n ( 0 = root, 1 = root+subfolder, etc. )
       
    72         * Depth over 4 is displayed just as tree dots at the end of navipane.       
       
    73         * @param aDepth set current depth
       
    74         */
       
    75         void SetFolderDepth( const TInt aDepth );        
       
    76 
       
    77         /**
       
    78         * Changes the active root        
       
    79         * @param aRoot for the root ( ETrue == phone memory, EFalse == memory card )
       
    80         */
       
    81         void ChangeRootL( TBool aPhoneMemory );
       
    82 
       
    83         /**
       
    84         * From CCoeControl Receives notification on resource changes
       
    85         * @param aType type of the resource change
       
    86         */
       
    87         void HandleResourceChange( TInt aType );
       
    88 
       
    89     protected: // Functions from base classes
       
    90 
       
    91         /**
       
    92         * From CCoeControl Handles the size change events.
       
    93         */
       
    94         void SizeChanged();
       
    95 
       
    96         /**
       
    97         * From CCoeControl Draws a control.
       
    98         * @param aRect The region of the control to be redrawn.
       
    99         */
       
   100         void Draw( const TRect& aRect ) const;
       
   101         
       
   102 
       
   103     private:
       
   104 
       
   105         /**
       
   106         * C++ default constructor.
       
   107         */
       
   108         CMceNaviPaneFolderIndicator( 
       
   109             TBool aPhoneMemory,
       
   110             const TInt aDepth );
       
   111 
       
   112         /**
       
   113         * By default Symbian 2nd phase constructor is private.
       
   114         */
       
   115         void ConstructL();
       
   116 
       
   117         /**
       
   118         * Load folder bitmap
       
   119         */        
       
   120         void LoadFolderBitmapL();
       
   121 
       
   122         /**
       
   123         * Check whether phone is in Landscape mode or not
       
   124         * Since 5.0
       
   125         */ 
       
   126         TBool IsLandscapeScreenOrientation() const;
       
   127 
       
   128     public: 
       
   129         /**
       
   130         * Notifies CCoeControl to redraw the pane        
       
   131         */
       
   132         void ReportChange();
       
   133 
       
   134         
       
   135     private: // Data
       
   136 
       
   137         CFbsBitmap* iFolderBitmap;
       
   138         CFbsBitmap* iFolderMask;        
       
   139         TFileName           iFilename;
       
   140         HBufC* iSeparator;
       
   141         HBufC* iEndChar;
       
   142         TInt                iMaxDepth;
       
   143         CFbsBitmap* iRootBitmap;
       
   144         CFbsBitmap* iRootMask;
       
   145         TBool               iPhoneMemory; // ETrue if msg store on phone memory
       
   146         TFixedArray<TAknLayoutRect, KMceNaviPaneMaxDepth> iBitmapLayout;
       
   147         TFixedArray<TAknLayoutText, KMceNaviPaneMaxDepth + 1> iTextLayout;
       
   148         TInt iDepth;        
       
   149 
       
   150 
       
   151     };
       
   152 
       
   153 #endif // MCENAVIPANEOLDERINDICATOR_H
       
   154 
       
   155 // End of File