kivio_layer_panel.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIVIOLAYERPANEL_H
20#define KIVIOLAYERPANEL_H
21
22class TDEAction;
23
24class KivioView;
25class KivioLayer;
26
27#include <tqlistview.h>
28
29#include "kivio_layer_panel_base.h"
30
31class KivioLayerItem: public TQListViewItem
32{
33 friend class KivioLayerPanel;
34 public:
35 KivioLayerItem(TQListView* parent, KivioLayer*, int id);
36 ~KivioLayerItem();
37
38 KivioLayer* layer() const { return data; }
39
40 protected:
41 void update();
42
43 private:
44 KivioLayer* data;
45};
46
47
48/*********************************************************/
49class KivioLayerPanel : public KivioLayerPanelBase
50{
51 TQ_OBJECT
52
53 public:
54 KivioLayerPanel(KivioView* view, TQWidget* parent=0, const char* name=0);
55 ~KivioLayerPanel();
56
57 bool eventFilter(TQObject*, TQEvent*);
58
59 public slots:
60 void reset();
61
62 protected slots:
63 void addItem();
64 void removeItem();
65 void renameItem();
66 void upItem();
67 void downItem();
68
69 void itemClicked(TQListViewItem*, const TQPoint&, int);
70 void itemActivated(TQListViewItem*);
71 void updateButtons(TQListViewItem*);
72
73 private:
74 KivioView* m_pView;
75
76 TDEAction* actNew;
77 TDEAction* actDel;
78 TDEAction* actRename;
79 TDEAction* actUp;
80 TDEAction* actDown;
81
82 int id;
83};
84
85#endif