utilityapps/filebrowser/ui/inc/fbfileview.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 FBFILEVIEWH_H_
       
    19 #define FBFILEVIEWH_H_
       
    20 
       
    21 #include "menuaction.h"
       
    22 #include "enginewrapper.h"
       
    23 
       
    24 #include <HbView>
       
    25 #include <HbApplication>
       
    26 #include <HbIcon>
       
    27 
       
    28 #include <QModelIndexList>
       
    29 
       
    30 // Forward declarations
       
    31 class QFileInfo;
       
    32 class QSignalMapper;
       
    33 class QItemSelection;
       
    34 class QString;
       
    35 class QGraphicsLinearLayout;
       
    36 
       
    37 class HbListView;
       
    38 class HbListWidget;
       
    39 class HbToolBar;
       
    40 class HbLabel;
       
    41 class HbDialog;
       
    42 class HbAbstractViewItem;
       
    43 class HbMenu;
       
    44 class HbSearchPanel;
       
    45 
       
    46 class FbEditorView;
       
    47 class SearchView;
       
    48 class SettingsView;
       
    49 class EngineWrapper;
       
    50 class FbFileModel;
       
    51 class FileBrowserSortFilterProxyModel;
       
    52 
       
    53 class FbFileView : public HbView
       
    54 {
       
    55     Q_OBJECT
       
    56 
       
    57 public:
       
    58     explicit FbFileView();
       
    59     virtual ~FbFileView();
       
    60     void init(EngineWrapper *engineWrapper);
       
    61 
       
    62 public slots:
       
    63     void refreshList();
       
    64 
       
    65 private:
       
    66     void fileOverwriteDialog();
       
    67     void openListDialog(const QStringList &, const QString &, QObject *, const char *);
       
    68 
       
    69     void storeSelectedItemsOrCurrentItem();
       
    70     QModelIndex currentItemIndex();
       
    71 
       
    72     // Menu related methods
       
    73     void createMenu();
       
    74     void createFileMenu();
       
    75     void createEditMenu();
       
    76     void createViewMenu();
       
    77     void createToolsMenu();
       
    78 
       
    79     void createSelectionMenuItem();
       
    80     void createSettingsMenuItem();
       
    81     void createAboutMenuItem();
       
    82     void createExitMenuItem();
       
    83 
       
    84     void createContextMenu();
       
    85     void createFileContextMenu();
       
    86     void createEditContextMenu();
       
    87     void createViewContextMenu();
       
    88     void createSearchPanel();
       
    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 
       
   127     void editPaste();
       
   128     void doEditPaste();
       
   129 
       
   130     void editCopyToFolder();
       
   131     void doEditCopyToFolder(int);
       
   132     void doEditCopy();
       
   133 
       
   134     void editMoveToFolder();
       
   135     void doEditMoveToFolder(int);
       
   136     void doEditMove();
       
   137 
       
   138     void editSelect();
       
   139     void editUnselect();
       
   140     void editSelectAll();
       
   141     void editUnselectAll();
       
   142 
       
   143     // view menu
       
   144     void viewFilterEntries();
       
   145     void filterCriteriaChanged(const QString &);
       
   146     void clearFilterCriteria();
       
   147     void viewRefresh();
       
   148 
       
   149     // tools menu
       
   150     void toolsAllAppsToTextFile();
       
   151     void toolsAllFilesToTextFile();
       
   152 //    void toolsAvkonIconCacheEnable();
       
   153 //    void toolsAvkonIconCacheDisable();
       
   154 
       
   155     void toolsDisableExtendedErrors();
       
   156     void toolsDumpMsgStoreWalk();
       
   157     void toolsEditDataTypes();
       
   158     void toolsEnableExtendedErrors();
       
   159 
       
   160     void toolsErrorSimulateLeave();
       
   161     void doToolsErrorSimulateLeave(HbAction *);
       
   162 
       
   163     void toolsErrorSimulatePanic();
       
   164     void doToolsErrorSimulatePanicCode(HbAction *);
       
   165     void doToolsErrorSimulatePanic(HbAction *);
       
   166 
       
   167     void toolsErrorSimulateException();
       
   168     void doToolsErrorSimulateException(HbAction *);
       
   169 
       
   170 //    void toolsLocalConnectivityActivateInfrared();
       
   171 //    void toolsLocalConnectivityLaunchBTUI();
       
   172 //    void toolsLocalConnectivityLaunchUSBUI();
       
   173     void toolsMessageInbox();
       
   174     void toolsMessageDrafts();
       
   175     void toolsMessageSentItems();
       
   176     void toolsMessageOutbox();
       
   177     void toolsMemoryInfo();
       
   178     void toolsSecureBackStart();
       
   179     void toolsSecureBackRestore();
       
   180     void toolsSecureBackStop();
       
   181     void toolsSetDebugMaskQuestion();
       
   182     void toolsSetDebugMask(HbAction *);
       
   183     void toolsShowOpenFilesHere();
       
   184 
       
   185     // main menu items
       
   186     void selectionModeChanged();
       
   187     void selectionModeButtonTriggered();
       
   188 
       
   189     void about();
       
   190     
       
   191 signals:
       
   192     void aboutToShowDriveView();
       
   193     void aboutToShowSettingsView();
       
   194     void aboutToShowEditorView(const QString &, bool);
       
   195     void aboutToShowSearchView(const QString &);
       
   196     void aboutToShowAttributesView(const QString &, quint32 &, quint32 &, bool &);
       
   197     void aboutToSimulateLeave(int);
       
   198     void overwriteOptionSelected();
       
   199 
       
   200 private slots:
       
   201     void setOrientation(Qt::Orientation);
       
   202     void updateOptionMenu();
       
   203     void updateContextMenu();
       
   204     void activated(const QModelIndex& index);
       
   205     void activateSelectionMode();
       
   206     void deActivateSelectionMode();
       
   207     void onLongPressed(HbAbstractViewItem *, QPointF);
       
   208 
       
   209     void fileOpen(HbAction *);
       
   210     void fileOverwrite(HbAction *);
       
   211     void fileOverwritePostfix(HbAction *);
       
   212 
       
   213 private:
       
   214     // Internal methods
       
   215     void proceedFileRename();
       
   216     void proceedFileTouch(bool recurse);
       
   217 
       
   218 private:
       
   219     EngineWrapper *mEngineWrapper;
       
   220 
       
   221     HbListView *mListView;
       
   222     HbToolBar *mToolBar;
       
   223     HbLabel *mNaviPane;
       
   224     HbSearchPanel *mSearchPanel;
       
   225 
       
   226     QGraphicsLinearLayout *mMainLayout;
       
   227 
       
   228     // file info contains all needed information of selected file from file model
       
   229     QModelIndexList mClipboardIndexes;
       
   230     QModelIndexList mSelectionIndexes;
       
   231 
       
   232     FbFileModel *mFbFileModel;
       
   233     FileBrowserSortFilterProxyModel *mSortFilterProxyModel;
       
   234     OptionMenuActions mOptionMenuActions;
       
   235     ContextMenuActions mContextMenuActions;
       
   236     HbMenu *mContextMenu;
       
   237     HbAction *mToolbarBackAction;
       
   238     HbAction* mToolbarFilterAction;
       
   239     HbAction* mToolbarSelectionModeAction;
       
   240     HbAction *mToolbarPasteAction;
       
   241 
       
   242     HbIcon mSelectionModeOnIcon;
       
   243     HbIcon mSelectionModeOffIcon;
       
   244 
       
   245     // flags
       
   246     bool mItemHighlighted;
       
   247     bool mLocationChanged;
       
   248     // flag for removing source file after copied to target file
       
   249     bool mRemoveFileAfterCopied;
       
   250     bool mClipBoardInUse;
       
   251     QModelIndex mCurrentIndex;
       
   252 
       
   253     // temporarily storage
       
   254     QString mOldPassword;
       
   255     QString mPanicCategory;
       
   256     QString mAbsoluteFilePath;
       
   257     OverwriteOptions mOverwriteOptions;
       
   258     QString mTargetDir;
       
   259     QModelIndex mModelIndex;
       
   260     QString mNewFileName;
       
   261     bool mProceed;
       
   262     bool mEraseMBR;
       
   263 };
       
   264 
       
   265 
       
   266 
       
   267 #endif /* FBFILEVIEWH_H_ */