filemanager/App/inc/CFileManagerAppUi.h
changeset 0 6a9f87576119
child 20 efe289f793e7
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  File Manager application UI class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFILEMANAGERAPPUI_H
       
    21 #define CFILEMANAGERAPPUI_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <aknViewAppUi.h>       // CAknViewAppUi
       
    25 #include <TFileManagerDriveInfo.h>
       
    26 #include "MFileManagerSchBackupObserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CAknNavigationControlContainer;
       
    30 class CAknTitlePane;
       
    31 class CAknNavigationDecorator;
       
    32 class CSendUi;
       
    33 class CAiwGenericParamList;
       
    34 class CFileManagerIRReceiver;
       
    35 class MFileManagerProcessObserver;
       
    36 class CFileManagerTaskScheduler;
       
    37 class CFileManagerSchBackupHandler;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42  * FileManager application UI class. 
       
    43  * An object of this class is created by the Symbian OS framework by a call to 
       
    44  * CFileManagerDocument::CreateAppUiL(). The application UI object creates 
       
    45  * and owns the application's views and handles system commands selected 
       
    46  * from the menu.
       
    47  */
       
    48 class CFileManagerAppUi : public CAknViewAppUi,
       
    49                           public MCoeForegroundObserver,
       
    50                           public MFileManagerSchBackupObserver
       
    51     {
       
    52     public: // Constants and types
       
    53         static const TUid KFileManagerMainViewId;
       
    54         static const TUid KFileManagerMemoryStoreViewId;
       
    55         static const TUid KFileManagerFoldersViewId;
       
    56         static const TUid KFileManagerSearchResultsViewId;
       
    57         static const TUid KFileManagerBackupViewId;
       
    58         static const TUid KFileManagerRestoreViewId;
       
    59 
       
    60     public:  // Constructors and destructor
       
    61         /**
       
    62          * Standard C++ constructor.
       
    63          */
       
    64         CFileManagerAppUi();
       
    65 
       
    66         /**
       
    67          * Destructor.
       
    68          */
       
    69         ~CFileManagerAppUi();
       
    70 
       
    71         /**
       
    72          * Constructs the CFileManagerAppUi class.
       
    73          */
       
    74         void ConstructL();
       
    75 
       
    76     public:
       
    77         /**
       
    78          * Activates folders view if it is not already 
       
    79          * activated.
       
    80          * @since 2.0
       
    81          * @return  ETrue if activated
       
    82          *          EFalse if view already activated
       
    83          */
       
    84         TBool ActivateFoldersViewL();
       
    85 
       
    86         /**
       
    87          * Closes folders view and goes back to view in which the
       
    88          * application was before folders view was activated.
       
    89          * @since 2.0
       
    90          */
       
    91         void CloseFoldersViewL();
       
    92 
       
    93         /**
       
    94          * Activates search results view if it is not already 
       
    95          * activated.
       
    96          * @since 2.0
       
    97          */
       
    98         void ActivateSearchResultsViewL();
       
    99 
       
   100         /**
       
   101          * Closes search results view and goes back to view in which
       
   102          * the application was before search results view was 
       
   103          * activated
       
   104          * @since 2.0
       
   105          */
       
   106         void CloseSearchResultsViewL();
       
   107 
       
   108         /**
       
   109          * Restores the default title of application to title pane.
       
   110          * @since 2.0
       
   111          */
       
   112         void RestoreDefaultTitleL();
       
   113         /**
       
   114          * Returns the CSendUi2 of this application.
       
   115          *
       
   116          * @since 3.0
       
   117          * @return The CSendUi2 of this application.
       
   118          */
       
   119         CSendUi& SendUiL();
       
   120         /**
       
   121          * This is called if resource is changed. Needed for skin feature
       
   122          *
       
   123          * @since 2.0
       
   124          */
       
   125         void HandleResourceChangeL(TInt aType);
       
   126 
       
   127         /**
       
   128          * Is application foreground
       
   129          *
       
   130          * @since 2.0
       
   131          * @return ETrue if application is foreground
       
   132          *         EFalse if application is not foreground
       
   133          */
       
   134         TBool IsFmgrForeGround();
       
   135 
       
   136         /**
       
   137          * Activates main view
       
   138          * activated.
       
   139          * @since 3.1
       
   140          */
       
   141         void ActivateMainViewL();
       
   142 
       
   143         /**
       
   144          * Activates memory store view
       
   145          * activated.
       
   146          * @since 3.1
       
   147          */
       
   148         void ActivateMemoryStoreViewL();
       
   149 
       
   150         /**
       
   151          * Closes memory store view and goes back to main view
       
   152          * @since 3.1
       
   153          */
       
   154         void CloseMemoryStoreViewL();
       
   155 
       
   156         /**
       
   157          * Gets reference to drive info
       
   158          * @since 3.1
       
   159          */
       
   160         TFileManagerDriveInfo& DriveInfo();
       
   161 
       
   162         /**
       
   163          * Activates remote drive settings view
       
   164          * @since 3.1
       
   165          */
       
   166         void ActivateRemoteDriveSettingsViewL(
       
   167             const TDesC& aDriveName = KNullDesC );
       
   168 
       
   169 #ifdef RD_FILE_MANAGER_BACKUP
       
   170         /**
       
   171          * Activates backup view if not already active
       
   172          * @since 3.1
       
   173          */
       
   174          void ActivateBackupViewL();
       
   175 
       
   176         /**
       
   177          * Closes backup view and goes back to main view
       
   178          * @since 3.1
       
   179          */
       
   180          void CloseBackupViewL();
       
   181 
       
   182         /**
       
   183          * Activates restore view if not already active
       
   184          *
       
   185          * @since 3.1
       
   186          * @param aDeleteBackup Indicates if delete backup selection is used.
       
   187          */
       
   188          void ActivateRestoreViewL( TBool aDeleteBackup = EFalse );
       
   189 
       
   190         /**
       
   191          * Closes restore view and goes back to backup view
       
   192          * @since 3.1
       
   193          */
       
   194          void CloseRestoreViewL();
       
   195 
       
   196 		 /**
       
   197 		  * Starts scheduled backup
       
   198 		  */
       
   199          void StartSchBackupL();
       
   200 
       
   201 		 /**
       
   202 		  * Gets task scheduler
       
   203 		  */
       
   204          CFileManagerTaskScheduler& TaskSchedulerL();
       
   205 
       
   206 		 /**
       
   207 		  * Gets scheduled backup handler
       
   208 		  */
       
   209          CFileManagerSchBackupHandler& SchBackupHandlerL();
       
   210 #endif // RD_FILE_MANAGER_BACKUP
       
   211 
       
   212         /**
       
   213          * Activates IR receive
       
   214          * @since 3.1
       
   215          */
       
   216         void StartIRReceiveL( MFileManagerProcessObserver& aObserver );
       
   217 
       
   218         /**
       
   219          * Stops IR receive
       
   220          * @since 3.1
       
   221          */
       
   222         void StopIRReceive();
       
   223 
       
   224         /**
       
   225          * Sets title
       
   226          * @since 3.1
       
   227          */
       
   228         void SetTitleL( const TDesC& aTitle );
       
   229 
       
   230         /**
       
   231          * Sets title
       
   232          * @since 3.1
       
   233          */
       
   234         void SetTitleL( const TInt aTitle );
       
   235 
       
   236         /**
       
   237          * Checks if view is file manager based view
       
   238          * @since 3.1
       
   239          */
       
   240         TBool IsFileManagerView( const TUid aViewUid );
       
   241 
       
   242         /**
       
   243         * Informs active view to update its cba
       
   244         * @since 3.2
       
   245         */
       
   246         void NotifyCbaUpdate();
       
   247 
       
   248         /**
       
   249         * Processes AIW input parameters
       
   250         * @since 5.0
       
   251         */
       
   252         void ProcessAiwParamListL( const CAiwGenericParamList& aInParams );
       
   253 
       
   254         /**
       
   255         * Indicates are all required input params received
       
   256         * @since 5.0
       
   257         */
       
   258         TBool WaitingForInputParams() const;
       
   259 
       
   260         /**
       
   261         * Exits the embedded open application if needed
       
   262         * @since 5.0
       
   263         */
       
   264         void ExitEmbeddedAppIfNeededL();
       
   265 
       
   266         /**
       
   267         * Checks is search view open
       
   268         * @since 5.0
       
   269         */
       
   270         TBool IsSearchViewOpen() const;
       
   271 
       
   272         /**
       
   273         * Save the time when backup/restore started.
       
   274         * @since 5.0
       
   275         */
       
   276         void BackupOrRestoreStarted();
       
   277 
       
   278         /**
       
   279         * Save the time when backup/restore ended.
       
   280         * @since 5.0
       
   281         */
       
   282         void BackupOrRestoreEnded();
       
   283 
       
   284         /**
       
   285         * Returns the time when backup/restore started.
       
   286         * @since 5.0
       
   287         */
       
   288         TTime BackupOrRestoreStartTime() const;
       
   289 
       
   290         /**
       
   291         * Returns the time when backup/restore ended.
       
   292         * @since 5.0
       
   293         */
       
   294         TTime BackupOrRestoreEndTime() const;
       
   295 
       
   296         /**
       
   297         * Resets the time when backup/restore start and end times.
       
   298         * @since 5.0
       
   299         */
       
   300         void ResetBackupOrRestoreEndTime();
       
   301         
       
   302     public: // MCoeForegroundObserver
       
   303 
       
   304         /** Handles the application coming to the foreground. */
       
   305         void HandleGainingForeground();
       
   306         /** Handles the application going into the background. */
       
   307         void HandleLosingForeground();
       
   308 
       
   309     public: // From CAknViewAppUi
       
   310         /**
       
   311          * @see CAknViewAppUi
       
   312          */
       
   313         void HandleViewDeactivation( const TVwsViewId &aViewIdToBeDeactivated, 
       
   314                                      const TVwsViewId &aNewlyActivatedViewId );
       
   315 
       
   316         /**
       
   317          * @see CAknViewAppUi
       
   318          */
       
   319         void HandleCommandL( TInt aCommand );
       
   320 
       
   321         /**
       
   322         * From CAknViewAppUi, called when screen layout changes 
       
   323         */
       
   324         void HandleScreenDeviceChangedL();
       
   325 
       
   326         /**
       
   327          * @see CAknViewAppUi
       
   328          */
       
   329         TErrorHandlerResponse HandleError( TInt aError,
       
   330             const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText );
       
   331 
       
   332         /**
       
   333          * @see CAknViewAppUi
       
   334          */
       
   335          TBool ProcessCommandParametersL(
       
   336             TApaCommand aCommand,
       
   337             TFileName& aDocumentName,
       
   338             const TDesC8& aTail );
       
   339 
       
   340 #ifdef RD_FILE_MANAGER_BACKUP
       
   341         /**
       
   342          * @see CAknViewAppUi
       
   343          */
       
   344         void ProcessMessageL( TUid aUid, const TDesC8& aParams );
       
   345 #endif // RD_FILE_MANAGER_BACKUP
       
   346 
       
   347     public: // From MFileManagerSchBackupObserver
       
   348         /**
       
   349          * @see MFileManagerSchBackupObserver
       
   350          */
       
   351         void SchBackupFinishedL( TInt aError );
       
   352 
       
   353     private:
       
   354         /** Deletes IR receive after timeout. */
       
   355         static TInt DeleteIRReceiveCB( TAny* aPtr );
       
   356 
       
   357         /** Informs active view when screen device has changed. */
       
   358         void NotifyViewScreenDeviceChanged();
       
   359 
       
   360         void SetFolderToOpenAtStartup(
       
   361             const TDesC& aFullPath, TInt aSortMode );
       
   362 
       
   363         void OpenFolderViewAtStartupL();
       
   364 
       
   365         void CreateAndActivateLocalViewL(
       
   366             TUid aViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage );
       
   367 
       
   368         void CreateAndActivateLocalViewL( TUid aViewId );
       
   369 
       
   370     private:    // Data
       
   371         /// Ref: Title pane of the application
       
   372         CAknTitlePane* iTitlePane;
       
   373         // Own: CSendAppUi for send menu item and sending files
       
   374         CSendUi* iSendUi;
       
   375         /// Uid of currently active view
       
   376         TUid iActiveView;
       
   377         /// Flag to indicate if search view is open
       
   378         TBool iSearchViewOpen;
       
   379         // For some reason IsForeGround() does not return correct state of the application
       
   380         // so own boolean is updated according MCoeForegroundObserver callbacks.
       
   381         TBool iForeGround;
       
   382         // Own: Infrared receiver for receive via IR functionality
       
   383         CFileManagerIRReceiver* iIRReceiver;
       
   384         // Own: Callback to delete CFileManagerIrReceiver
       
   385         CAsyncCallBack* iIRDeleteCB;
       
   386         // Own: Drive info
       
   387         TFileManagerDriveInfo iDriveInfo;
       
   388 		// Task scheduler
       
   389         CFileManagerTaskScheduler* iTaskScheduler;
       
   390 		// Handler for scheduled backup
       
   391         CFileManagerSchBackupHandler* iSchBackupHandler;
       
   392         // Flag to indicate if started for scheduled backup only
       
   393         TBool iSchBackupStandalone;
       
   394         // Indicates the folder to be opened at startup
       
   395         TFileName iFolderToOpenAtStartup;
       
   396         // Indicates the folder level at startup when the app is embedded
       
   397         TInt iInitialFolderLevel;
       
   398         // Indicates the parameter ready status
       
   399         TBool iWaitingForParams;
       
   400         
       
   401         // Own: Stores the start time
       
   402         TTime iManualBackupOrRestoreStarted;
       
   403         // Own: Stores the end time
       
   404         TTime iManualBackupOrRestoreEnded;
       
   405     };
       
   406 
       
   407 #endif // CFILEMANAGERAPPUI_H
       
   408             
       
   409 // End of File