From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- quanta/treeviews/tagattributeitems.h | 178 +++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 quanta/treeviews/tagattributeitems.h (limited to 'quanta/treeviews/tagattributeitems.h') diff --git a/quanta/treeviews/tagattributeitems.h b/quanta/treeviews/tagattributeitems.h new file mode 100644 index 00000000..8d603529 --- /dev/null +++ b/quanta/treeviews/tagattributeitems.h @@ -0,0 +1,178 @@ +/*************************************************************************** + tagattributeitems.h + ------------------- + copyright : (C) 2003 by Andras Mantia + ***************************************************************************/ + +/*************************************************************************** + * * + * 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; version 2 of the License. * + * * + ***************************************************************************/ + +#ifndef TAGATTRIBUTEITEM_H +#define TAGATTRIBUTEITEM_H + +#include + +class KColorCombo; +class KURLRequester; +class KListView; +class KListViewItem; +class QListViewItem; +class QLineEdit; +class QComboBox; + +class Attribute; +class EditableTree; +class TagAttributeTree; +class Node; +class StyleEditor; + +class TopLevelItem : public KListViewItem +{ + +public: + TopLevelItem(KListView *parent, const QString& title); + TopLevelItem(KListView *parent, QListViewItem* after, const QString& title); + + virtual ~TopLevelItem(); + +protected: + + void paintCell( QPainter *p, const QColorGroup &cg, + int column, int width, int align ); +}; + +class ParentItem : public KListViewItem +{ + +public: + ParentItem(TagAttributeTree *listView, QListViewItem *parent); + + virtual ~ParentItem(); + Node *node(int index); + void addNode(Node *node); + void showList(bool show); + +protected: + + void paintCell( QPainter *p, const QColorGroup &cg, + int column, int width, int align ); + +private: + QPtrList m_nodeList; + QComboBox *comboBox; + TagAttributeTree *m_listView; +}; + +class AttributeItem : public KListViewItem +{ +public: + AttributeItem(QListViewItem* parent, const QString& title, const QString& title2); + AttributeItem(EditableTree *listView, QListViewItem* parent, const QString& title, const QString& title2); + AttributeItem(EditableTree *listView, const QString& title, const QString& title2); + AttributeItem(EditableTree *listView, const QString& title, const QString& title2, QListViewItem* after); + + virtual ~AttributeItem(); + virtual void replaceCurrentEditor(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual void placeEditor(QWidget *w, int column = 1); + virtual QString editorText(int column = 1); + + //I'm not sane... lin is the right editor, lin2 is the left one. + QLineEdit *lin, *lin2; + +protected: + + void paintCell( QPainter *p, const QColorGroup &cg, + int column, int width, int align ); + + EditableTree *m_listView; +}; + +class AttributeNameSpaceItem:public AttributeItem +{ +public: + AttributeNameSpaceItem(QListViewItem* parent, const QString& title, const QString& title2): AttributeItem(parent, title, title2){}; + AttributeNameSpaceItem(EditableTree *listView, QListViewItem* parent, const QString& title, const QString& title2):AttributeItem(listView, parent, title, title2){}; + virtual ~AttributeNameSpaceItem(){}; + +}; + +class AttributeBoolItem : public AttributeItem +{ +public: + AttributeBoolItem(TagAttributeTree *listView, QListViewItem* parent, const QString& title, const QString& title2); + + virtual ~AttributeBoolItem(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual QString editorText(int column = 1); + +private: + QComboBox* combo; +}; + +class AttributeUrlItem : public AttributeItem +{ +public: + AttributeUrlItem(TagAttributeTree *listView, QListViewItem* parent, const QString& title, const QString& title2); + + virtual ~AttributeUrlItem(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual QString editorText(int column = 1); + +private: + KURLRequester* urlRequester; +}; + +class AttributeListItem : public AttributeItem +{ +public: + AttributeListItem(EditableTree *listView, QListViewItem* parent, const QString& title, const QString& title2, Attribute *attr = 0L); + + virtual ~AttributeListItem(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual QString editorText(int column = 1); + +private: + QComboBox* combo; +}; + +class AttributeColorItem : public AttributeItem +{ +public: + AttributeColorItem(EditableTree *listView, QListViewItem* parent, const QString& title, const QString& title2); + + virtual ~AttributeColorItem(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual QString editorText(int column = 1); + +private: + KColorCombo* combo; +}; + +class AttributeStyleItem : public AttributeItem +{ +public: + AttributeStyleItem(EditableTree *listView, QListViewItem* parent, const QString& title, const QString& title2); + + virtual ~AttributeStyleItem(); + virtual void showEditor(int column = 1); + virtual void hideEditor(int column = 1); + virtual QString editorText(int column = 1); + +private: + + StyleEditor *m_se; +}; + + +#endif -- cgit v1.2.1