filebrowser/ui/inc/fbfileview.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 FBFILEVIEWH_H_
       
    19 #define FBFILEVIEWH_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 FbEditorView;
       
    46 class SearchView;
       
    47 class SettingsView;
       
    48 class EngineWrapper;
       
    49 class FbFileModel;
       
    50 class FileBrowserSortFilterProxyModel;
       
    51 
       
    52 class FbFileView : public HbView
       
    53 {
       
    54     Q_OBJECT
       
    55 
       
    56 public:
       
    57     explicit FbFileView();
       
    58     virtual ~FbFileView();
       
    59     void init(EngineWrapper *engineWrapper);
       
    60 
       
    61 public slots:
       
    62     void refreshList();
       
    63 
       
    64 private:
       
    65     void fileOverwriteDialog();
       
    66     void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member);
       
    67 
       
    68     void openPropertyDialog(const QStringList &propertyList, const QString &title);
       
    69 
       
    70     void storeSelectedItemsOrCurrentItem();
       
    71     QModelIndex currentItemIndex();
       
    72 
       
    73     // Menu related methods
       
    74     void createMenu();
       
    75     void createFileMenu();
       
    76     void createEditMenu();
       
    77     void createViewMenu();
       
    78     void createToolsMenu();
       
    79 
       
    80     void createSelectionMenuItem();
       
    81     void createSettingsMenuItem();
       
    82     void createAboutMenuItem();
       
    83     void createExitMenuItem();
       
    84 
       
    85     void createContextMenu();
       
    86     void createFileContextMenu();
       
    87     void createEditContextMenu();
       
    88     void createViewContextMenu();
       
    89     void createToolBar();
       
    90 
       
    91 private slots:
       
    92     // menu action slots
       
    93     // file menu
       
    94     void fileBackMoveUp();
       
    95     void fileOpenDirectory();
       
    96     void fileSearch();
       
    97 
       
    98     void fileNewFile();
       
    99     void doFileNewFile(HbAction *);
       
   100 
       
   101     void fileNewDirectory();
       
   102     void doFileNewDirectory(HbAction *);
       
   103 
       
   104     void fileDelete();
       
   105     void doFileDelete(int);
       
   106 
       
   107     void fileRename();
       
   108     void doFileRename(HbAction *);
       
   109     void doFileRenameFileExist(int);
       
   110 
       
   111     void fileTouch();
       
   112     void doFileTouch(int);
       
   113     void fileProperties();
       
   114 
       
   115     void fileChecksumsMD5();
       
   116     void fileChecksumsMD2();
       
   117     void fileChecksumsSHA1();
       
   118     void fileChecksums(TFileBrowserCmdFileChecksums checksumType);
       
   119 
       
   120     void fileSetAttributes();
       
   121 
       
   122     // edit menu
       
   123     void editSnapShotToE();
       
   124     void editCut();
       
   125     void editCopy();
       
   126     void editPaste();
       
   127 
       
   128     void editCopyToFolder();
       
   129     void doEditCopyToFolder(int);
       
   130 
       
   131     void editMoveToFolder();
       
   132     void doEditMoveToFolder(int);
       
   133 
       
   134     void editSelect();
       
   135     void editUnselect();
       
   136     void editSelectAll();
       
   137     void editUnselectAll();
       
   138 
       
   139     // view menu
       
   140     void viewFilterEntries();
       
   141     void filterCriteriaChanged(const QString &);
       
   142     void clearFilterCriteria();
       
   143     void viewRefresh();
       
   144 
       
   145     // tools menu
       
   146     void toolsAllAppsToTextFile();
       
   147     void toolsAllFilesToTextFile();
       
   148 //    void toolsAvkonIconCacheEnable();
       
   149 //    void toolsAvkonIconCacheDisable();
       
   150 
       
   151     void toolsDisableExtendedErrors();
       
   152     void toolsDumpMsgStoreWalk();
       
   153     void toolsEditDataTypes();
       
   154     void toolsEnableExtendedErrors();
       
   155 
       
   156     void toolsErrorSimulateLeave();
       
   157     void doToolsErrorSimulateLeave(HbAction *);
       
   158 
       
   159     void toolsErrorSimulatePanic();
       
   160     void doToolsErrorSimulatePanicCode(HbAction *);
       
   161     void doToolsErrorSimulatePanic(HbAction *);
       
   162 
       
   163     void toolsErrorSimulateException();
       
   164     void doToolsErrorSimulateException(HbAction *);
       
   165 
       
   166 //    void toolsLocalConnectivityActivateInfrared();
       
   167 //    void toolsLocalConnectivityLaunchBTUI();
       
   168 //    void toolsLocalConnectivityLaunchUSBUI();
       
   169     void toolsMessageInbox();
       
   170     void toolsMessageDrafts();
       
   171     void toolsMessageSentItems();
       
   172     void toolsMessageOutbox();
       
   173     void toolsMemoryInfo();
       
   174     void toolsSecureBackStart();
       
   175     void toolsSecureBackRestore();
       
   176     void toolsSecureBackStop();
       
   177     void toolsSetDebugMaskQuestion();
       
   178     void toolsSetDebugMask(HbAction *);
       
   179     void toolsShowOpenFilesHere();
       
   180 
       
   181     // main menu items
       
   182     void selectionModeChanged();
       
   183     void about();
       
   184     
       
   185 signals:
       
   186     void aboutToShowDriveView();
       
   187     void aboutToShowSettingsView();
       
   188     void aboutToShowEditorView(const QString &, bool);
       
   189     void aboutToShowSearchView(const QString &);
       
   190     void aboutToShowAttributesView(const QString &, quint32 &, quint32 &, bool &);
       
   191     void aboutToSimulateLeave(int);
       
   192 
       
   193 private slots:
       
   194     void updateOptionMenu();
       
   195     void updateContextMenu();
       
   196     void selectionChanged(const QItemSelection &, const QItemSelection &);
       
   197     void activated(const QModelIndex& index);
       
   198     void activateSelectionMode();
       
   199     void deActivateSelectionMode();
       
   200     void onLongPressed(HbAbstractViewItem *, QPointF);
       
   201 
       
   202     void fileOpen(HbAction *);
       
   203     void fileOverwrite(HbAction *);
       
   204     void fileOverwritePostfix(HbAction *);
       
   205 
       
   206 private:
       
   207     // Internal methods
       
   208     void proceedFileRename();
       
   209     void proceedFileTouch(bool recurse);
       
   210 
       
   211 private:
       
   212     EngineWrapper *mEngineWrapper;
       
   213 
       
   214     HbListView *mListView;
       
   215     HbToolBar *mToolBar;
       
   216     HbLabel *mNaviPane;
       
   217     HbSearchPanel *mSearchPanel;
       
   218 
       
   219     QGraphicsLinearLayout *mMainLayout;
       
   220 
       
   221     // file info contains all needed information of selected file from file model
       
   222     QModelIndexList mClipboardIndexes;
       
   223     QModelIndexList mSelectionIndexes;
       
   224 
       
   225     FbFileModel *mFbFileModel;
       
   226     FileBrowserSortFilterProxyModel *mSortFilterProxyModel;
       
   227     OptionMenuActions mOptionMenuActions;
       
   228     ContextMenuActions mContextMenuActions;
       
   229     HbMenu *mContextMenu;
       
   230     HbAction *mToolbarBackAction;
       
   231     HbAction* mToolbarFilterAction;
       
   232     HbAction *mToolbarPasteAction;
       
   233 
       
   234     // flags
       
   235     bool mItemHighlighted;
       
   236     bool mLocationChanged;
       
   237     // flag for removing source file after copied to target file
       
   238     bool mRemoveFileAfterCopied;
       
   239     bool mClipBoardInUse;
       
   240     bool mFolderContentChanged;
       
   241     QModelIndex mCurrentIndex;
       
   242 
       
   243     // temporarily storage
       
   244     QString mOldPassword;
       
   245     QString mPanicCategory;
       
   246     QString mAbsoluteFilePath;
       
   247     OverwriteOptions mOverwriteOptions;
       
   248     QModelIndex mModelIndex;
       
   249     QString mNewFileName;
       
   250     bool mProceed;
       
   251     bool mEraseMBR;
       
   252 };
       
   253 
       
   254 
       
   255 
       
   256 #endif /* FBFILEVIEWH_H_ */