#ifndef TYPE_LAYOUT_H
#define TYPE_LAYOUT_H

#include <qwidget.h>
#include <qdict.h>
#include <qstack.h>
#include <qlayout.h>
#include <qbttngrp.h>


class QPixmap;
class QColor;
class QLabel;
class QPushButton;
class QListBox;
class QLineEdit;

/** Helper class for KTypeLayout.
 You should not think about this.
 */
class TLObj : QObject
{
public:
    TLObj(QWidget *parent=0,const char *ID=0);
    virtual ~TLObj();
    QWidget *widget;
    int width;
    int align;
    QString ID;
};

/** Class to create dialogs, using typographical layout
 */

class KTypeLayout : QObject
{
public:
    /** Create a KTypeLayout inside of the parent widget
     WARNING: parent's size will probably be affected, since
     it will have to be at least large enough to contain its
     children.
     */
    KTypeLayout();
    KTypeLayout(QWidget *parent, KTypeLayout *parentLayout=0);
    virtual ~KTypeLayout();
    
    QString uniqueID();
    
    
    /** No more children will be added, so geometry management can be done
     Unlike the Qt layout managers, you CAN NOT add any more children
     after this, or nasty things will happen.
     */
    void activate();
    
    /** Adds a widget to the layout.
     Since KTypeLayout tends to shrink things to its minimum size and
     then stretch them, you should be careful and set minimum/fixed/maximum
     sizes for your widget.
     Use only if none of the convenience addXXX functions works for you.
     Returns a pointer to the TLobj with the widget.
     */
    QWidget *addWidget(QWidget *w,const char *ID=0);
    void addGroup(const char *ID=0,const char *title="", bool frame=false);
    void addBook(const char *ID=0);
    void addPage(const char *ID=0,const char *title="");
    void endGroup();
    
    QLabel *addLabel(const char *ID=0,const char *text="");
    QPushButton *addButton(const char *ID=0,const char *text="");
    QListBox *addListBox (const char *ID=0,QStrList *contents=0,int minRows=5);
    QLineEdit *addLineEdit(const char *ID=0,const char *text="");
    
    /** Ends a line of widgets, and starts a new one. Think about it
     as pressing "return" in a word processor.
     stretch and spacing call QGridLayout::setRowStretch() and
     QGridLayout::addRowSpacing() for the row that is ending.
     A trailing row with no objects in it will not do anything.
     */
    void newLine(int stretch=10, int spacing=0);
    
    QGridLayout *grid;
    QDict <QWidget> *objDict;
    QDict <QButtonGroup> *bgroupDict;
    QStack <KTypeLayout> *tlstack;
    QStack <QWidget> *wstack;
    QList < QList <TLObj> > rows;
    TLObj *lastObj;
    int outBorder, inBorder;
    QList <QSize> sizes;
    KTypeLayout *rootLayout;
};

#endif

Documentation generated by ralsina@thurman.localnet on Tue Jun 8 22:28:00 /etc/localtime 1999