All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NewSrcFileAssistant.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30  */
31 
32 
33 /**
34  @file NewSrcFileAssistant.hpp
35  @brief Header of ...
36 
37  @author Aline LIBRES <aline.libres@gmail.com>
38  */
39 
40 
41 #ifndef __OPENFLUID_UIWARESDEV_NEWSRCFILEASSISTANT_HPP__
42 #define __OPENFLUID_UIWARESDEV_NEWSRCFILEASSISTANT_HPP__
43 
44 #include <openfluid/dllexport.hpp>
45 
46 #include <QWizard>
47 #include <QDir>
48 
49 #include <QFrame>
50 #include <QLabel>
51 
54 
55 namespace Ui { class CppPage;
56 class CMakeConfigPage;
57 class NewSrcFileAssistant;
58 }
59 
60 namespace openfluid { namespace ui { namespace waresdev {
61 
62 
63 // =====================================================================
64 // =====================================================================
65 
66 
67 class OPENFLUID_API CppPage: public QWizardPage
68 {
69  Q_OBJECT
70 
71  private:
72 
73  Ui::CppPage* ui;
74 
75  QDir m_WareDir;
76 
77  bool m_IsHpp;
78 
79  QString m_DefaultMsg;
80 
81  protected:
82 
83  bool isComplete() const;
84 
85  public:
86 
87  CppPage(const QDir& WareDir, QWidget* Parent = 0);
88 
89  ~CppPage();
90 
91  void initialize(bool IsHpp, bool IsUi, openfluid::waresdev::WareSrcManager::WareType Type);
92 
93  private slots:
94 
95  void onInformationChanged();
96 };
97 
98 
99 // =====================================================================
100 // =====================================================================
101 
102 
103 class OPENFLUID_API CMakeConfigPage: public QWizardPage
104 {
105  Q_OBJECT
106 
107  private:
108 
109  Ui::CMakeConfigPage* ui;
110 
111  QString m_DefaultMsg;
112 
113  protected:
114 
115  bool isComplete() const;
116 
117  public:
118 
120 
121  ~CMakeConfigPage();
122 
123  private slots:
124 
125  void onRootfilenameTextChanged();
126 };
127 
128 
129 // =====================================================================
130 // =====================================================================
131 
132 
133 class OPENFLUID_API NewSrcFileAssistant: public QWizard
134 {
135  Q_OBJECT
136 
137  private:
138 
139  enum
140  {
141  INTRO_PAGE = 0, EMPTY_PAGE = 1, CMAKECONFIG_PAGE = 2, CPP_PAGE = 3, HPP_PAGE = 4, CPP_UI_PAGE = 5, HPP_UI_PAGE = 6
142  };
143 
144  Ui::NewSrcFileAssistant* ui;
145 
147 
148  const openfluid::waresdev::WareSrcContainer& mref_Container;
149 
150  QString m_NewFilePath;
151 
152  protected:
153 
154  void initializePage(int ID);
155 
156 
157  public:
158 
159  NewSrcFileAssistant(const openfluid::waresdev::WareSrcContainer& Container, QWidget* Parent = 0);
160 
162 
163  int getNextButtonID() const;
164 
165  void accept();
166 
167  QString getNewFilePath();
168 
169  static void setStatus(const QString DefaultMsg, const QString WarningMsg, QLabel* MsgLabel, QFrame* MsgFrame);
170 
171 
172  private slots :
173 
174  void onFileTypeButtonClicked(int ID);
175 
176  void onEmptyBrowseToolButtonClicked();
177 };
178 
179 
180 } } } // namespaces
181 
182 #endif /* __OPENFLUID_UIWARESDEV_NEWSRCFILEASSISTANT_HPP__ */
Definition: WareSrcFactory.hpp:58
Definition: NewSrcFileAssistant.hpp:103
Header of ...
Header of ...
WareType
Definition: WareSrcManager.hpp:57
Definition: NewSrcFileAssistant.hpp:133
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: NewSrcFileAssistant.hpp:67
Definition: WareSrcContainer.hpp:57