Eneboo - Documentación para desarrolladores
|
00001 /********************************************************************** 00002 ** 00003 ** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. 00004 ** 00005 ** This file is part of Qt Designer. 00006 ** 00007 ** This file may be distributed and/or modified under the terms of the 00008 ** GNU General Public License version 2 as published by the Free Software 00009 ** Foundation and appearing in the file LICENSE.GPL included in the 00010 ** packaging of this file. 00011 ** 00012 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00013 ** licenses may use this file in accordance with the Qt Commercial License 00014 ** Agreement provided with the Software. 00015 ** 00016 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00017 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00018 ** 00019 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00021 ** information about Qt Commercial License Agreements. 00022 ** 00023 ** Contact info@trolltech.com if any conditions of this licensing are 00024 ** not clear to you. 00025 ** 00026 **********************************************************************/ 00027 00028 #ifndef RC2UI_H 00029 #define RC2UI_H 00030 00031 #include <qtextstream.h> 00032 #include <qfile.h> 00033 #include <qstringlist.h> 00034 00035 class RC2UI 00036 { 00037 public: 00038 RC2UI( QTextStream* input ); 00039 ~RC2UI(); 00040 00041 bool parse(); 00042 bool parse ( QStringList& get ); 00043 00044 QStringList targetFiles; 00045 00046 protected: 00047 enum WidgetType { IDWidget, IDPushButton, IDLabel, IDCheckBox, IDRadioButton, 00048 IDGroupBox, IDLineEdit, IDMultiLineEdit, IDIconView, IDListView, 00049 IDProgressBar, IDTabWidget, IDSpinBox, IDSlider, IDComboBox, 00050 IDListBox, IDScrollBar, IDCustom, IDUnknown = 0x0100 }; 00051 bool makeDialog(); 00052 bool makeBitmap(); 00053 bool makeStringTable(); 00054 bool makeAccelerator(); 00055 bool makeCursor(); 00056 bool makeHTML(); 00057 bool makeIcon(); 00058 bool makeVersion(); 00059 00060 QString line; 00061 QTextStream *in; 00062 QStringList target; 00063 00064 void indent(); 00065 void undent(); 00066 00067 QString stripQM( const QString& string ); 00068 QString parseNext( QString& arg, char sep = ',' ); 00069 QStringList splitStyles( const QString& styles, char sep = '|' ); 00070 void wi(); 00071 00072 void writeClass( const QString& name ); 00073 void writeCString( const QString& name, const QString& value ); 00074 void writeString( const QString& name, const QString& value ); 00075 void writeRect( const QString& name, int x, int y, int w, int h ); 00076 void writeFont( const QString& family, int pointsize ); 00077 void writeBool( const QString& name, bool value ); 00078 void writeNumber( const QString& name, int value ); 00079 void writeEnum( const QString& name, const QString& value ); 00080 void writeSet( const QString& name, const QString& value ); 00081 00082 void writeStyles( const QStringList styles, bool isFrame ); 00083 private: 00084 int indentation; 00085 bool writeToFile; 00086 QTextStream* out; 00087 00088 QString useName( const QString& ); 00089 00090 QStringList usedNames; 00091 00092 const QString blockStart1; 00093 const QString blockStart2; 00094 }; 00095 00096 #endif