blob: bae0f3ff9ff4f7ca29abb5eb1f78c3eb20b762a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
/***************************************************************************
tagattributetree.h
-------------------
copyright : (C) 2003 by 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; version 2 of the License. *
* *
***************************************************************************/
#ifndef TAGATTRIBUTETREE_H
#define TAGATTRIBUTETREE_H
//qt includes
#include <qwidget.h>
//kde includes
#include <klistview.h>
//app includes
class KListView;
class QListViewItem;
class ParentItem;
class Node;
class QLabel;
class KPushButton;
class QGridLayout;
class EditableTree : public KListView {
Q_OBJECT
public:
EditableTree(QWidget *parent = 0, const char *name = 0);
virtual ~EditableTree();
virtual void setCurrentItem( QListViewItem *i);
void setEditable(bool b) {m_editable = b;}
bool isEditable() {return m_editable;}
public slots:
virtual void editorContentChanged();
virtual void focusInEvent(QFocusEvent *);
virtual void focusOutEvent(QFocusEvent *);
protected:
bool m_editable;
};
class DualEditableTree : public EditableTree
{
Q_OBJECT
public:
DualEditableTree(QWidget *parent = 0, const char *name = 0);
virtual ~DualEditableTree();
virtual void setCurrentItem ( QListViewItem *i);
int currentColumn() {return curCol;}
protected:
virtual bool eventFilter(QObject *object, QEvent *event);
virtual void resizeEvent(QResizeEvent *);
signals:
void itemModified( QListViewItem *);
public slots:
virtual void editorContentChanged();
private slots:
void itemClicked(QListViewItem *i, const QPoint &point, int col);
private:
int curCol;
};
class TagAttributeTree : public EditableTree {
Q_OBJECT
public:
TagAttributeTree(QWidget *parent=0, const char *name=0);
virtual ~TagAttributeTree();
void setCurrentNode(Node *node);
//virtual void setCurrentItem( QListViewItem *i );
Node *node() const {return m_node;}
public slots:
void slotDelayedSetCurrentNode();
void slotParentSelected(int index);
virtual void editorContentChanged();
private slots:
void slotCollapsed(QListViewItem *item);
void slotExpanded(QListViewItem *item);
signals:
void newNodeSelected(Node *node);
private:
Node *m_node;
Node *m_newNode;
bool rebuildEnabled;
ParentItem *m_parentItem;
};
//An enhanced TagAttributeTree with the tag name and buttons to delete the tag.
class EnhancedTagAttributeTree : public QWidget
{
Q_OBJECT
public:
EnhancedTagAttributeTree(QWidget *parent = 0, const char *name = 0);
virtual ~EnhancedTagAttributeTree();
void setCurrentNode(Node *node);
Node *node() const {return attrTree->node();}
signals:
void newNodeSelected(Node *node);
private slots:
void NodeSelected(Node *node);
void deleteNode();
void deleteSubTree();
private:
void showCaption();
QLabel *nodeName;
KPushButton* deleteAll;
KPushButton* deleteTag;
TagAttributeTree *attrTree;
QGridLayout *widgetLayout;
Node *curNode;
};
#endif
|