filebrowser/ui/inc/fbdriveview.h
changeset 55 2d9cac8919d3
parent 53 819e59dfc032
child 56 392f7045e621
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     void openPropertyDialog(const QStringList &propertyList, const QString &title);
       
    68 
       
    69     QModelIndex currentItemIndex();
       
    70     void storeSelectedItemsOrCurrentItem();
       
    71 
       
    72     // Menu related methods
       
    73     void createMenu();
       
    74     void createFileMenu();
       
    75     void createEditMenu();
       
    76     void createViewMenu();
       
    77     void createToolsMenu();
       
    78 
       
    79     void createSettingsMenuItem();
       
    80     void createAboutMenuItem();
       
    81     void createExitMenuItem();
       
    82 
       
    83     void createContextMenu();
       
    84     void createFileContextMenu();
       
    85     void createEditContextMenu();
       
    86     void createViewContextMenu();
       
    87     void createDiskAdminContextMenu();
       
    88 
       
    89 private slots:
       
    90     // menu action slots
       
    91     // file menu
       
    92     void fileOpenDrive();
       
    93     void fileSearch();
       
    94 
       
    95     void fileProperties();
       
    96 
       
    97     void fileSetAttributes();
       
    98 
       
    99     // edit menu
       
   100     void editSnapShotToE();
       
   101 
       
   102     // view menu
       
   103     void viewRefresh();
       
   104 
       
   105     // disk admin menu
       
   106     void diskAdminSetDrivePassword();
       
   107     void diskAdminSetDrivePasswordNew(HbAction *);
       
   108     void doDiskAdminSetDrivePassword(HbAction *);
       
   109 
       
   110     void diskAdminUnlockDrive();
       
   111     void doDiskAdminUnlockDrive(HbAction *);
       
   112 
       
   113     void diskAdminClearDrivePassword();
       
   114     void doDiskAdminClearDrivePassword(HbAction *);
       
   115 
       
   116     void diskAdminEraseDrivePassword();
       
   117     void doDiskAdminEraseDrivePassword(int);
       
   118 
       
   119     void diskAdminFormatDrive();
       
   120     void doDiskAdminFormatDrive(int);
       
   121 
       
   122     void diskAdminQuickFormatDrive();
       
   123     void doDiskAdminQuickFormatDrive(int);
       
   124 
       
   125     void diskAdminCheckDisk();
       
   126 
       
   127     void diskAdminScanDrive();
       
   128     void doDiskAdminScanDrive(int);
       
   129 
       
   130     void diskAdminSetDriveName();
       
   131     void doDiskAdminSetDriveName(HbAction *);
       
   132 
       
   133     void diskAdminSetDriveVolumeLabel();
       
   134     void doDiskAdminSetDriveVolumeLabel(HbAction *);
       
   135 
       
   136     void diskAdminEjectDrive();
       
   137     void diskAdminDismountDrive();
       
   138     void doDiskAdminDismountDrive(int);
       
   139 
       
   140     void diskAdminEraseMBR();
       
   141     void doDiskAdminEraseMBR(int);
       
   142     void doDiskAdminReallyEraseMBR(int);
       
   143     void doDiskAdminNotRemovableReallyEraseMBR(int);
       
   144     
       
   145     void diskAdminPartitionDrive();
       
   146     void diskAdminPartitionDriveProceed(int);
       
   147     void diskAdminPartitionDriveReallyProceed(int);
       
   148     void diskAdminPartitionDriveIsNotRemovable(int);
       
   149     void diskAdminPartitionDriveEraseMbr(int);
       
   150     void diskAdminPartitionDriveGetCount(HbAction *);
       
   151 
       
   152     // tools menu
       
   153     void toolsAllAppsToTextFile();
       
   154     void toolsAllFilesToTextFile();
       
   155 //    void toolsAvkonIconCacheEnable();
       
   156 //    void toolsAvkonIconCacheDisable();
       
   157 
       
   158     void toolsDisableExtendedErrors();
       
   159     void toolsDumpMsgStoreWalk();
       
   160     void toolsEditDataTypes();
       
   161     void toolsEnableExtendedErrors();
       
   162 
       
   163     void toolsErrorSimulateLeave();
       
   164     void doToolsErrorSimulateLeave(HbAction *);
       
   165 
       
   166     void toolsErrorSimulatePanic();
       
   167     void doToolsErrorSimulatePanicCode(HbAction *);
       
   168     void doToolsErrorSimulatePanic(HbAction *);
       
   169 
       
   170     void toolsErrorSimulateException();
       
   171     void doToolsErrorSimulateException(HbAction *);
       
   172 
       
   173 //    void toolsLocalConnectivityActivateInfrared();
       
   174 //    void toolsLocalConnectivityLaunchBTUI();
       
   175 //    void toolsLocalConnectivityLaunchUSBUI();
       
   176     void toolsMessageInbox();
       
   177     void toolsMessageDrafts();
       
   178     void toolsMessageSentItems();
       
   179     void toolsMessageOutbox();
       
   180     void toolsMemoryInfo();
       
   181     void toolsSecureBackStart();
       
   182     void toolsSecureBackRestore();
       
   183     void toolsSecureBackStop();
       
   184     void toolsSetDebugMaskQuestion();
       
   185     void toolsSetDebugMask(HbAction *);
       
   186     void toolsShowOpenFilesHere();
       
   187 
       
   188     // main menu items
       
   189     void about();
       
   190     
       
   191 signals:
       
   192     void aboutToShowFileView();
       
   193     void aboutToShowSettingsView();
       
   194     void aboutToShowEditorView(const QString &, bool);
       
   195     void aboutToShowSearchView(const QString &);
       
   196     void aboutToSimulateLeave(int);
       
   197 
       
   198 private slots:
       
   199     void updateOptionMenu();
       
   200     void updateContextMenu();
       
   201     void selectionChanged(const QItemSelection &, const QItemSelection &);
       
   202     void activated(const QModelIndex& index);
       
   203 
       
   204     void onLongPressed(HbAbstractViewItem *, QPointF);
       
   205 
       
   206 private:
       
   207     EngineWrapper *mEngineWrapper;
       
   208 
       
   209     HbListView *mListView;
       
   210     HbLabel *mNaviPane;
       
   211 
       
   212     QGraphicsLinearLayout *mMainLayout;
       
   213 
       
   214     // file info contains all needed information of selected file from file model
       
   215     QModelIndexList mClipboardIndexes;
       
   216     QModelIndexList mSelectionIndexes;
       
   217 
       
   218     FbDriveModel *mFbDriveModel;
       
   219     OptionMenuActions mOptionMenuActions;
       
   220     ContextMenuActions mContextMenuActions;
       
   221     HbMenu *mContextMenu;
       
   222 
       
   223     // flags
       
   224     bool mLocationChanged;
       
   225     // flag for removing source file after copied to target file
       
   226     bool mRemoveFileAfterCopied;
       
   227     bool mClipBoardInUse;
       
   228     bool mFolderContentChanged;
       
   229     QModelIndex mCurrentIndex;
       
   230 
       
   231     // temporarily storage
       
   232     QString mOldPassword;
       
   233     QString mPanicCategory;
       
   234     QString mAbsoluteFilePath;
       
   235     OverwriteOptions mOverwriteOptions;
       
   236     QModelIndex mModelIndex;
       
   237     QString mNewFileName;
       
   238     bool mProceed;
       
   239     bool mEraseMBR;
       
   240 };
       
   241 
       
   242 
       
   243 
       
   244 #endif /* FBDRIVEVIEWH_H_ */