Back to index

kdeartwork  4.3.2
Public Member Functions | Private Attributes
KXSXmlHandler Class Reference

#include <kxsxml.h>

Collaboration diagram for KXSXmlHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 KXSXmlHandler (QWidget *p)
bool startDocument ()
bool startElement (const QString &, const QString &, const QString &, const QXmlAttributes &)
bool endElement (const QString &, const QString &, const QString &)
bool characters (const QString &)
QList< KXSConfigItem * > items () const
const QString & description () const

Private Attributes

QWidget * parent
KXSSelectItemselItem
bool inDesc
QString desc
QList< KXSConfigItem * > mConfigItemList
QStack< QWidget * > mParentStack

Detailed Description

Definition at line 47 of file kxsxml.h.


Constructor & Destructor Documentation

KXSXmlHandler::KXSXmlHandler ( QWidget *  p)

Definition at line 64 of file kxsxml.cpp.

    : QXmlDefaultHandler(), parent(p), selItem(0), inDesc(false)
{
    mParentStack.push( p );
}

Member Function Documentation

bool KXSXmlHandler::characters ( const QString &  ch)

Definition at line 151 of file kxsxml.cpp.

{
    if ( inDesc )
       desc += ch;
    return true;
}
const QString& KXSXmlHandler::description ( ) const [inline]

Definition at line 59 of file kxsxml.h.

{ return desc; }

Here is the caller graph for this function:

bool KXSXmlHandler::endElement ( const QString &  ,
const QString &  ,
const QString &  qName 
)

Definition at line 136 of file kxsxml.cpp.

{
    if ( qName == "select" ) {
       selItem = 0;
    } else if ( qName == "_description" ) {
       inDesc = false;
    } else if ( (qName == "hgroup" || qName == "vgroup") && parent ) {
       if ( mParentStack.count() > 1 ) {
           mParentStack.pop();
           parent = mParentStack.top();
       }
    }
    return true;
}
QList<KXSConfigItem*> KXSXmlHandler::items ( ) const [inline]

Definition at line 58 of file kxsxml.h.

{ return mConfigItemList; }

Here is the caller graph for this function:

Definition at line 70 of file kxsxml.cpp.

{
    return true;
}
bool KXSXmlHandler::startElement ( const QString &  ,
const QString &  ,
const QString &  qName,
const QXmlAttributes &  atts 
)

Definition at line 75 of file kxsxml.cpp.

{
    KXSConfigItem *i = 0;
    QString id = atts.value("id");
    if ( qName == "number" ) {
       QString sLow = atts.value( "low" );
       QString sHigh = atts.value( "high" );
       if ( sLow.contains( '.' ) || sHigh.contains( '.' ) ) {
           if ( parent )
              i = new KXSDoubleRangeControl( parent, id, atts );
           else
              i = new KXSDoubleRangeItem( id, atts );
       } else {
           if ( parent )
              i = new KXSRangeControl( parent, id, atts );
           else
              i = new KXSRangeItem( id, atts );
       }
    } else if ( qName == "boolean" ) {
       if ( parent )
           i = new KXSCheckBoxControl( parent, id, atts );
       else
           i = new KXSBoolItem( id, atts );
    } else if ( qName == "string" ) {
       if ( parent )
           i = new KXSLineEditControl( parent, id, atts );
       else
           i = new KXSStringItem( id, atts );
    } else if ( qName == "file" ) {
       if ( parent )
           i = new KXSFileControl( parent, id, atts );
       else
           i = new KXSStringItem( id, atts );
    } else if ( qName == "_description" ) {
       inDesc = true;
    } else if ( qName == "select" ) {
       if ( parent )
           selItem = new KXSDropListControl( parent, id, atts );
       else
           selItem = new KXSSelectItem( id, atts );
       i = selItem;
    } else if ( qName == "option" && selItem ) {
       selItem->addOption( atts );
    } else if ( qName == "hgroup" && parent ) {
       KHBox *hb = new KHBox( parent );
       mParentStack.push( hb );
       parent = hb;
    } else if ( qName == "vgroup" && parent ) {
       KVBox *vb = new KVBox( parent );
       mParentStack.push( vb );
       parent = vb;
    }

    if ( i )
       mConfigItemList.append( i );

    return true;
}

Here is the call graph for this function:


Member Data Documentation

QString KXSXmlHandler::desc [private]

Definition at line 65 of file kxsxml.h.

bool KXSXmlHandler::inDesc [private]

Definition at line 64 of file kxsxml.h.

Definition at line 66 of file kxsxml.h.

QStack<QWidget*> KXSXmlHandler::mParentStack [private]

Definition at line 67 of file kxsxml.h.

QWidget* KXSXmlHandler::parent [private]

Definition at line 62 of file kxsxml.h.

Definition at line 63 of file kxsxml.h.


The documentation for this class was generated from the following files: