1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the tools applications of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
#include "treewalker.h"
32
void TreeWalker::acceptUI(DomUI *ui)
34
acceptWidget(ui->elementWidget());
35
acceptTabStops(ui->elementTabStops());
37
if (ui->elementImages())
38
acceptImages(ui->elementImages());
41
void TreeWalker::acceptLayoutDefault(DomLayoutDefault *layoutDefault)
43
Q_UNUSED(layoutDefault);
46
void TreeWalker::acceptLayoutFunction(DomLayoutFunction *layoutFunction)
48
Q_UNUSED(layoutFunction);
51
void TreeWalker::acceptTabStops(DomTabStops *tabStops)
56
void TreeWalker::acceptLayout(DomLayout *layout)
58
for (int i=0; i<layout->elementProperty().size(); ++i)
59
acceptProperty(layout->elementProperty().at(i));
61
for (int i=0; i<layout->elementItem().size(); ++i)
62
acceptLayoutItem(layout->elementItem().at(i));
65
void TreeWalker::acceptLayoutItem(DomLayoutItem *layoutItem)
67
switch (layoutItem->kind()) {
68
case DomLayoutItem::Widget:
69
acceptWidget(layoutItem->elementWidget());
71
case DomLayoutItem::Layout:
72
acceptLayout(layoutItem->elementLayout());
74
case DomLayoutItem::Spacer:
75
acceptSpacer(layoutItem->elementSpacer());
77
case DomLayoutItem::Unknown:
84
void TreeWalker::acceptWidget(DomWidget *widget)
86
for (int i=0; i<widget->elementAction().size(); ++i)
87
acceptAction(widget->elementAction().at(i));
89
for (int i=0; i<widget->elementActionGroup().size(); ++i)
90
acceptActionGroup(widget->elementActionGroup().at(i));
92
for (int i=0; i<widget->elementAddAction().size(); ++i)
93
acceptActionRef(widget->elementAddAction().at(i));
95
for (int i=0; i<widget->elementProperty().size(); ++i)
96
acceptProperty(widget->elementProperty().at(i));
98
for (int i=0; i<widget->elementWidget().size(); ++i)
99
acceptWidget(widget->elementWidget().at(i));
101
if (!widget->elementLayout().isEmpty())
102
acceptLayout(widget->elementLayout().at(0));
105
void TreeWalker::acceptSpacer(DomSpacer *spacer)
107
for (int i=0; i<spacer->elementProperty().size(); ++i)
108
acceptProperty(spacer->elementProperty().at(i));
111
void TreeWalker::acceptColor(DomColor *color)
116
void TreeWalker::acceptColorGroup(DomColorGroup *colorGroup)
118
Q_UNUSED(colorGroup);
121
void TreeWalker::acceptPalette(DomPalette *palette)
123
acceptColorGroup(palette->elementActive());
124
acceptColorGroup(palette->elementInactive());
125
acceptColorGroup(palette->elementDisabled());
128
void TreeWalker::acceptFont(DomFont *font)
133
void TreeWalker::acceptPoint(DomPoint *point)
138
void TreeWalker::acceptRect(DomRect *rect)
143
void TreeWalker::acceptSizePolicy(DomSizePolicy *sizePolicy)
145
Q_UNUSED(sizePolicy);
148
void TreeWalker::acceptSize(DomSize *size)
153
void TreeWalker::acceptDate(DomDate *date)
158
void TreeWalker::acceptTime(DomTime *time)
163
void TreeWalker::acceptDateTime(DomDateTime *dateTime)
168
void TreeWalker::acceptProperty(DomProperty *property)
170
switch (property->kind()) {
171
case DomProperty::Bool:
172
case DomProperty::Color:
173
case DomProperty::Cstring:
174
case DomProperty::Cursor:
175
case DomProperty::Enum:
176
case DomProperty::Font:
177
case DomProperty::Pixmap:
178
case DomProperty::IconSet:
179
case DomProperty::Palette:
180
case DomProperty::Point:
181
case DomProperty::Rect:
182
case DomProperty::Set:
183
case DomProperty::SizePolicy:
184
case DomProperty::Size:
185
case DomProperty::String:
186
case DomProperty::Number:
187
case DomProperty::Date:
188
case DomProperty::Time:
189
case DomProperty::DateTime:
190
case DomProperty::Unknown:
191
case DomProperty::StringList:
192
case DomProperty::Float:
193
case DomProperty::Double:
198
void TreeWalker::acceptCustomWidgets(DomCustomWidgets *customWidgets)
200
for (int i=0; i<customWidgets->elementCustomWidget().size(); ++i)
201
acceptCustomWidget(customWidgets->elementCustomWidget().at(i));
204
void TreeWalker::acceptCustomWidget(DomCustomWidget *customWidget)
206
Q_UNUSED(customWidget);
209
void TreeWalker::acceptAction(DomAction *action)
214
void TreeWalker::acceptActionGroup(DomActionGroup *actionGroup)
216
for (int i=0; i<actionGroup->elementAction().size(); ++i)
217
acceptAction(actionGroup->elementAction().at(i));
219
for (int i=0; i<actionGroup->elementActionGroup().size(); ++i)
220
acceptActionGroup(actionGroup->elementActionGroup().at(i));
223
void TreeWalker::acceptActionRef(DomActionRef *actionRef)
228
void TreeWalker::acceptImages(DomImages *images)
230
for (int i=0; i<images->elementImage().size(); ++i)
231
acceptImage(images->elementImage().at(i));
234
void TreeWalker::acceptImage(DomImage *image)
239
void TreeWalker::acceptIncludes(DomIncludes *includes)
241
for (int i=0; i<includes->elementInclude().size(); ++i)
242
acceptInclude(includes->elementInclude().at(i));
245
void TreeWalker::acceptInclude(DomInclude *incl)
250
void TreeWalker::acceptConnections(DomConnections *connections)
252
for (int i=0; i<connections->elementConnection().size(); ++i)
253
acceptConnection(connections->elementConnection().at(i));
256
void TreeWalker::acceptConnection(DomConnection *connection)
258
acceptConnectionHints(connection->elementHints());
261
void TreeWalker::acceptConnectionHints(DomConnectionHints *connectionHints)
263
for (int i=0; i<connectionHints->elementHint().size(); ++i)
264
acceptConnectionHint(connectionHints->elementHint().at(i));
267
void TreeWalker::acceptConnectionHint(DomConnectionHint *connectionHint)
269
Q_UNUSED(connectionHint);