filebrowser/inc/FBModel.h
branchRCL_3
changeset 22 fad26422216a
parent 0 d6fe6244b863
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
       
     1 /*
       
     2 * Copyright (c) 2009 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FILEBROWSER_MODEL_H__
       
    20 #define __FILEBROWSER_MODEL_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <apgcli.h>
       
    26 #include <CAknMemorySelectionSettingPage.h>
       
    27 
       
    28 
       
    29 // setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
       
    30 const TUid KFBSettingDisplayMode                   = { 0x00 };
       
    31 const TUid KFBSettingFileViewMode                  = { 0x01 };
       
    32 const TUid KFBSettingShowSubDirectoryInfo          = { 0x02 };
       
    33 const TUid KFBSettingShowAssociatedIcons           = { 0x03 };
       
    34 const TUid KFBSettingRememberLastPath              = { 0x04 };
       
    35 const TUid KFBSettingLastPath                      = { 0x05 };
       
    36 
       
    37 const TUid KFBSettingSupportNetworkDrives          = { 0x06 };
       
    38 const TUid KFBSettingBypassPlatformSecurity        = { 0x07 };
       
    39 const TUid KFBSettingRemoveFileLocks               = { 0x08 };
       
    40 const TUid KFBSettingIgnoreProtectionsAtts         = { 0x09 };
       
    41 const TUid KFBSettingRemoveROMWriteProtection      = { 0x0A };
       
    42 
       
    43 const TUid KFBSettingFolderSelection               = { 0x0B };
       
    44 const TUid KFBSettingEnableToolbar                 = { 0x0C };
       
    45 
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 class CFileBrowserFileListContainer;
       
    49 class CFileBrowserScreenCapture;
       
    50 class CFileBrowserFileUtils;
       
    51 class CEikonEnv;
       
    52 class CAknGlobalConfirmationQuery;
       
    53 class CDictionaryFileStore;
       
    54 
       
    55 // CLASS DECLARATIONS
       
    56 
       
    57 class TFileBrowserSettings
       
    58     {
       
    59 public:
       
    60     TInt                                        iDisplayMode;
       
    61     TInt                                        iFileViewMode;
       
    62     TBool                                       iShowSubDirectoryInfo;
       
    63     TBool                                       iShowAssociatedIcons;
       
    64     TBool                                       iRememberLastPath;
       
    65     TFileName                                   iLastPath;
       
    66     TBool                                       iRememberFolderSelection;
       
    67     TBool                                       iEnableToolbar;
       
    68 
       
    69     TBool                                       iSupportNetworkDrives;
       
    70     TBool                                       iBypassPlatformSecurity;
       
    71     TBool                                       iRemoveFileLocks;
       
    72     TBool                                       iIgnoreProtectionsAtts;
       
    73     TBool                                       iRemoveROMWriteProrection;
       
    74     };
       
    75 
       
    76 
       
    77 class CFileBrowserModel : public CBase
       
    78 	{
       
    79 public:
       
    80 	static CFileBrowserModel* NewL();
       
    81 	~CFileBrowserModel();
       
    82 
       
    83 private:
       
    84 	CFileBrowserModel();
       
    85 	void ConstructL();
       
    86     void LoadSettingsL();
       
    87     void GetHashKeySelectionStatus();
       
    88     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
       
    89     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
       
    90     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
       
    91     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
       
    92 
       
    93 public:
       
    94     void ActivateModelL();
       
    95     void DeActivateModelL();
       
    96     void SaveSettingsL(TBool aNotifyModules=ETrue);
       
    97     void SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer);
       
    98     TInt LaunchSettingsDialogL();
       
    99     inline TFileBrowserSettings& Settings() { return iSettings; }
       
   100     inline CEikonEnv* EikonEnv() { return iEnv; }
       
   101     inline RApaLsSession& LsSession() { return iLs; }
       
   102     inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
       
   103     inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
       
   104     inline CFileBrowserFileListContainer* FileListContainer() { return iFileListContainer; }
       
   105     inline TBool IsHashKeySelectionInUse() { return iIsHashKeySelectionInUse; }
       
   106 
       
   107 private:
       
   108     CFileBrowserFileListContainer*  iFileListContainer;
       
   109     CFileBrowserScreenCapture*      iScreenCapture;
       
   110     CFileBrowserFileUtils*          iFileUtils;
       
   111     CEikonEnv*                      iEnv;
       
   112     TFileBrowserSettings            iSettings;
       
   113     RApaLsSession                   iLs;
       
   114     TBool                           iIsHashKeySelectionInUse; 
       
   115     };
       
   116    
       
   117 
       
   118 #endif // __FILEBROWSER_MODEL_H__