|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * Copyright (C) 1997-2007 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 |
|
21 class Input; |
|
22 class QTreeWidget; |
|
23 class QTreeWidgetItem; |
|
24 class QStackedWidget; |
|
25 class QCheckBox; |
|
26 class QLineEdit; |
|
27 class QPushButton; |
|
28 class QRadioButton; |
|
29 class QGroupBox; |
|
30 class QButtonGroup; |
|
31 class Wizard; |
|
32 |
|
33 enum OptLang { Lang_Cpp, Lang_C, Lang_Java, Lang_CS }; |
|
34 enum HtmlStyle { HS_Plain, HS_TreeView, HS_CHM }; |
|
35 enum TexStyle { TS_PDFHyper, TS_PDF, TS_PS }; |
|
36 enum DiagramMode { DM_None, DM_Builtin, DM_Dot }; |
|
37 |
|
38 class Step1 : public QWidget |
|
39 { |
|
40 Q_OBJECT |
|
41 |
|
42 public: |
|
43 Step1(Wizard *parent,const QHash<QString,Input*> &modelData); |
|
44 void init(); |
|
45 |
|
46 private slots: |
|
47 void selectSourceDir(); |
|
48 void selectDestinationDir(); |
|
49 void setProjectName(const QString &name); |
|
50 void setProjectNumber(const QString &num); |
|
51 void setSourceDir(const QString &dir); |
|
52 void setDestinationDir(const QString &dir); |
|
53 void setRecursiveScan(int); |
|
54 |
|
55 private: |
|
56 QLineEdit *m_projName; |
|
57 QLineEdit *m_projNumber; |
|
58 QLineEdit *m_sourceDir; |
|
59 QLineEdit *m_destDir; |
|
60 QCheckBox *m_recursive; |
|
61 QPushButton *m_srcSelectDir; |
|
62 QPushButton *m_dstSelectDir; |
|
63 Wizard *m_wizard; |
|
64 const QHash<QString,Input *> &m_modelData; |
|
65 }; |
|
66 |
|
67 class Step2 : public QWidget |
|
68 { |
|
69 Q_OBJECT |
|
70 public: |
|
71 Step2(Wizard *parent,const QHash<QString,Input*> &modelData); |
|
72 void init(); |
|
73 |
|
74 private slots: |
|
75 void optimizeFor(int choice); |
|
76 void extractMode(int choice); |
|
77 void changeCrossRefState(int choice); |
|
78 |
|
79 private: |
|
80 QGroupBox *m_extractMode; |
|
81 QGroupBox *m_optimizeLang; |
|
82 QButtonGroup *m_extractModeGroup; |
|
83 QButtonGroup *m_optimizeLangGroup; |
|
84 QCheckBox *m_crossRef; |
|
85 Wizard *m_wizard; |
|
86 const QHash<QString,Input *> &m_modelData; |
|
87 }; |
|
88 |
|
89 class Step3 : public QWidget |
|
90 { |
|
91 Q_OBJECT |
|
92 |
|
93 public: |
|
94 Step3(Wizard *parent,const QHash<QString,Input*> &modelData); |
|
95 void init(); |
|
96 |
|
97 private slots: |
|
98 void setHtmlEnabled(bool); |
|
99 void setLatexEnabled(bool); |
|
100 void setManEnabled(int); |
|
101 void setRtfEnabled(int); |
|
102 void setXmlEnabled(int); |
|
103 void setSearchEnabled(int); |
|
104 void setHtmlOptions(int); |
|
105 void setLatexOptions(int); |
|
106 |
|
107 private: |
|
108 QGroupBox *m_texOptions; |
|
109 QButtonGroup *m_texOptionsGroup; |
|
110 QGroupBox *m_htmlOptions; |
|
111 QButtonGroup *m_htmlOptionsGroup; |
|
112 QCheckBox *m_htmlEnabled; |
|
113 QCheckBox *m_latexEnabled; |
|
114 QCheckBox *m_manEnabled; |
|
115 QCheckBox *m_rtfEnabled; |
|
116 QCheckBox *m_xmlEnabled; |
|
117 QCheckBox *m_searchEnabled; |
|
118 Wizard *m_wizard; |
|
119 const QHash<QString,Input *> &m_modelData; |
|
120 }; |
|
121 |
|
122 class Step4 : public QWidget |
|
123 { |
|
124 Q_OBJECT |
|
125 |
|
126 public: |
|
127 Step4(Wizard *parent,const QHash<QString,Input*> &modelData); |
|
128 void init(); |
|
129 |
|
130 private slots: |
|
131 void diagramModeChanged(int); |
|
132 void setClassGraphEnabled(int state); |
|
133 void setCollaborationGraphEnabled(int state); |
|
134 void setGraphicalHierarchyEnabled(int state); |
|
135 void setIncludeGraphEnabled(int state); |
|
136 void setIncludedByGraphEnabled(int state); |
|
137 void setCallGraphEnabled(int state); |
|
138 void setCallerGraphEnabled(int state); |
|
139 |
|
140 private: |
|
141 QGroupBox *m_diagramMode; |
|
142 QButtonGroup *m_diagramModeGroup; |
|
143 QGroupBox *m_dotGroup; |
|
144 QCheckBox *m_dotClass; |
|
145 QCheckBox *m_dotCollaboration; |
|
146 QCheckBox *m_dotInclude; |
|
147 QCheckBox *m_dotIncludedBy; |
|
148 QCheckBox *m_dotInheritance; |
|
149 QCheckBox *m_dotCall; |
|
150 QCheckBox *m_dotCaller; |
|
151 Wizard *m_wizard; |
|
152 const QHash<QString,Input *> &m_modelData; |
|
153 }; |
|
154 |
|
155 class Wizard : public QSplitter |
|
156 { |
|
157 Q_OBJECT |
|
158 public: |
|
159 Wizard(const QHash<QString,Input*> &modelData, QWidget *parent=0); |
|
160 ~Wizard(); |
|
161 |
|
162 public slots: |
|
163 void refresh(); |
|
164 |
|
165 private slots: |
|
166 void activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *); |
|
167 void nextTopic(); |
|
168 void prevTopic(); |
|
169 |
|
170 private: |
|
171 const QHash<QString,Input *> &m_modelData; |
|
172 QTreeWidget *m_treeWidget; |
|
173 QStackedWidget *m_topicStack; |
|
174 Step1 *m_step1; |
|
175 Step2 *m_step2; |
|
176 Step3 *m_step3; |
|
177 Step4 *m_step4; |
|
178 QPushButton *m_next; |
|
179 QPushButton *m_prev; |
|
180 }; |
|
181 |
|
182 #endif |