]>
vaikene.ee Git - evaf/blob - src/apps/FileFinder/GUI/gui.h
4d22d0b0d7636d14722fa6d28a1094a42a6d5d80
2 * @file FileFinder/GUI/gui.h
3 * @brief GUI for the FileFinder application
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __FILEFINDER_GUI_GUI_H
21 # define __FILEFINDER_GUI_GUI_H
23 #include <Plugins/iPlugin>
28 #include <QModelIndex>
37 class QFileSystemModel
;
42 } // namespace eVaf::SdiWindow
43 namespace FileFinder
{
50 * Main widget for the FileFinder window
52 class MainWidget
: public Gui::Panel
58 MainWidget(QWidget
* parent
= 0)
62 virtual void keyPressEvent(QKeyEvent
* e
);
68 * Request to close the windows/application
74 } // namespace eVaf::FileFinder::GUI::Internal
77 * Graphical User Interface for the FileFinder application.
79 * This module adds a GUI window to the FileFinder application using the SdiWindow module.
81 class Module
: public Plugins::iPlugin
84 Q_INTERFACES(eVaf::Plugins::iPlugin
)
92 virtual bool init(QString
const & args
);
96 virtual bool isReady() const { return mReady
; }
101 void browseDirectory();
105 void found(QString
const & file
, QString
const & dir
);
109 void currentRowChanged(int currentRow
);
111 void openFile(QModelIndex
const & index
= QModelIndex());
113 void openDirectory();
122 /// Max number of items in each field that we save
123 static int const MaxHistoryItems
;
125 /// Flag indicating that the module is ready
128 /// The iFileFinder interface
129 eVaf::FileFinder::iFileFinder
* mFinder
;
132 QAction
* mOpenFileAction
;
133 QAction
* mOpenDirectoryAction
;
134 QAction
* mCopyNameAction
;
135 QAction
* mCopyAllNamesAction
;
137 /// Widgets on the screen
138 Internal::MainWidget
* wMain
;
139 QComboBox
* wDirectory
;
140 QPushButton
* wBrowse
;
141 QCheckBox
* wRecursive
;
142 QComboBox
* wIncludeNames
;
143 QComboBox
* wExcludeNames
;
144 QComboBox
* wIncludeContent
;
145 QComboBox
* wExcludeContent
;
146 QListWidget
* wResults
;
149 /// File system auto-completion model for the directory field
150 QFileSystemModel
* mDirModel
;
155 void createWidgets();
157 void createActions();
165 } // namespace eVaf::FileFinder::GUI
166 } // namespace eVaf::FileFinder