diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e9ae80694875f869892f13f4fcaf1170a00dea41 (patch) | |
tree | aa2f8d8a217e2d376224c8d46b7397b68d35de2d /quanta/dialogs/tagdialogs/tagattr.h | |
download | tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/dialogs/tagdialogs/tagattr.h')
-rw-r--r-- | quanta/dialogs/tagdialogs/tagattr.h | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/quanta/dialogs/tagdialogs/tagattr.h b/quanta/dialogs/tagdialogs/tagattr.h new file mode 100644 index 00000000..30b5220d --- /dev/null +++ b/quanta/dialogs/tagdialogs/tagattr.h @@ -0,0 +1,137 @@ +/*************************************************************************** + tagxml.h - description + ------------------- + begin : ����25 14:34:07 EEST 2000 + copyright : (C) 2000 by Dmitry Poplavsky & Alexander Yakovlev <pdima@users.sourceforge.net,yshurik@linuxfan.com> + (C) 2004 Andras Mantia <amantia@kde.org> + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TAGATTR_H +#define TAGATTR_H + +//qt includes +#include <qstring.h> +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qdom.h> + +//kde includes +#include <klineedit.h> +#include <kurl.h> + +//app includes +#include "colorcombo.h" +#include "filecombo.h" + +class QDomElement; +class QWidget; +class QTag; + + +QDomNode findChild( QDomNode &parent, const QString &name ); + + +class Attr +{ + public: + Attr( QDomElement const& el, QWidget *, QTag *dtdTag ) + : domEl(el), name(domEl.attribute("name","")), m_dtdTag(dtdTag) {} + //{ domEl = el; name = domEl->attribute("name",""); m_dtdTag = dtdTag;} + virtual ~Attr(){} + + virtual QString value()=0; + virtual void setValue(const QString &value)=0; + + QString attrName() const; + QDomElement const& domElement() const { return domEl; } + + protected: + QDomElement domEl; + QString name; + QTag *m_dtdTag; +}; + + +class Attr_line : public Attr +{ + protected: + QLineEdit *line; + + public: + Attr_line( QDomElement const& el, QWidget *w, QTag *dtdTag ) : Attr(el, w, dtdTag) + { line = (QLineEdit *)w; } + virtual ~Attr_line(){}; + + virtual QString value() { return line->text(); } + virtual void setValue(const QString &value) { line->setText(value); } +}; + + +class Attr_color : public Attr +{ + protected: + ColorCombo *color; + + public: + Attr_color( QDomElement const& el, QWidget *w, QTag *dtdTag ) : Attr(el, w, dtdTag) + { color = (ColorCombo *)w; } + virtual ~Attr_color(){}; + + virtual QString value() { return color->colorName(); } + virtual void setValue(const QString &value) { color->setColorName(value); } +}; + +class Attr_file : public Attr +{ + protected: + FileCombo *file; + + public: + Attr_file( QDomElement const& el, QWidget *w , QTag * dtdTag ) : Attr(el, w, dtdTag) + { file = (FileCombo *)w; } + virtual ~Attr_file(){}; + + virtual QString value() { return file->text(); } + virtual void setValue(const QString &value) { file->setText(value); } +}; + +class Attr_list : public Attr +{ + protected: + QComboBox *combo; + + public: + Attr_list( QDomElement const& el, QWidget *w, QTag *dtdTag ); + virtual ~Attr_list(){}; + + virtual QString value() { return combo->currentText(); } + virtual void setValue(const QString &value); +}; + + +class Attr_check : public Attr +{ + protected: + QCheckBox *check; + + public: + Attr_check( QDomElement const& el, QWidget *w, QTag *dtdTag ) : Attr(el, w, dtdTag) + { check = (QCheckBox *)w; } + virtual ~Attr_check(){}; + + virtual QString value() { return check->isChecked() ? "checked" : "unchecked" ; } + virtual void setValue(const QString &value) { check->setChecked( !value.isEmpty() ); } +}; + + + +#endif |