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