dockcontainer.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002, 2003 Joseph Wenninger <jowenn@kde.org> 00003 Copyright (C) 2002, 2004 Christoph Cullmann <cullmann@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _TDEMDI_DOCK_CONTAINER_ 00021 #define _TDEMDI_DOCK_CONTAINER_ 00022 00023 #include <tqwidget.h> 00024 #include <tqstringlist.h> 00025 #include <kdockwidget.h> 00026 #include <tqmap.h> 00027 00028 # include <kdockwidget_p.h> 00029 00030 #include <tqpushbutton.h> 00031 00032 class TQWidgetStack; 00033 class KMultiTabBar; 00034 class KDockButton_Private; 00035 00036 namespace KMDI 00037 { 00038 00039 class DockContainer: public TQWidget, public KDockContainer 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 DockContainer(TQWidget *parent, TQWidget *win, int position, int flags); 00045 virtual ~DockContainer(); 00046 00048 KDockWidget *parentDockWidget(); 00049 00055 virtual void insertWidget (KDockWidget *w, TQPixmap, const TQString &, int &); 00056 00061 virtual void showWidget (KDockWidget *w); 00062 00069 virtual void setToolTip (KDockWidget *, TQString &); 00070 00076 virtual void setPixmap(KDockWidget* widget, const TQPixmap& pixmap); 00077 00083 virtual void undockWidget(KDockWidget* dwdg); 00084 00090 virtual void removeWidget(KDockWidget*); 00091 00092 void hideIfNeeded(); 00093 00094 virtual void save(TDEConfig *,const TQString& group_or_prefix); 00095 virtual void load(TDEConfig *,const TQString& group_or_prefix); 00096 00097 void setStyle(int); 00098 protected: 00099 bool eventFilter(TQObject*,TQEvent*); 00100 00101 public slots: 00102 void init(); 00103 void collapseOverlapped(); 00104 void toggle(); 00105 void nextToolView(); 00106 void prevToolView(); 00107 protected slots: 00108 void tabClicked(int); 00109 void delayedRaise(); 00110 void changeOverlapMode(); 00111 private: 00112 TQWidget *m_mainWin; 00113 TQWidgetStack *m_ws; 00114 KMultiTabBar *m_tb; 00115 int mTabCnt; 00116 int oldtab; 00117 int m_previousTab; 00118 int m_position; 00119 int m_separatorPos; 00120 TQMap<KDockWidget*,int> m_map; 00121 TQMap<int,KDockWidget*> m_revMap; 00122 TQMap<KDockWidget*,KDockButton_Private*> m_overlapButtons; 00123 TQStringList itemNames; 00124 TQMap<TQString,TQString> tabCaptions; 00125 TQMap<TQString,TQString> tabTooltips; 00126 int m_inserted; 00127 int m_delayedRaise; 00128 bool m_vertical; 00129 bool m_block; 00130 bool m_tabSwitching; 00131 TQObject *m_dragPanel; 00132 KDockManager *m_dockManager; 00133 TQMouseEvent *m_startEvent; 00134 enum MovingState {NotMoving=0,WaitingForMoveStart,MovingInternal,Moving} m_movingState; 00135 signals: 00136 void activated(DockContainer*); 00137 void deactivated(DockContainer*); 00138 }; 00139 00140 } 00141 00142 #endif 00143 00144 // kate: space-indent on; indent-width 2; replace-tabs on;