Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 2047

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/include/qwidgetfactory.h:1 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>qwidgetfactory.h Include File</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qwidgetfactory.h</h1>

<p>This is the verbatim text of the qwidgetfactory.h include file. It is provided only for illustration; the copyright remains with Trolltech.
<hr>
<pre>
 /**********************************************************************
** Copyright (C) 2000 Trolltech AS.  All rights reserved.
**
** This file is part of Qt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#ifndef QWIDGETFACTORY_H
#define QWIDGETFACTORY_H

#ifndef QT_H
#include &lt;qstring.h&gt;
#include &lt;qptrlist.h&gt;
#include &lt;qimage.h&gt;
#include &lt;qpixmap.h&gt;
#include &lt;qvaluelist.h&gt;
#include &lt;qmap.h&gt;
#include &lt;qaction.h&gt;
#endif // QT_H

class QWidget;
class QLayout;
class QDomElement;
class QListViewItem;
class QTable;

class QWidgetFactory
{
public:
    QWidgetFactory();
    virtual ~QWidgetFactory();

    static QWidget *create( const QString &amp;uiFile, QObject *connector = 0, QWidget *parent = 0, const char *name = 0 );
    static QWidget *create( QIODevice *dev, QObject *connector = 0, QWidget *parent = 0, const char *name = 0 );
    static void addWidgetFactory( QWidgetFactory *factory );
    static void loadImages( const QString &amp;dir );

    virtual QWidget *createWidget( const QString &amp;className, QWidget *parent, const char *name ) const;

private:
    enum LayoutType { HBox, VBox, Grid, NoLayout };
    void loadImageCollection( const QDomElement &amp;e );
    void loadConnections( const QDomElement &amp;e, QObject *connector );
    void loadTabOrder( const QDomElement &amp;e );
    QWidget *createWidgetInternal( const QDomElement &amp;e, QWidget *parent, QLayout* layout, const QString &amp;classNameArg );
    QLayout *createLayout( QWidget *widget, QLayout*  layout, LayoutType type );
    LayoutType layoutType( QLayout *l ) const;
    void setProperty( QObject* widget, const QString &amp;prop, const QDomElement &amp;e );
    void createSpacer( const QDomElement &amp;e, QLayout *layout );
    QImage loadFromCollection( const QString &amp;name );
    QPixmap loadPixmap( const QDomElement &amp;e );
    QColorGroup loadColorGroup( const QDomElement &amp;e );
    void createColumn( const QDomElement &amp;e, QWidget *widget );
    void loadItem( const QDomElement &amp;e, QPixmap &amp;pix, QString &amp;txt, bool &amp;hasPixmap );
    void createItem( const QDomElement &amp;e, QWidget *widget, QListViewItem *i = 0 );
    void loadChildAction( QObject *parent, const QDomElement &amp;e );
    void loadActions( const QDomElement &amp;e );
    void loadToolBars( const QDomElement &amp;e );
    void loadMenuBar( const QDomElement &amp;e );
    void loadFunctions( const QDomElement &amp;e );
    QAction *findAction( const QString &amp;name );
    void loadExtraSource();
    QString translate( const QString&amp; sourceText, const QString&amp; comment = "" );

private:
    struct Image {
	QImage img;
	QString name;
	bool operator==(  const Image &amp;i ) const {
	    return ( i.name == name &amp;&amp;
		     i.img == img );
	}
    };

    struct Field
    {
	Field() {}
	Field( const QString &amp;s1, const QPixmap &amp;p, const QString &amp;s2 ) : name( s1 ), pix( p ), field( s2 ) {}
	QString name;
	QPixmap pix;
	QString field;
#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
	bool operator==( const Field&amp; ) const { return FALSE; }
#endif
    };

    struct EventFunction
    {
	EventFunction() {}
	EventFunction( const QString &amp;e, const QStringList &amp;f )
	    : events( e ) { functions.append( f ); }
	QStringList events;
	QValueList&lt;QStringList&gt; functions;
    };

    struct SqlWidgetConnection
    {
	SqlWidgetConnection() {}
	SqlWidgetConnection( const QString &amp;c, const QString &amp;t )
	    : conn( c ), table( t ), dbControls( new QMap&lt;QString, QString&gt;() ) {}
	QString conn;
	QString table;
	QMap&lt;QString, QString&gt; *dbControls;
    };

    struct Functions
    {
	QString functions;
    };

    QValueList&lt;Image&gt; images;
    QWidget *toplevel;
    QListViewItem *lastItem;
    QMap&lt;QString, QString&gt; *dbControls;
    QMap&lt;QString, QStringList&gt; dbTables;
    QMap&lt;QWidget*, SqlWidgetConnection&gt; sqlWidgetConnections;
    QMap&lt;QString, QString&gt; buddies;
    QMap&lt;QTable*, QValueList&lt;Field&gt; &gt; fieldMaps;
    QPtrList&lt;QAction&gt; actionList;
    QMap&lt;QObject *, EventFunction&gt; eventMap;
    QMap&lt;QString, QString&gt; languageSlots;
    QMap&lt;QString, Functions*&gt; languageFunctions;
    QStringList variables;
    QStringList noDatabaseWidgets;
    bool usePixmapCollection;
    int defMargin, defSpacing;

};

#endif
</pre>
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>