F:/KPlato/koffice/libs/koproperty/editoritem.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
00004    Copyright (C) 2004-2006 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KPROPERTY_PROPERTYEDITORITEM_H
00023 #define KPROPERTY_PROPERTYEDITORITEM_H
00024 
00025 #include "koproperty_global.h"
00026 #include <k3listview.h>
00027 
00028 #define KPROPEDITOR_ITEM_MARGIN 2
00029 #define KPROPEDITOR_ITEM_BORDER_COLOR QColor(200,200,200) 
00030 
00031 template<class U> class Q3AsciiDict;
00032 class QLabel;
00033 
00034 namespace KoProperty {
00035 
00036 class EditorItemPrivate;
00037 class Property;
00038 class Editor;
00039 class GroupWidget;
00040 class QListViewItem;
00041 
00048 class EditorItem : public K3ListViewItem
00049 {
00050         public:
00051                 typedef Q3AsciiDict<EditorItem> Dict;
00052 
00056                 EditorItem(Editor *editor, EditorItem *parent, Property *property,
00057                         Q3ListViewItem *after=0);
00058 
00060                 EditorItem(K3ListView *parent);
00061                 EditorItem(EditorItem *parent, const QString &text);
00062                 EditorItem(EditorItem *parent, EditorItem *after, const QString &text);
00063 
00064                 virtual ~EditorItem();
00065 
00067                 Property* property();
00068 
00069         protected:
00073                 virtual void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align);
00074 
00078                 virtual void paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h);
00079 
00080                 virtual void paintFocus(QPainter * p, const QColorGroup & cg, const QRect & r);
00081 
00082                 virtual int compare( Q3ListViewItem *i, int col, bool ascending ) const;
00083 
00084                 virtual void setHeight( int height );
00085 
00086         protected:
00087                 EditorItemPrivate *d;
00088 };
00089 
00091 class EditorGroupItem : public EditorItem
00092 {
00093         public:
00094                 EditorGroupItem(EditorItem *parent, EditorItem *after, const QString &text, 
00095                         const QString &icon, int sortOrder);
00096                 EditorGroupItem(EditorItem *parent, const QString &text, 
00097                         const QString &icon, int sortOrder);
00098                 virtual ~EditorGroupItem();
00099 
00100 //              void  setLabel(QLabel *label) { m_label = label; }
00101                 QWidget*  label() const;
00102 
00103         protected:
00104                 virtual void init(const QString &icon);
00105 
00107                 virtual void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align);
00108                 virtual void setup();
00109                 virtual int compare( Q3ListViewItem *i, int col, bool ascending ) const;
00110 
00111                 GroupWidget *m_label;
00112                 int m_sortOrder;
00113 };
00114 
00116 class EditorDummyItem : public EditorItem
00117 {
00118         public:
00119                 EditorDummyItem(K3ListView *parent);
00120                 virtual ~EditorDummyItem();
00121 
00122         protected:
00123                 virtual void setup();
00124                 /*virtual void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align);
00125                 virtual void paintFocus(QPainter * p, const QColorGroup & cg, const QRect & r);*/
00126 };
00127 
00128 }
00129 
00130 #endif

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1