utilityapps/filebrowser/ui/inc/fbdriveview.h
changeset 55 2d9cac8919d3
equal deleted inserted replaced
53:819e59dfc032 55:2d9cac8919d3
       
     1 /*
       
     2 * Copyright (c) 2010 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 #ifndef FBDRIVEVIEWH_H_
       
    19 #define FBDRIVEVIEWH_H_
       
    20 
       
    21 #include "menuaction.h"
       
    22 #include "enginewrapper.h"
       
    23 
       
    24 #include <HbView>
       
    25 #include <HbApplication>
       
    26 
       
    27 #include <QModelIndexList>
       
    28 
       
    29 // Forward declarations
       
    30 class QFileInfo;
       
    31 class QSignalMapper;
       
    32 class QItemSelection;
       
    33 class QString;
       
    34 class QGraphicsLinearLayout;
       
    35 
       
    36 class HbListView;
       
    37 class HbListWidget;
       
    38 class HbToolBar;
       
    39 class HbLabel;
       
    40 class HbDialog;
       
    41 class HbAbstractViewItem;
       
    42 class HbMenu;
       
    43 class HbSearchPanel;
       
    44 
       
    45 class EditorView;
       
    46 class SearchView;
       
    47 class SettingsView;
       
    48 class EngineWrapper;
       
    49 class FbDriveModel;
       
    50 class FileBrowserSortFilterProxyModel;
       
    51 
       
    52 class FbDriveView : public HbView
       
    53 {
       
    54     Q_OBJECT
       
    55 
       
    56 public:
       
    57     explicit FbDriveView();
       
    58     virtual ~FbDriveView();
       
    59     void init(EngineWrapper *engineWrapper);
       
    60 
       
    61 public slots:
       
    62     void refreshList();
       
    63 
       
    64 private:
       
    65     void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member);
       
    66 
       
    67     QModelIndex currentItemIndex();
       
    68     void storeSelectedItemsOrCurrentItem();
       
    69 
       
    70     // Menu related methods
       
    71     void createMenu();
       
    72     void createFileMenu();
       
    73     void createEditMenu();
       
    74     void createViewMenu();
       
    75     void createToolsMenu();
       
    76 
       
    77     void createSettingsMenuItem();
       
    78     void createAboutMenuItem();
       
    79     void createExitMenuItem();
       
    80 
       
    81     void createContextMenu();
       
    82     void createFileContextMenu();
       
    83     void createEditContextMenu();
       
    84     void createViewContextMenu();
       
    85     void createDiskAdminContextMenu();
       
    86 
       
    87 private slots:
       
    88     // menu action slots
       
    89     // file menu
       
    90     void fileOpenDrive();
       
    91     void fileSearch();
       
    92 
       
    93     void fileProperties();
       
    94 
       
    95     // edit menu
       
    96     void editSnapShotToE();
       
    97 
       
    98     // view menu
       
    99     void viewRefresh();
       
   100 
       
   101     // disk admin menu
       
   102     void diskAdminSetDrivePassword();
       
   103     void diskAdminSetDrivePasswordNew(HbAction *);
       
   104     void doDiskAdminSetDrivePassword(HbAction *);
       
   105 
       
   106     void diskAdminUnlockDrive();
       
   107     void doDiskAdminUnlockDrive(HbAction *);
       
   108 
       
   109     void diskAdminClearDrivePassword();
       
   110     void doDiskAdminClearDrivePassword(HbAction *);
       
   111 
       
   112     void diskAdminEraseDrivePassword();
       
   113     void doDiskAdminEraseDrivePassword(int);
       
   114 
       
   115     void diskAdminFormatDrive();
       
   116     void doDiskAdminFormatDrive(int);
       
   117 
       
   118     void diskAdminQuickFormatDrive();
       
   119     void doDiskAdminQuickFormatDrive(int);
       
   120 
       
   121     void diskAdminCheckDisk();
       
   122 
       
   123     void diskAdminScanDrive();
       
   124     void doDiskAdminScanDrive(int);
       
   125 
       
   126     void diskAdminSetDriveName();
       
   127     void doDiskAdminSetDriveName(HbAction *);
       
   128 
       
   129     void diskAdminSetDriveVolumeLabel();
       
   130     void doDiskAdminSetDriveVolumeLabel(HbAction *);
       
   131 
       
   132     void diskAdminEjectDrive();
       
   133     void diskAdminDismountDrive();
       
   134     void doDiskAdminDismountDrive(int);
       
   135 
       
   136     void diskAdminEraseMBR();
       
   137     void doDiskAdminEraseMBR(int);
       
   138     void doDiskAdminReallyEraseMBR(int);
       
   139     void doDiskAdminNotRemovableReallyEraseMBR(int);
       
   140     
       
   141     void diskAdminPartitionDrive();
       
   142     void diskAdminPartitionDriveProceed(int);
       
   143     void diskAdminPartitionDriveReallyProceed(int);
       
   144     void diskAdminPartitionDriveIsNotRemovable(int);
       
   145     void diskAdminPartitionDriveEraseMbr(int);
       
   146     void diskAdminPartitionDriveGetCount(HbAction *);
       
   147 
       
   148     // tools menu
       
   149     void toolsAllAppsToTextFile();
       
   150     void toolsAllFilesToTextFile();
       
   151 //    void toolsAvkonIconCacheEnable();
       
   152 //    void toolsAvkonIconCacheDisable();
       
   153 
       
   154     void toolsDisableExtendedErrors();
       
   155     void toolsDumpMsgStoreWalk();
       
   156     void toolsEditDataTypes();
       
   157     void toolsEnableExtendedErrors();
       
   158 
       
   159     void toolsErrorSimulateLeave();
       
   160     void doToolsErrorSimulateLeave(HbAction *);
       
   161 
       
   162     void toolsErrorSimulatePanic();
       
   163     void doToolsErrorSimulatePanicCode(HbAction *);
       
   164     void doToolsErrorSimulatePanic(HbAction *);
       
   165 
       
   166     void toolsErrorSimulateException();
       
   167     void doToolsErrorSimulateException(HbAction *);
       
   168 
       
   169 //    void toolsLocalConnectivityActivateInfrared();
       
   170 //    void toolsLocalConnectivityLaunchBTUI();
       
   171 //    void toolsLocalConnectivityLaunchUSBUI();
       
   172     void toolsMessageInbox();
       
   173     void toolsMessageDrafts();
       
   174     void toolsMessageSentItems();
       
   175     void toolsMessageOutbox();
       
   176     void toolsMemoryInfo();
       
   177     void toolsSecureBackStart();
       
   178     void toolsSecureBackRestore();
       
   179     void toolsSecureBackStop();
       
   180     void toolsSetDebugMaskQuestion();
       
   181     void toolsSetDebugMask(HbAction *);
       
   182     void toolsShowOpenFilesHere();
       
   183 
       
   184     // main menu items
       
   185     void about();
       
   186     
       
   187 signals:
       
   188     void aboutToShowFileView();
       
   189     void aboutToShowSettingsView();
       
   190     void aboutToShowEditorView(const QString &, bool);
       
   191     void aboutToShowSearchView(const QString &);
       
   192     void aboutToSimulateLeave(int);
       
   193 
       
   194 private slots:
       
   195     void updateOptionMenu();
       
   196     void updateContextMenu();
       
   197     void selectionChanged(const QItemSelection &, const QItemSelection &);
       
   198     void activated(const QModelIndex& index);
       
   199 
       
   200     void onLongPressed(HbAbstractViewItem *, QPointF);
       
   201 
       
   202 private:
       
   203     EngineWrapper *mEngineWrapper;
       
   204 
       
   205     HbListView *mListView;
       
   206     HbLabel *mNaviPane;
       
   207 
       
   208     QGraphicsLinearLayout *mMainLayout;
       
   209 
       
   210     // file info contains all needed information of selected file from file model
       
   211     QModelIndexList mClipboardIndexes;
       
   212     QModelIndexList mSelectionIndexes;
       
   213 
       
   214     FbDriveModel *mFbDriveModel;
       
   215     OptionMenuActions mOptionMenuActions;
       
   216     ContextMenuActions mContextMenuActions;
       
   217     HbMenu *mContextMenu;
       
   218 
       
   219     // flags
       
   220     bool mLocationChanged;
       
   221     // flag for removing source file after copied to target file
       
   222     bool mRemoveFileAfterCopied;
       
   223     bool mClipBoardInUse;
       
   224     bool mFolderContentChanged;
       
   225     QModelIndex mCurrentIndex;
       
   226 
       
   227     // temporarily storage
       
   228     QString mOldPassword;
       
   229     QString mPanicCategory;
       
   230     QString mAbsoluteFilePath;
       
   231     OverwriteOptions mOverwriteOptions;
       
   232     QModelIndex mModelIndex;
       
   233     QString mNewFileName;
       
   234     bool mProceed;
       
   235     bool mEraseMBR;
       
   236 };
       
   237 
       
   238 
       
   239 
       
   240 #endif /* FBDRIVEVIEWH_H_ */