remotestoragefw/mountmanager/inc/rsfwmountmanimpl.h
branchRCL_3
changeset 19 88ee4cf65e19
parent 16 87c71b25c937
child 20 1aa8c82cb4cb
equal deleted inserted replaced
16:87c71b25c937 19:88ee4cf65e19
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Mount manager
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CRSFWMOUNTMANIMPL_H
       
    20 #define CRSFWMOUNTMANIMPL_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include "rsfwmountstore.h"
       
    25 #include "rsfwcontrol.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MRsfwMountManObserver;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32  *  Class for implementing mount management of remote file repositories
       
    33  *
       
    34  *  @lib mountman.dll
       
    35  *  @since Series 60 3.1
       
    36  */
       
    37 
       
    38 class CRsfwMountManImpl : public CBase, public MRsfwMountStoreObserver
       
    39     {
       
    40 public: // Constructors and destructor
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      *
       
    44      * @param aDefaultFlags must be set to KMountFlagInteractive
       
    45      *   if the user is to be prompted during the mount procedure.
       
    46      *   Otherwise the parameter can be omitted (defaults to zero)
       
    47      * @param mount event observer
       
    48      * @return pointer to the created CRsfwMountManImpl object instance
       
    49      */
       
    50     static CRsfwMountManImpl* NewL(TUint aDefaultFlags,
       
    51                                MRsfwMountManObserver* aMountManObserver);
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     virtual ~CRsfwMountManImpl();
       
    57     
       
    58 public: // New functions
       
    59     // Methods that implement the mount management functions
       
    60     // See MountMan.h for documentation
       
    61     void GetMountNamesL(CDesC16Array* aNames);
       
    62 
       
    63     const CRsfwMountEntry* MountEntryL(const TDesC& aName);
       
    64 
       
    65     const CRsfwMountEntry* MountEntryL(TChar aDriveLetter);
       
    66 
       
    67     void AddMountEntryL(CRsfwMountEntry* aMountEntry);
       
    68 
       
    69     void DeleteMountEntryL(const TDesC& aName);
       
    70 
       
    71     void DeleteMountEntryL(TChar aDriveLetter);
       
    72 
       
    73     void EditMountEntryL(CRsfwMountEntry* aMountEntry);
       
    74 
       
    75     void MountL(TChar& aDriveLetter);
       
    76     void MountBlindL(TChar& aDriveLetter);
       
    77 
       
    78     TInt GetAllDrivesL(TDriveList& aDriveList);
       
    79 
       
    80     TInt GetRemoteMountListL(TDriveList& aDriveList);
       
    81     
       
    82     TInt GetMountInfo(TChar aDriveLetter, TRsfwMountInfo& aMountInfo);
       
    83 
       
    84     TInt SetMountConnectionState(TChar aDriveLetter,
       
    85                                  TUint aConnectionState);
       
    86 
       
    87     TInt RefreshDirectory(const TDesC& aPath);
       
    88     
       
    89     TBool IsAppOnBlackList(TUid aUid);
       
    90     
       
    91     TInt CancelRemoteTransfer(const TDesC& aFile);
       
    92 
       
    93 
       
    94     // Methods from MMountStoreObserver
       
    95     void HandleMountStoreEvent(TMountStoreEvent aEvent,
       
    96                                TInt aStatus,
       
    97                                TAny* aArg);
       
    98 
       
    99 private:
       
   100     enum TRsfwMountState
       
   101         {
       
   102         EMountStateIdle = 0,
       
   103         EMountStateWait,
       
   104         EMountStateCanceled
       
   105         };
       
   106 
       
   107 private:
       
   108     // Default constructor
       
   109     CRsfwMountManImpl();
       
   110 
       
   111     void ConstructL(TUint aDefaultFlags,
       
   112                     MRsfwMountManObserver* aMountManObserver);
       
   113     TInt GetRsfwControlConnection();
       
   114     TInt MountFileSystem(const TDesC& aDriveName, TChar aDriveLetter);
       
   115     TInt RemoteMountCountL();
       
   116     
       
   117     
       
   118     void DoUnmountL(TChar aDriveLetter, TUint aFlags);
       
   119     TInt ExecuteUnmount(TChar aDriveLetter);
       
   120     TChar FreeDriveLetterL(TChar aDriveLetter);
       
   121     TChar DriveLetterFromMountEntry(const CRsfwMountEntry& aMountEntry);
       
   122     void AddEntryL(CRsfwMountEntry* aMountEntry);
       
   123     TInt SyncWithMounterExe(TBool aSetDrive, TChar aDrive = EDriveQ);
       
   124     void GetFsDriveListL(TDriveList& aDriveList, TBool aRemoteOnly);
       
   125     TInt GetRemoteDriveListL(TDriveList& aDriveList);
       
   126     TInt SetDriveNameToFileSystem(TChar aDriveLetter,
       
   127                                  const TDesC& aDriveName);
       
   128     void LoadBlackListL();
       
   129 
       
   130 private: // Data
       
   131     RFs                           iFs;
       
   132     RRsfwControl                  iRsfwControl;
       
   133     TBool                         iRsfwControlConnected;
       
   134     TUint                         iDefaultFlags;  // default mount options
       
   135     TRsfwMountInfo                iMountInfo;     // current mount info
       
   136     TRsfwMountState               iMountState;
       
   137     MRsfwMountManObserver*        iMountManObserver;
       
   138     CRsfwMountStore*              iMountStore;
       
   139     RArray<TUid>                  iBlackList;
       
   140     };
       
   141 
       
   142 #endif // CRSFWMOUNTMANIMPL_H
       
   143 
       
   144 // End of File