kivio
kivio_stackbar.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 KIVIO_STACK_BAR_H 00020 #define KIVIO_STACK_BAR_H 00021 00022 #include <qdockwindow.h> 00023 #include <qptrdict.h> 00024 00025 namespace Kivio { 00026 class DragBarButton; 00027 } 00028 00029 class KivioView; 00030 00031 using namespace Kivio; 00032 00033 class KivioStackBar : public QDockWindow 00034 { 00035 Q_OBJECT 00036 public: 00037 KivioStackBar(KivioView* view, QWidget* parent=0, const char* name=0); 00038 ~KivioStackBar(); 00039 00040 QWidget* findPage(const QString& name); 00041 QWidget* findPage(DragBarButton*); 00042 void insertPage(QWidget*, const QString&); 00043 void removePage(QWidget*); 00044 void deletePageAndButton(DragBarButton*); 00045 void showPage(QWidget*); 00046 00047 QWidget* visiblePage() const { return m_visiblePage; } 00048 00049 KivioView* view() const { return m_view; } 00050 00051 signals: 00052 void aboutToShow(QWidget*); 00053 void beginDragPage(DragBarButton*); 00054 void finishDragPage(DragBarButton*); 00055 void deleteButton(DragBarButton*, QWidget*, KivioStackBar*); 00056 00057 protected: 00058 virtual void closeEvent(QCloseEvent*); 00059 00060 protected slots: 00061 void showButtonPage(); 00062 void buttonBeginDrag(); 00063 void buttonFinishDrag(); 00064 void slotDeleteButton(DragBarButton*); 00065 void newPlace(QDockWindow::Place place); 00066 00067 private: 00068 QPtrDict<QWidget> m_data; 00069 QWidget* m_visiblePage; 00070 KivioView* m_view; 00071 }; 00072 00073 #endif