]>
vaikene.ee Git - evaf/blob - src/apps/FileFinder/GUI/gui.h
e4c0c8e885c2a7cda45c9058ce69f47ab66a7309
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>
27 #include <QModelIndex>
36 class QFileSystemModel
;
41 } // namespace eVaf::SdiWindow
42 namespace FileFinder
{
49 * Main widget for the FileFinder window
51 class MainWidget
: public QWidget
57 MainWidget(QWidget
* parent
= 0)
61 virtual void keyPressEvent(QKeyEvent
* e
);
67 * Request to close the windows/application
73 } // namespace eVaf::FileFinder::GUI::Internal
76 * Graphical User Interface for the FileFinder application.
78 * This module adds a GUI window to the FileFinder application using the SdiWindow module.
80 class Module
: public Plugins::iPlugin
83 Q_INTERFACES(eVaf::Plugins::iPlugin
)
91 virtual bool init(QString
const & args
);
95 virtual bool isReady() const { return mReady
; }
100 void browseDirectory();
104 void found(QString
const & file
, QString
const & dir
);
108 void currentRowChanged(int currentRow
);
110 void openFile(QModelIndex
const & index
= QModelIndex());
112 void openDirectory();
117 /// Max number of items in each field that we save
118 static int const MaxHistoryItems
;
120 /// Flag indicating that the module is ready
123 /// The iFileFinder interface
124 eVaf::FileFinder::iFileFinder
* mFinder
;
127 QAction
* mOpenFileAction
;
128 QAction
* mOpenDirectoryAction
;
130 /// Widgets on the screen
131 Internal::MainWidget
* wMain
;
132 QComboBox
* wDirectory
;
133 QPushButton
* wBrowse
;
134 QCheckBox
* wRecursive
;
135 QComboBox
* wIncludeNames
;
136 QComboBox
* wExcludeNames
;
137 QComboBox
* wIncludeContent
;
138 QComboBox
* wExcludeContent
;
139 QListWidget
* wResults
;
142 /// File system auto-completion model for the directory field
143 QFileSystemModel
* mDirModel
;
148 void createWidgets();
150 void createActions();
158 } // namespace eVaf::FileFinder::GUI
159 } // namespace eVaf::FileFinder