filemanager/App/inc/CFileManagerFoldersView.h
changeset 0 6a9f87576119
child 8 1772663c5b4e
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  View for folder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFILEMANAGERFOLDERSVIEW_H
       
    21 #define CFILEMANAGERFOLDERSVIEW_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CFileManagerViewBase.h"
       
    25 #include <MFileManagerFolderNaviObserver.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CAknNavigationControlContainer;
       
    29 class CAknNavigationDecorator;
       
    30 class CFileManagerFolderNavigationPane;
       
    31 class CAknInfoPopupNoteController;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35  * Folders view of the application.
       
    36  */
       
    37 class CFileManagerFoldersView : public CFileManagerViewBase,
       
    38                                 public MFileManagerFolderNaviObserver
       
    39     {
       
    40     public: // Custom Message IDs
       
    41         /// custom message for opening from results view
       
    42         static const TUid KOpenFromSearchResultsView;
       
    43 
       
    44         // For custom message use
       
    45         enum TMessage
       
    46             {
       
    47             EOpenFromSearchResultsView = 1
       
    48             };
       
    49 
       
    50     public:  // Constructors and destructor
       
    51         /**
       
    52          * Two-phased constructor. Leaves created view
       
    53          * to cleanup stack.
       
    54          *
       
    55          * @return Newly constructed view 
       
    56          */
       
    57         static CFileManagerFoldersView* NewLC();
       
    58         
       
    59         /**
       
    60          * Destructor.
       
    61          */
       
    62         ~CFileManagerFoldersView();
       
    63 
       
    64     public: // New declarations
       
    65 
       
    66         /**
       
    67          * Forwards Resource change events to view
       
    68          * @since 2.0
       
    69          * @param aType type of change
       
    70          */
       
    71         void HandleResourceChangeL( TInt aType );
       
    72 
       
    73         /**
       
    74          * Forwards DirectoryChange information to active view
       
    75          * @since 2.0
       
    76          */
       
    77         void DirectoryChangedL();
       
    78 
       
    79     private: // From CAknView
       
    80         /**
       
    81          * @see CAknView
       
    82          */
       
    83         TUid Id() const;
       
    84 
       
    85         /**
       
    86          * @see CAknView
       
    87          */
       
    88         void HandleCommandL( TInt aCommand );
       
    89 
       
    90         /**
       
    91          * @see CAknView
       
    92          */
       
    93         TKeyResponse OfferKeyEventL(
       
    94             const TKeyEvent& aKeyEvent, TEventCode aType );
       
    95 
       
    96         /**
       
    97          * @see CAknView
       
    98          */
       
    99         void DoActivateL(
       
   100             const TVwsViewId& aPrevViewId,
       
   101             TUid aCustomMessageId,
       
   102             const TDesC8& aCustomMessage);
       
   103 
       
   104         /**
       
   105          * @see CAknView
       
   106          */
       
   107         void DoDeactivate();
       
   108 
       
   109     private: // From CFileManagerViewBase
       
   110         /**
       
   111          * @see CFileManagerViewBase
       
   112          */
       
   113         CFileManagerContainerBase* CreateContainerL();
       
   114 
       
   115         /**
       
   116          * @see CFileManagerViewBase
       
   117          */
       
   118         void UpdateCbaL();
       
   119 
       
   120     private: // From MFileManagerFolderNaviObserver
       
   121         /**
       
   122          * @see MFileManagerFolderNaviObserver
       
   123          */
       
   124         void HandleFolderNaviEventL( TNaviEvent aEvent, TInt aValue );
       
   125 
       
   126     private: 
       
   127         /**
       
   128          * Refreshes title to contain name of the 
       
   129          * current folder.
       
   130          */
       
   131         void RefreshTitleL();
       
   132 
       
   133         /**
       
   134          * Standard C++ constructor.
       
   135          */
       
   136         CFileManagerFoldersView();
       
   137 
       
   138         /**
       
   139          * 2nd phase constructor.
       
   140          */
       
   141         void ConstructL();
       
   142 
       
   143         /**
       
   144          * Handles backstepping from the current folder.
       
   145          * @since 3.1
       
   146          * @param aBacksteps Number of backsteps to do
       
   147          */
       
   148         void BackstepL( TInt aBacksteps = 1 );
       
   149 
       
   150         /**
       
   151          * Gets folder name from specified folder level
       
   152          * @since 3.1
       
   153          * @param aFolderLevel Folder level
       
   154          * @return Folder name
       
   155          */
       
   156         TPtrC FolderName( const TInt aFolderLevel );
       
   157 
       
   158     private:    // Data
       
   159         /// Ref: Navi pane of the view
       
   160         CAknNavigationControlContainer* iNaviPane;
       
   161         /// Own: Navigation decorator for navi pane
       
   162         CAknNavigationDecorator* iNaviDecorator;
       
   163         /*
       
   164          * Ref: Navi control that draws folders in the navi pane. 
       
   165          * Ownership is given to navi pane after creation.
       
   166          */
       
   167         CFileManagerFolderNavigationPane* iNaviControl;
       
   168 
       
   169         // Current depth, with this folder view knows when 
       
   170         // user has gone up or down in folder tree
       
   171         TInt iFolderDepth;
       
   172 
       
   173         // Own: Initial folder depth.
       
   174         // View is closed after stepped back below this level.
       
   175         TInt iInitialFolderDepth;
       
   176 
       
   177         // Own: For showing info popups
       
   178         CAknInfoPopupNoteController* iPopupController;
       
   179         // Own:	Indicate USB storage was removed
       
   180         TBool usbWrongRemoved;
       
   181 
       
   182     };
       
   183 
       
   184 #endif      // CFILEMANAGERFOLDERSVIEW_H
       
   185             
       
   186 // End of File