kivio

kivio_layer_panel.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef KIVIOLAYERPANEL_H
00020 #define KIVIOLAYERPANEL_H
00021 
00022 class KAction;
00023 
00024 class KivioView;
00025 class KivioLayer;
00026 
00027 #include <qlistview.h>
00028 
00029 #include "kivio_layer_panel_base.h"
00030 
00031 class KivioLayerItem: public QListViewItem
00032 {
00033   friend class KivioLayerPanel;
00034   public:
00035     KivioLayerItem(QListView* parent, KivioLayer*, int id);
00036     ~KivioLayerItem();
00037 
00038     KivioLayer* layer() const { return data; }
00039 
00040   protected:
00041     void update();
00042 
00043   private:
00044     KivioLayer* data;
00045 };
00046 
00047 
00048 /*********************************************************/
00049 class KivioLayerPanel : public KivioLayerPanelBase
00050 {
00051   Q_OBJECT
00052   public:
00053     KivioLayerPanel(KivioView* view, QWidget* parent=0, const char* name=0);
00054     ~KivioLayerPanel();
00055 
00056     bool eventFilter(QObject*, QEvent*);
00057 
00058   public slots:
00059     void reset();
00060 
00061   protected slots:
00062     void addItem();
00063     void removeItem();
00064     void renameItem();
00065     void upItem();
00066     void downItem();
00067 
00068     void itemClicked(QListViewItem*, const QPoint&, int);
00069     void itemActivated(QListViewItem*);
00070     void updateButtons(QListViewItem*);
00071 
00072   private:
00073     KivioView* m_pView;
00074 
00075     KAction* actNew;
00076     KAction* actDel;
00077     KAction* actRename;
00078     KAction* actUp;
00079     KAction* actDown;
00080 
00081     int id;
00082 };
00083 
00084 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys