~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/tools/uic/treewalker.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the tools applications of the Qt Toolkit.
 
6
**
 
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.
 
10
**
 
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.
 
15
**
 
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.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
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.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#include "treewalker.h"
 
30
#include "ui4.h"
 
31
 
 
32
void TreeWalker::acceptUI(DomUI *ui)
 
33
{
 
34
    acceptWidget(ui->elementWidget());
 
35
    acceptTabStops(ui->elementTabStops());
 
36
 
 
37
    if (ui->elementImages())
 
38
        acceptImages(ui->elementImages());
 
39
}
 
40
 
 
41
void TreeWalker::acceptLayoutDefault(DomLayoutDefault *layoutDefault)
 
42
{
 
43
    Q_UNUSED(layoutDefault);
 
44
}
 
45
 
 
46
void TreeWalker::acceptLayoutFunction(DomLayoutFunction *layoutFunction)
 
47
{
 
48
    Q_UNUSED(layoutFunction);
 
49
}
 
50
 
 
51
void TreeWalker::acceptTabStops(DomTabStops *tabStops)
 
52
{
 
53
    Q_UNUSED(tabStops);
 
54
}
 
55
 
 
56
void TreeWalker::acceptLayout(DomLayout *layout)
 
57
{
 
58
    for (int i=0; i<layout->elementProperty().size(); ++i)
 
59
        acceptProperty(layout->elementProperty().at(i));
 
60
 
 
61
    for (int i=0; i<layout->elementItem().size(); ++i)
 
62
        acceptLayoutItem(layout->elementItem().at(i));
 
63
}
 
64
 
 
65
void TreeWalker::acceptLayoutItem(DomLayoutItem *layoutItem)
 
66
{
 
67
    switch (layoutItem->kind()) {
 
68
        case DomLayoutItem::Widget:
 
69
            acceptWidget(layoutItem->elementWidget());
 
70
            return;
 
71
        case DomLayoutItem::Layout:
 
72
            acceptLayout(layoutItem->elementLayout());
 
73
            return;
 
74
        case DomLayoutItem::Spacer:
 
75
            acceptSpacer(layoutItem->elementSpacer());
 
76
            return;
 
77
        case DomLayoutItem::Unknown:
 
78
            break;
 
79
    }
 
80
 
 
81
    Q_ASSERT( 0 );
 
82
}
 
83
 
 
84
void TreeWalker::acceptWidget(DomWidget *widget)
 
85
{
 
86
    for (int i=0; i<widget->elementAction().size(); ++i)
 
87
        acceptAction(widget->elementAction().at(i));
 
88
 
 
89
    for (int i=0; i<widget->elementActionGroup().size(); ++i)
 
90
        acceptActionGroup(widget->elementActionGroup().at(i));
 
91
 
 
92
    for (int i=0; i<widget->elementAddAction().size(); ++i)
 
93
        acceptActionRef(widget->elementAddAction().at(i));
 
94
 
 
95
    for (int i=0; i<widget->elementProperty().size(); ++i)
 
96
        acceptProperty(widget->elementProperty().at(i));
 
97
 
 
98
    for (int i=0; i<widget->elementWidget().size(); ++i)
 
99
        acceptWidget(widget->elementWidget().at(i));
 
100
 
 
101
    if (!widget->elementLayout().isEmpty())
 
102
        acceptLayout(widget->elementLayout().at(0));
 
103
}
 
104
 
 
105
void TreeWalker::acceptSpacer(DomSpacer *spacer)
 
106
{
 
107
    for (int i=0; i<spacer->elementProperty().size(); ++i)
 
108
        acceptProperty(spacer->elementProperty().at(i));
 
109
}
 
110
 
 
111
void TreeWalker::acceptColor(DomColor *color)
 
112
{
 
113
    Q_UNUSED(color);
 
114
}
 
115
 
 
116
void TreeWalker::acceptColorGroup(DomColorGroup *colorGroup)
 
117
{
 
118
    Q_UNUSED(colorGroup);
 
119
}
 
120
 
 
121
void TreeWalker::acceptPalette(DomPalette *palette)
 
122
{
 
123
    acceptColorGroup(palette->elementActive());
 
124
    acceptColorGroup(palette->elementInactive());
 
125
    acceptColorGroup(palette->elementDisabled());
 
126
}
 
127
 
 
128
void TreeWalker::acceptFont(DomFont *font)
 
129
{
 
130
    Q_UNUSED(font);
 
131
}
 
132
 
 
133
void TreeWalker::acceptPoint(DomPoint *point)
 
134
{
 
135
    Q_UNUSED(point);
 
136
}
 
137
 
 
138
void TreeWalker::acceptRect(DomRect *rect)
 
139
{
 
140
    Q_UNUSED(rect);
 
141
}
 
142
 
 
143
void TreeWalker::acceptSizePolicy(DomSizePolicy *sizePolicy)
 
144
{
 
145
    Q_UNUSED(sizePolicy);
 
146
}
 
147
 
 
148
void TreeWalker::acceptSize(DomSize *size)
 
149
{
 
150
    Q_UNUSED(size);
 
151
}
 
152
 
 
153
void TreeWalker::acceptDate(DomDate *date)
 
154
{
 
155
    Q_UNUSED(date);
 
156
}
 
157
 
 
158
void TreeWalker::acceptTime(DomTime *time)
 
159
{
 
160
    Q_UNUSED(time);
 
161
}
 
162
 
 
163
void TreeWalker::acceptDateTime(DomDateTime *dateTime)
 
164
{
 
165
    Q_UNUSED(dateTime);
 
166
}
 
167
 
 
168
void TreeWalker::acceptProperty(DomProperty *property)
 
169
{
 
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:
 
194
            break;
 
195
    }
 
196
}
 
197
 
 
198
void TreeWalker::acceptCustomWidgets(DomCustomWidgets *customWidgets)
 
199
{
 
200
    for (int i=0; i<customWidgets->elementCustomWidget().size(); ++i)
 
201
        acceptCustomWidget(customWidgets->elementCustomWidget().at(i));
 
202
}
 
203
 
 
204
void TreeWalker::acceptCustomWidget(DomCustomWidget *customWidget)
 
205
{
 
206
    Q_UNUSED(customWidget);
 
207
}
 
208
 
 
209
void TreeWalker::acceptAction(DomAction *action)
 
210
{
 
211
    Q_UNUSED(action);
 
212
}
 
213
 
 
214
void TreeWalker::acceptActionGroup(DomActionGroup *actionGroup)
 
215
{
 
216
    for (int i=0; i<actionGroup->elementAction().size(); ++i)
 
217
        acceptAction(actionGroup->elementAction().at(i));
 
218
 
 
219
    for (int i=0; i<actionGroup->elementActionGroup().size(); ++i)
 
220
        acceptActionGroup(actionGroup->elementActionGroup().at(i));
 
221
}
 
222
 
 
223
void TreeWalker::acceptActionRef(DomActionRef *actionRef)
 
224
{
 
225
    Q_UNUSED(actionRef);
 
226
}
 
227
 
 
228
void TreeWalker::acceptImages(DomImages *images)
 
229
{
 
230
    for (int i=0; i<images->elementImage().size(); ++i)
 
231
        acceptImage(images->elementImage().at(i));
 
232
}
 
233
 
 
234
void TreeWalker::acceptImage(DomImage *image)
 
235
{
 
236
    Q_UNUSED(image);
 
237
}
 
238
 
 
239
void TreeWalker::acceptIncludes(DomIncludes *includes)
 
240
{
 
241
    for (int i=0; i<includes->elementInclude().size(); ++i)
 
242
        acceptInclude(includes->elementInclude().at(i));
 
243
}
 
244
 
 
245
void TreeWalker::acceptInclude(DomInclude *incl)
 
246
{
 
247
    Q_UNUSED(incl);
 
248
}
 
249
 
 
250
void TreeWalker::acceptConnections(DomConnections *connections)
 
251
{
 
252
    for (int i=0; i<connections->elementConnection().size(); ++i)
 
253
        acceptConnection(connections->elementConnection().at(i));
 
254
}
 
255
 
 
256
void TreeWalker::acceptConnection(DomConnection *connection)
 
257
{
 
258
    acceptConnectionHints(connection->elementHints());
 
259
}
 
260
 
 
261
void TreeWalker::acceptConnectionHints(DomConnectionHints *connectionHints)
 
262
{
 
263
    for (int i=0; i<connectionHints->elementHint().size(); ++i)
 
264
        acceptConnectionHint(connectionHints->elementHint().at(i));
 
265
}
 
266
 
 
267
void TreeWalker::acceptConnectionHint(DomConnectionHint *connectionHint)
 
268
{
 
269
    Q_UNUSED(connectionHint);
 
270
}