lib

editoritem.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
4 Copyright (C) 2004-2006 Jaroslaw Staniek <js@iidea.pl>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KPROPERTY_PROPERTYEDITORITEM_H
23#define KPROPERTY_PROPERTYEDITORITEM_H
24
25#include "koproperty_global.h"
26#include <tdelistview.h>
27
28#define KPROPEDITOR_ITEM_MARGIN 2
29#define KPROPEDITOR_ITEM_BORDER_COLOR TQColor(200,200,200)
30
31template<class U> class TQAsciiDict;
32class TQLabel;
33
34namespace KoProperty {
35
36class EditorItemPrivate;
37class Property;
38class Editor;
39class GroupWidget;
40
48{
49 public:
50 typedef TQAsciiDict<EditorItem> Dict;
51
55 EditorItem(Editor *editor, EditorItem *parent, Property *property,
56 TQListViewItem *after=0);
57
59 EditorItem(TDEListView *parent);
60 EditorItem(EditorItem *parent, const TQString &text);
61 EditorItem(EditorItem *parent, EditorItem *after, const TQString &text);
62
63 virtual ~EditorItem();
64
67
68 protected:
72 virtual void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align);
73
77 virtual void paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h);
78
79 virtual void paintFocus(TQPainter * p, const TQColorGroup & cg, const TQRect & r);
80
81 virtual int compare( TQListViewItem *i, int col, bool ascending ) const;
82
83 virtual void setHeight( int height );
84
85 protected:
86 EditorItemPrivate *d;
87};
88
90class EditorGroupItem : public EditorItem
91{
92 public:
93 EditorGroupItem(EditorItem *parent, EditorItem *after, const TQString &text,
94 const TQString &icon, int sortOrder);
95 EditorGroupItem(EditorItem *parent, const TQString &text,
96 const TQString &icon, int sortOrder);
97 virtual ~EditorGroupItem();
98
99// void setLabel(TQLabel *label) { m_label = label; }
100 TQWidget* label() const;
101
102 protected:
103 virtual void init(const TQString &icon);
104
106 virtual void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align);
107 virtual void setup();
108 virtual int compare( TQListViewItem *i, int col, bool ascending ) const;
109
110 GroupWidget *m_label;
111 int m_sortOrder;
112};
113
115class EditorDummyItem : public EditorItem
116{
117 public:
118 EditorDummyItem(TDEListView *parent);
119 virtual ~EditorDummyItem();
120
121 protected:
122 virtual void setup();
123 /*virtual void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align);
124 virtual void paintFocus(TQPainter * p, const TQColorGroup & cg, const TQRect & r);*/
125};
126
127}
128
129#endif
Item for a single property displayed within Editor object.
Definition editoritem.h:48
EditorItem(Editor *editor, EditorItem *parent, Property *property, TQListViewItem *after=0)
virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align)
virtual void paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h)
A listview to edit properties Editor widgets use property options using Property::option(const char *...
Definition editor.h:64
The base class representing a single property.
Definition property.h:177
TDEListViewItem(TQListView *parent)
Namespace for a set of classes implementing generic properties framework.