OSDN Git Service

Ver0.19
[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 cursorDownOther();\r
57     void cursorUpOther();\r
58     void deleteItems();\r
59     void editBookmark();\r
60     void executeCommand();\r
61     void expandLeft();\r
62     void expandRight();\r
63     void historyBack();\r
64     void historyForward();\r
65     void markAll();\r
66     void markAllFiles();\r
67     void markAllOff();\r
68     void markInvert();\r
69     void markToggle();\r
70     void moveItems();\r
71     void open(const QModelIndex &index = QModelIndex());\r
72     void openEditor(const QString &path = QString());\r
73     void openTerminal();\r
74     void openArchiver();\r
75     void openBookmark();\r
76     void refresh();\r
77     void renameItems();\r
78     void searchNext();\r
79     void searchPrev();\r
80     void setCursorToBegin();\r
81     void setCursorToEnd();\r
82     void setCursorToBeginOther();\r
83     void setCursorToEndOther();\r
84     void setFontSizeDown();\r
85     void setFontSizeUp();\r
86     void setPathFromOther();\r
87     void setPathToHome();\r
88     void setPathToOther();\r
89     void setPathToParent();\r
90     void setPathToRoot();\r
91     void shellExecute();\r
92     void showBookmarkDialog();\r
93     void showFilterDialog();\r
94     void showHistoryDialog();\r
95     void showPreferenceDialog();\r
96     void showSortDialog();\r
97     void splitCenter();\r
98     void swapView();\r
99     void switchHalfMode(bool checked);\r
100     void toggleSearchBox(bool checked);\r
101     void toggleShowHiddenFiles(bool checked);\r
102     void toggleShowSystemFiles(bool checked);\r
103 \r
104     void showContextMenu(QContextMenuEvent *event);\r
105 \r
106     void viewFinish();\r
107 \r
108 private:\r
109     enum Mode {\r
110         ModeBasic = 0x01,\r
111         ModeSearch = 0x02,\r
112         ModeFullView = 0x04,\r
113         ModeHalfView = 0x08,\r
114     };\r
115     typedef QFlags<Mode> ModeFlags;\r
116 \r
117     Ui::MainWindow *ui;\r
118     QWidget *m_focusedView;\r
119     OverWriteDialog *m_overwriteDialog;\r
120     ModeFlags m_viewMode;\r
121 \r
122     // action\r
123     void initActionConnections();\r
124     static void replaceVars(QString &str, const QFileInfo info);\r
125     bool startProcess(const QString &cmd, const QString &workDir, const QString &errMsg);\r
126     void updateActions();\r
127     void setEnabledAllActions(bool enable);\r
128     void showNameFilters(FolderView *view);\r
129     void copyItems(const QFileInfoList &list, const QString &tgtDir);\r
130     void changeFontSize(int diff);\r
131     void initBookmark();\r
132     void sendEventOther(QEvent *event);\r
133 \r
134     // getter\r
135     FolderView* otherSideFolderView(const FolderView *view) const;\r
136 \r
137     // setter\r
138     void setViewMode(ModeFlags flags);\r
139 \r
140     // QWidget interface\r
141 protected:\r
142     void closeEvent(QCloseEvent *event);\r
143     void keyPressEvent(QKeyEvent *event);\r
144 };\r
145 \r
146 #endif // MAINWINDOW_H\r