OSDN Git Service

Ver0.18
[gefu/Gefu.git] / mainwindow.h
1 #ifndef MAINWINDOW_H\r
2 #define MAINWINDOW_H\r
3 \r
4 #include <QFileInfo>\r
5 #include <QModelIndex>\r
6 #include <QMainWindow>\r
7 class QNetworkReply;\r
8 class OverWriteDialog;\r
9 class QLabel;\r
10 class FolderView;\r
11 class SearchBox;\r
12 class AnyView;\r
13 \r
14 namespace Ui {\r
15 class MainWindow;\r
16 }\r
17 \r
18 ///////////////////////////////////////////////////////////////////////////////\r
19 /// \brief The MainWindow class\r
20 ///\r
21 class MainWindow : public QMainWindow\r
22 {\r
23     Q_OBJECT\r
24 \r
25 public:\r
26     explicit MainWindow(QWidget *parent = 0);\r
27     ~MainWindow();\r
28 \r
29 signals:\r
30     void showHiddenFiles(bool show);\r
31     void showSystemFiles(bool show);\r
32 \r
33 public slots:\r
34     void askOverWrite(QString *copyMethod, QString *alias,\r
35                       const QString &srcPath, const QString &tgtPath);\r
36 \r
37     void currentChange(const QFileInfo &info);\r
38     void dropAccept(const QFileInfoList &list);\r
39     void focusChange(QWidget * old, QWidget * now);\r
40     void leftKeyPress();\r
41     void rightKeyPress();\r
42     void showFileInfo(const QString &str);\r
43 \r
44     void about();\r
45     void checkUpdate(bool silent = false);\r
46     void checkUpdateFinished(QNetworkReply *reply, bool silent = false);\r
47     void checkUpdateFinishedSilent(QNetworkReply *reply);\r
48     void chooseFolder();\r
49     void copyFilenameToClipboard();\r
50     void copyFullpathTpClipboard();\r
51     void copyItems();\r
52     void createFile();\r
53     void createFolder();\r
54     void cursorDown();\r
55     void cursorUp();\r
56     void deleteItems();\r
57     void editBookmark();\r
58     void executeCommand();\r
59     void historyBack();\r
60     void historyForward();\r
61     void markAll();\r
62     void markAllFiles();\r
63     void markAllOff();\r
64     void markInvert();\r
65     void markToggle();\r
66     void moveItems();\r
67     void open(const QModelIndex &index = QModelIndex());\r
68     void openEditor(const QString &path = QString());\r
69     void openTerminal();\r
70     void openBookmark();\r
71     void refresh();\r
72     void renameItems();\r
73     void searchNext();\r
74     void searchPrev();\r
75     void setCursorToBegin();\r
76     void setCursorToEnd();\r
77     void setFontSizeDown();\r
78     void setFontSizeUp();\r
79     void setPathFromOther();\r
80     void setPathToHome();\r
81     void setPathToOther();\r
82     void setPathToParent();\r
83     void setPathToRoot();\r
84     void shellExecute();\r
85     void showBookmarkDialog();\r
86     void showFilterDialog();\r
87     void showHistoryDialog();\r
88     void showPreferenceDialog();\r
89     void showSortDialog();\r
90     void swapView();\r
91     void switchHalfMode(bool checked);\r
92     void toggleSearchBox(bool checked);\r
93     void toggleShowHiddenFiles(bool checked);\r
94     void toggleShowSystemFiles(bool checked);\r
95 \r
96     void showContextMenu(QContextMenuEvent *event);\r
97 \r
98     void viewFinish();\r
99 \r
100 private:\r
101     enum Mode {\r
102         ModeBasic = 0x00,\r
103         ModeSearch = 0x01,\r
104         ModeFullView = 0x02,\r
105         ModeHalfView = 0x04,\r
106     };\r
107     typedef QFlags<Mode> ModeFlags;\r
108 \r
109     Ui::MainWindow *ui;\r
110     QWidget *m_focusedView;\r
111     OverWriteDialog *m_overwriteDialog;\r
112     ModeFlags m_viewMode;\r
113 \r
114     // action\r
115     void initActionConnections();\r
116     static void replaceVars(QString &str, const QFileInfo info);\r
117     bool startProcess(const QString &cmd, const QString &workDir, const QString &errMsg);\r
118     void updateActions();\r
119     void setEnabledAllActions(bool enable);\r
120     void showNameFilters(FolderView *view);\r
121     void copyItems(const QFileInfoList &list, const QString &tgtDir);\r
122     void changeFontSize(int diff);\r
123     void initBookmark();\r
124 \r
125     // getter\r
126     FolderView* otherSideFolderView(const FolderView *view) const;\r
127 \r
128     // setter\r
129     void setViewMode(ModeFlags flags);\r
130 \r
131     // QWidget interface\r
132 protected:\r
133     void closeEvent(QCloseEvent *event);\r
134     void keyPressEvent(QKeyEvent *event);\r
135 };\r
136 \r
137 #endif // MAINWINDOW_H\r