wizard.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  */
14 
15 #ifndef WIZARD_H
16 #define WIZARD_H
17 
18 #include <QSplitter>
19 #include <QHash>
20 #include <QDialog>
21 
22 class Input;
23 class QTreeWidget;
24 class QTreeWidgetItem;
25 class QStackedWidget;
26 class QCheckBox;
27 class QLineEdit;
28 class QPushButton;
29 class QRadioButton;
30 class QGroupBox;
31 class QButtonGroup;
32 class Wizard;
33 class QImage;
34 class QLabel;
35 
40 
41 class TuneColorDialog : public QDialog
42 {
43  Q_OBJECT
44 
45  public:
46  TuneColorDialog(int hue,int sat,int gamma,QWidget *parent=0);
47  int getHue() const;
48  int getSaturation() const;
49  int getGamma() const;
50 
51  private slots:
52  void updateImage(int hue,int sat,int val);
53 
54  private:
55  QImage *m_image;
56  QLabel *m_imageLab;
57  int m_hue;
58  int m_sat;
59  int m_gam;
60 };
61 
62 class ColorPicker : public QWidget
63 {
64  Q_OBJECT
65 public:
66  enum Mode { Hue, Saturation, Gamma };
68  ~ColorPicker();
69 
70 public slots:
71  void setCol(int h, int s, int g);
72  //void setCol(int h, int s);
73 
74 signals:
75  void newHsv(int h, int s, int g);
76 
77 protected:
78  void paintEvent(QPaintEvent*);
79  void mouseMoveEvent(QMouseEvent *);
80  void mousePressEvent(QMouseEvent *);
81 
82 private:
83  enum { foff = 3, coff = 4 }; //frame and contents offset
84  int y2hue(int y);
85  int y2sat(int y);
86  int y2gam(int y);
87  int hue2y(int hue);
88  int sat2y(int sat);
89  int gam2y(int gamma);
90  void setHue(int v);
91  void setSat(int v);
92  void setGam(int v);
93 
94  QPixmap *m_pix;
96  int m_gam;
97  int m_hue;
98  int m_sat;
99 
100 };
101 
102 
103 class Step1 : public QWidget
104 {
105  Q_OBJECT
106 
107  public:
108  Step1(Wizard *parent,const QHash<QString,Input*> &modelData);
109  void init();
110 
111  private slots:
112  void selectSourceDir();
113  void selectDestinationDir();
114  void selectProjectIcon();
115  void setProjectName(const QString &name);
116  void setProjectBrief(const QString &desc);
117  void setProjectNumber(const QString &num);
118  void setSourceDir(const QString &dir);
119  void setDestinationDir(const QString &dir);
120  void setRecursiveScan(int);
121 
122  private:
123  QLineEdit *m_projName;
124  QLineEdit *m_projBrief;
125  QLineEdit *m_projNumber;
126  QLineEdit *m_sourceDir;
127  QLineEdit *m_destDir;
128  QLabel *m_projIconLab;
129  QCheckBox *m_recursive;
130  QPushButton *m_srcSelectDir;
131  QPushButton *m_dstSelectDir;
133  const QHash<QString,Input *> &m_modelData;
134 };
135 
136 class Step2 : public QWidget
137 {
138  Q_OBJECT
139  public:
140  Step2(Wizard *parent,const QHash<QString,Input*> &modelData);
141  void init();
142 
143  private slots:
144  void optimizeFor(int choice);
145  void extractMode(int choice);
146  void changeCrossRefState(int choice);
147 
148  private:
149  QGroupBox *m_extractMode;
150  QGroupBox *m_optimizeLang;
151  QButtonGroup *m_extractModeGroup;
152  QButtonGroup *m_optimizeLangGroup;
153  QCheckBox *m_crossRef;
155  const QHash<QString,Input *> &m_modelData;
156 };
157 
158 class Step3 : public QWidget
159 {
160  Q_OBJECT
161 
162  public:
163  Step3(Wizard *parent,const QHash<QString,Input*> &modelData);
164  void init();
165 
166  private slots:
167  void setHtmlEnabled(bool);
168  void setLatexEnabled(bool);
169  void setManEnabled(int);
170  void setRtfEnabled(int);
171  void setXmlEnabled(int);
172  void setSearchEnabled(int);
173  void setHtmlOptions(int);
174  void setLatexOptions(int);
175  void tuneColorDialog();
176 
177  private:
178  QGroupBox *m_texOptions;
179  QButtonGroup *m_texOptionsGroup;
180  QGroupBox *m_htmlOptions;
181  QButtonGroup *m_htmlOptionsGroup;
182  QCheckBox *m_htmlEnabled;
183  QCheckBox *m_latexEnabled;
184  QCheckBox *m_manEnabled;
185  QCheckBox *m_rtfEnabled;
186  QCheckBox *m_xmlEnabled;
187  QCheckBox *m_searchEnabled;
188  QPushButton *m_tuneColor;
190  const QHash<QString,Input *> &m_modelData;
191 };
192 
193 class Step4 : public QWidget
194 {
195  Q_OBJECT
196 
197  public:
198  Step4(Wizard *parent,const QHash<QString,Input*> &modelData);
199  void init();
200 
201  private slots:
202  void diagramModeChanged(int);
203  void setClassGraphEnabled(int state);
204  void setCollaborationGraphEnabled(int state);
205  void setGraphicalHierarchyEnabled(int state);
206  void setIncludeGraphEnabled(int state);
207  void setIncludedByGraphEnabled(int state);
208  void setCallGraphEnabled(int state);
209  void setCallerGraphEnabled(int state);
210 
211  private:
212  QGroupBox *m_diagramMode;
213  QButtonGroup *m_diagramModeGroup;
214  QGroupBox *m_dotGroup;
215  QCheckBox *m_dotClass;
216  QCheckBox *m_dotCollaboration;
217  QCheckBox *m_dotInclude;
218  QCheckBox *m_dotIncludedBy;
219  QCheckBox *m_dotInheritance;
220  QCheckBox *m_dotCall;
221  QCheckBox *m_dotCaller;
223  const QHash<QString,Input *> &m_modelData;
224 };
225 
226 class Wizard : public QSplitter
227 {
228  Q_OBJECT
229  public:
230  Wizard(const QHash<QString,Input*> &modelData, QWidget *parent=0);
231  ~Wizard();
232 
233  public slots:
234  void refresh();
235 
236  private slots:
237  void activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *);
238  void nextTopic();
239  void prevTopic();
240 
241  signals:
242  void done();
243 
244  private:
245  const QHash<QString,Input *> &m_modelData;
246  QTreeWidget *m_treeWidget;
247  QStackedWidget *m_topicStack;
252  QPushButton *m_next;
253  QPushButton *m_prev;
254 };
255 
256 #endif
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:223
static QCString name
Definition: declinfo.cpp:673
QGroupBox * m_dotGroup
Definition: wizard.h:214
QGroupBox * m_optimizeLang
Definition: wizard.h:150
QCheckBox * m_dotCall
Definition: wizard.h:220
Definition: wizard.h:158
Step4 * m_step4
Definition: wizard.h:251
static constexpr double g
Definition: Units.h:144
QCheckBox * m_htmlEnabled
Definition: wizard.h:182
QGroupBox * m_htmlOptions
Definition: wizard.h:180
QPushButton * m_tuneColor
Definition: wizard.h:188
QLabel * m_imageLab
Definition: wizard.h:56
void updateImage(int hue, int sat, int val)
Definition: wizard.cpp:277
int m_gam
Definition: wizard.h:96
QGroupBox * m_extractMode
Definition: wizard.h:149
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:245
QPushButton * m_next
Definition: wizard.h:252
QCheckBox * m_manEnabled
Definition: wizard.h:184
Definition: wizard.h:38
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
QCheckBox * m_dotCaller
Definition: wizard.h:221
Definition: wizard.h:39
QCheckBox * m_dotInheritance
Definition: wizard.h:219
Definition: wizard.h:36
string dir
QGroupBox * m_texOptions
Definition: wizard.h:178
init
Definition: train.py:42
QButtonGroup * m_diagramModeGroup
Definition: wizard.h:213
QButtonGroup * m_texOptionsGroup
Definition: wizard.h:179
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:155
QCheckBox * m_recursive
Definition: wizard.h:129
QCheckBox * m_rtfEnabled
Definition: wizard.h:185
QLineEdit * m_sourceDir
Definition: wizard.h:126
QPushButton * m_dstSelectDir
Definition: wizard.h:131
QLabel * m_projIconLab
Definition: wizard.h:128
int getGamma() const
Definition: wizard.cpp:306
QLineEdit * m_projNumber
Definition: wizard.h:125
Wizard * m_wizard
Definition: wizard.h:132
TexStyle
Definition: wizard.h:38
int getSaturation() const
Definition: wizard.cpp:301
OptLang
Definition: wizard.h:36
Step1 * m_step1
Definition: wizard.h:248
QButtonGroup * m_extractModeGroup
Definition: wizard.h:151
QCheckBox * m_searchEnabled
Definition: wizard.h:187
QCheckBox * m_dotClass
Definition: wizard.h:215
QLineEdit * m_projName
Definition: wizard.h:123
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:190
Mode m_mode
Definition: wizard.h:95
Definition: wizard.h:38
Step2 * m_step2
Definition: wizard.h:249
QPushButton * m_prev
Definition: wizard.h:253
QButtonGroup * m_htmlOptionsGroup
Definition: wizard.h:181
int getHue() const
Definition: wizard.cpp:296
QPushButton * m_srcSelectDir
Definition: wizard.h:130
Definition: wizard.h:36
Definition: wizard.h:226
int m_hue
Definition: wizard.h:97
QCheckBox * m_latexEnabled
Definition: wizard.h:183
double gamma(double KE, const simb::MCParticle *part)
QTreeWidget * m_treeWidget
Definition: wizard.h:246
Definition: input.h:9
int m_sat
Definition: wizard.h:98
QPixmap * m_pix
Definition: wizard.h:94
QLineEdit * m_projBrief
Definition: wizard.h:124
Definition: wizard.h:136
TuneColorDialog(int hue, int sat, int gamma, QWidget *parent=0)
Definition: wizard.cpp:165
Wizard * m_wizard
Definition: wizard.h:189
QCheckBox * m_dotInclude
Definition: wizard.h:217
Wizard * m_wizard
Definition: wizard.h:154
HtmlStyle
Definition: wizard.h:37
QCheckBox * m_crossRef
Definition: wizard.h:153
DiagramMode
Definition: wizard.h:39
QLineEdit * m_destDir
Definition: wizard.h:127
QCheckBox * m_dotCollaboration
Definition: wizard.h:216
QCheckBox * m_xmlEnabled
Definition: wizard.h:186
QImage * m_image
Definition: wizard.h:55
Definition: wizard.h:193
Wizard * m_wizard
Definition: wizard.h:222
Definition: wizard.h:103
Definition: wizard.h:39
QGroupBox * m_diagramMode
Definition: wizard.h:212
QStackedWidget * m_topicStack
Definition: wizard.h:247
static QCString * s
Definition: config.cpp:1042
Step3 * m_step3
Definition: wizard.h:250
def parent(G, child, parent_type)
Definition: graph.py:67
QCheckBox * m_dotIncludedBy
Definition: wizard.h:218
Definition: wizard.h:37
QButtonGroup * m_optimizeLangGroup
Definition: wizard.h:152