]>
vaikene.ee Git - evaf/blob - src/apps/FileFinder/GUI/gui.h
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::Window
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();
118 /// Max number of items in each field that we save
119 static int const MaxHistoryItems
;
121 /// Flag indicating that the module is ready
124 /// The iFileFinder interface
125 eVaf::FileFinder::iFileFinder
* mFinder
;
128 QAction
* mOpenFileAction
;
129 QAction
* mOpenDirectoryAction
;
131 /// Widgets on the screen
132 Internal::MainWidget
* wMain
;
133 QComboBox
* wDirectory
;
134 QPushButton
* wBrowse
;
135 QCheckBox
* wRecursive
;
136 QComboBox
* wIncludeNames
;
137 QComboBox
* wExcludeNames
;
138 QComboBox
* wIncludeContent
;
139 QComboBox
* wExcludeContent
;
140 QListWidget
* wResults
;
143 /// File system auto-completion model for the directory field
144 QFileSystemModel
* mDirModel
;
149 void createWidgets();
151 void createActions();
159 } // namespace eVaf::FileFinder::GUI
160 } // namespace eVaf::FileFinder