OSDN Git Service

Ver0.11pre
[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 FolderView;\r
9 class SearchBox;\r
10 class OverWriteDialog;\r
11 class QLabel;\r
12 \r
13 namespace Ui {\r
14 class MainWindow;\r
15 }\r
16 \r
17 ///////////////////////////////////////////////////////////////////////////////\r
18 /// \brief The MainWindow class\r
19 ///\r
20 class MainWindow : public QMainWindow\r
21 {\r
22     Q_OBJECT\r
23 \r
24 public:\r
25     explicit MainWindow(QWidget *parent = 0);\r
26     ~MainWindow();\r
27 \r
28     FolderView *otherSideView(const FolderView *view) const;\r
29 \r
30 signals:\r
31     void showHiddenFiles(bool show);\r
32     void showSystemFiles(bool show);\r
33 \r
34 public slots:\r
35     void askOverWrite(QString *copyMethod, QString *alias,\r
36                       const QString &srcPath, const QString &tgtPath);\r
37 \r
38     void focusChange(QWidget * old, QWidget * now);\r
39     void keyPress(FolderView *view, QKeyEvent *event);\r
40     void returnPressInSearchBox();\r
41 \r
42     void chooseFolder();\r
43     void copyFilenameToClipboard();\r
44     void copyFullpathTpClipboard();\r
45     void copyItems();\r
46     void createFile();\r
47     void createFolder();\r
48     void cursorDown();\r
49     void cursorUp();\r
50     void deleteItems();\r
51     void executeCommand();\r
52     void historyBack();\r
53     void historyForward();\r
54     void itemFound(FolderView *view);\r
55     void itemNotFound(FolderView *view);\r
56     void markAll();\r
57     void markAllFiles();\r
58     void markAllOff();\r
59     void markInvert();\r
60     void markToggle();\r
61     void moveItems();\r
62     void open(const QModelIndex &index = QModelIndex());\r
63     void openEditor(const QString &path = QString());\r
64     void openTerminal();\r
65     void refresh();\r
66     void renameItems();\r
67     void retrieveFinish();\r
68     void retrieveStart(const QString &path);\r
69     void searchItem(const QString& text);\r
70     void searchNext();\r
71     void searchPrev();\r
72     void setCursorToBegin();\r
73     void setCursorToEnd();\r
74     void setPathFromOther();\r
75     void setPathToHome();\r
76     void setPathToOther();\r
77     void setPathToParent();\r
78     void setPathToRoot();\r
79     void shellExecute();\r
80     void showFilterDialog();\r
81     void showHistoryDialog();\r
82     void showSortDialog();\r
83     void swapView();\r
84     void toggleSearchBox(bool checked);\r
85 \r
86 \r
87 \r
88 \r
89     void openRequest(const QFileInfo &info);\r
90     void showPreferenceDialog();\r
91     void about();\r
92     void toggleShowHiddenFiles(bool checked);\r
93     void toggleShowSystemFiles(bool checked);\r
94     void checkUpdate(bool silent = false);\r
95     void checkUpdateFinished(QNetworkReply *reply, bool silent = false);\r
96     void checkUpdateFinishedSilent(QNetworkReply *reply);\r
97     void viewFinish(QWidget *sender);\r
98 \r
99 private:\r
100     Ui::MainWindow *ui;\r
101     QWidget *m_focusedView;\r
102     OverWriteDialog *m_overwriteDialog;\r
103 \r
104     // action\r
105     void initActionConnections();\r
106     static void replaceVars(QString &str, const QFileInfo info);\r
107     bool startProcess(const QString &cmd, const QString &workDir, const QString &errMsg);\r
108     void updateActions();\r
109     void setEnabledAllActions(bool enable);\r
110     void setNameFilters(FolderView *view, const QString& filters = QString());\r
111     void setSorting(FolderView *view);\r
112 \r
113     // getter\r
114     QLabel* filterLabel(const FolderView *view) const;\r
115     FolderView* folderView() const;\r
116     SearchBox* searchBox(FolderView *view) const;\r
117 \r
118 \r
119     // QWidget interface\r
120 protected:\r
121     void closeEvent(QCloseEvent *event);\r
122     void keyPressEvent(QKeyEvent *event);\r
123 };\r
124 \r
125 #endif // MAINWINDOW_H\r