1 | /**********************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved.
|
---|
4 | **
|
---|
5 | ** This file is part of Qt Designer.
|
---|
6 | **
|
---|
7 | ** This file may be distributed and/or modified under the terms of the
|
---|
8 | ** GNU General Public License version 2 as published by the Free Software
|
---|
9 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
10 | ** packaging of this file.
|
---|
11 | **
|
---|
12 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
13 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
14 | ** Agreement provided with the Software.
|
---|
15 | **
|
---|
16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
18 | **
|
---|
19 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
20 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
21 | ** information about Qt Commercial License Agreements.
|
---|
22 | **
|
---|
23 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
24 | ** not clear to you.
|
---|
25 | **
|
---|
26 | **********************************************************************/
|
---|
27 |
|
---|
28 | #ifndef RC2UI_H
|
---|
29 | #define RC2UI_H
|
---|
30 |
|
---|
31 | #include <qtextstream.h>
|
---|
32 | #include <qfile.h>
|
---|
33 | #include <qstringlist.h>
|
---|
34 |
|
---|
35 | class RC2UI
|
---|
36 | {
|
---|
37 | public:
|
---|
38 | RC2UI( QTextStream* input );
|
---|
39 | ~RC2UI();
|
---|
40 |
|
---|
41 | bool parse();
|
---|
42 | bool parse ( QStringList& get );
|
---|
43 |
|
---|
44 | QStringList targetFiles;
|
---|
45 |
|
---|
46 | protected:
|
---|
47 | enum WidgetType { IDWidget, IDPushButton, IDLabel, IDCheckBox, IDRadioButton,
|
---|
48 | IDGroupBox, IDLineEdit, IDMultiLineEdit, IDIconView, IDListView,
|
---|
49 | IDProgressBar, IDTabWidget, IDSpinBox, IDSlider, IDComboBox,
|
---|
50 | IDListBox, IDScrollBar, IDCustom, IDUnknown = 0x0100 };
|
---|
51 | bool makeDialog();
|
---|
52 | bool makeBitmap();
|
---|
53 | bool makeStringTable();
|
---|
54 | bool makeAccelerator();
|
---|
55 | bool makeCursor();
|
---|
56 | bool makeHTML();
|
---|
57 | bool makeIcon();
|
---|
58 | bool makeVersion();
|
---|
59 |
|
---|
60 | QString line;
|
---|
61 | QTextStream *in;
|
---|
62 | QStringList target;
|
---|
63 |
|
---|
64 | void indent();
|
---|
65 | void undent();
|
---|
66 |
|
---|
67 | QString stripQM( const QString& string );
|
---|
68 | QString parseNext( QString& arg, char sep = ',' );
|
---|
69 | QStringList splitStyles( const QString& styles, char sep = '|' );
|
---|
70 | void wi();
|
---|
71 |
|
---|
72 | void writeClass( const QString& name );
|
---|
73 | void writeCString( const QString& name, const QString& value );
|
---|
74 | void writeString( const QString& name, const QString& value );
|
---|
75 | void writeRect( const QString& name, int x, int y, int w, int h );
|
---|
76 | void writeFont( const QString& family, int pointsize );
|
---|
77 | void writeBool( const QString& name, bool value );
|
---|
78 | void writeNumber( const QString& name, int value );
|
---|
79 | void writeEnum( const QString& name, const QString& value );
|
---|
80 | void writeSet( const QString& name, const QString& value );
|
---|
81 |
|
---|
82 | void writeStyles( const QStringList styles, bool isFrame );
|
---|
83 | private:
|
---|
84 | int indentation;
|
---|
85 | bool writeToFile;
|
---|
86 | QTextStream* out;
|
---|
87 |
|
---|
88 | QString useName( const QString& );
|
---|
89 |
|
---|
90 | QStringList usedNames;
|
---|
91 |
|
---|
92 | const QString blockStart1;
|
---|
93 | const QString blockStart2;
|
---|
94 | };
|
---|
95 |
|
---|
96 | #endif
|
---|