eVaf
gui.h
Go to the documentation of this file.
1 
20 #ifndef __FILEFINDER_GUI_GUI_H
21 # define __FILEFINDER_GUI_GUI_H
22 
23 #include "version.h"
24 
25 #include <Plugins/iPlugin>
26 #include <Gui/Panel>
27 
28 #include <QObject>
29 #include <QString>
30 #include <QModelIndex>
31 #include <QWidget>
32 
33 class QWidget;
34 class QCheckBox;
35 class QComboBox;
36 class QPushButton;
37 class QListWidget;
38 class QAction;
39 class QFileSystemModel;
40 
41 namespace eVaf {
42 namespace SdiWindow {
43  struct iSdiWindow;
44 } // namespace eVaf::SdiWindow
45 namespace FileFinder {
46  class iFileFinder;
47 namespace GUI {
48 
49 namespace Internal {
50 
54 class MainWidget : public Gui::Panel
55 {
56  Q_OBJECT
57 
58 public:
59 
60  MainWidget(QWidget * parent = 0)
61  : Gui::Panel(parent)
62  {}
63 
64  virtual void keyPressEvent(QKeyEvent * e);
65 
66 
67 signals:
68 
72  void quit();
73 
74 };
75 
76 } // namespace eVaf::FileFinder::GUI::Internal
77 
83 class Module : public Plugins::iPlugin
84 {
85  Q_OBJECT
86  Q_INTERFACES(eVaf::Plugins::iPlugin)
87  Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR)
88 
89 public:
90 
91  Module();
92 
93  virtual ~Module();
94 
95  virtual bool init(QString const & args);
96 
97  virtual void done();
98 
99  virtual bool isReady() const { return mReady; }
100 
101 
102 private slots:
103 
104  void browseDirectory();
105 
106  void find();
107 
108  void found(QString const & file, QString const & dir);
109 
110  void finished(bool);
111 
112  void currentRowChanged(int currentRow);
113 
114  void openFile(QModelIndex const & index = QModelIndex());
115 
116  void openDirectory();
117 
118  void copyName();
119 
120  void copyAllNames();
121 
122 
123 private: // Members
124 
126  static int const MaxHistoryItems;
127 
129  bool mReady;
130 
133 
135  QAction * mOpenFileAction;
136  QAction * mOpenDirectoryAction;
137  QAction * mCopyNameAction;
138  QAction * mCopyAllNamesAction;
139 
141  Internal::MainWidget * wMain;
142  QComboBox * wDirectory;
143  QPushButton * wBrowse;
144  QCheckBox * wRecursive;
145  QComboBox * wIncludeNames;
146  QComboBox * wExcludeNames;
147  QComboBox * wIncludeContent;
148  QComboBox * wExcludeContent;
149  QListWidget * wResults;
150  QPushButton * wFind;
151 
153  QFileSystemModel * mDirModel;
154 
155 
156 private: // Methods
157 
158  void createWidgets();
159 
160  void createActions();
161 
162  void saveHistory();
163 
164  void loadHistory();
165 
166 };
167 
168 } // namespace eVaf::FileFinder::GUI
169 } // namespace eVaf::FileFinder
170 } // namespace eVaf
171 
172 #endif // gui.h
File finder interface.
Definition: ifilefinder.h:73
eVaf GUI panel class.
Definition: panel.h:49
Version information for eVaf modules.
bool COMMON_EXPORT init()
eVaf common library initialized
Graphical User Interface for the FileFinder application.
Definition: gui.h:83
Single Document Interface window manager for eVaf applications.
Definition: isdiwindow.h:44
#define VER_MODULE_NAME_STR
Module/library name (shall end with \0)
Definition: version.h:38
Main widget for the FileFinder window.
Definition: gui.h:54
Global eVaf namespace.
Definition: engine.h:37
Common interface for all the eVaf modules.
Definition: iplugin.h:38