You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
169 lines
4.4 KiB
169 lines
4.4 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2002 Christoph Cullmann <cullmann@kde.org>
|
||
|
Copyright (C) 2002,2003 Joseph Wenninger <jowenn@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License version 2 as published by the Free Software Foundation.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef _KMDI_DOCK_CONTAINER_
|
||
|
#define _KMDI_DOCK_CONTAINER_
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
|
#include <tqstringlist.h>
|
||
15 years ago
|
#include <kdockwidget.h>
|
||
15 years ago
|
#include <tqmap.h>
|
||
|
#include <tqdom.h>
|
||
15 years ago
|
|
||
|
# include <kdockwidget_p.h>
|
||
|
|
||
15 years ago
|
#include <tqpushbutton.h>
|
||
15 years ago
|
|
||
15 years ago
|
class TQWidgetStack;
|
||
15 years ago
|
class KMultiTabBar;
|
||
|
class KDockButton_Private;
|
||
|
|
||
15 years ago
|
class KMDI_EXPORT KMdiDockContainer: public TQWidget, public KDockContainer
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
public:
|
||
14 years ago
|
KMdiDockContainer( TQWidget *parent, TQWidget *win, int position, int flags );
|
||
15 years ago
|
virtual ~KMdiDockContainer();
|
||
|
|
||
14 years ago
|
/** Get the KDockWidget that is our parent */
|
||
14 years ago
|
KDockWidget *parentDockWidget();
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Add a widget to this container
|
||
|
* \param w the KDockWidget we are adding
|
||
|
*/
|
||
15 years ago
|
virtual void insertWidget ( KDockWidget *w, TQPixmap, const TQString &, int & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Show a widget.
|
||
|
*
|
||
|
* The widget has to belong to this container otherwise
|
||
|
* it will not be shown
|
||
|
* \param w the KDockWidget to show
|
||
|
*/
|
||
|
virtual void showWidget ( KDockWidget *w );
|
||
|
|
||
|
/**
|
||
|
* Set the tooltip for the widget.
|
||
|
* Currently, this method does nothing
|
||
|
*/
|
||
15 years ago
|
virtual void setToolTip ( KDockWidget *, TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Set the pixmap for the widget.
|
||
|
*/
|
||
15 years ago
|
virtual void setPixmap( KDockWidget* widget, const TQPixmap& pixmap );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Undock the widget from the container.
|
||
|
*/
|
||
|
virtual void undockWidget( KDockWidget* dwdg );
|
||
|
|
||
|
/**
|
||
|
* Remove a widget from the container. The caller of this function
|
||
|
* is responsible for deleting the widget
|
||
|
*/
|
||
|
virtual void removeWidget( KDockWidget* );
|
||
|
|
||
|
/**
|
||
|
* Hide the the dock container if the number of items is 0
|
||
|
*/
|
||
|
void hideIfNeeded();
|
||
|
|
||
|
/**
|
||
12 years ago
|
* Save the config using a TDEConfig object
|
||
15 years ago
|
*
|
||
14 years ago
|
* The combination of the group_or_prefix variable and the parent
|
||
15 years ago
|
* dockwidget's name will be the group the configuration is saved in
|
||
14 years ago
|
* \param group_or_prefix the prefix to append to the parent dockwidget's name
|
||
15 years ago
|
*/
|
||
12 years ago
|
virtual void save( TDEConfig *, const TQString& group_or_prefix );
|
||
15 years ago
|
|
||
|
/**
|
||
12 years ago
|
* Load the config using a TDEConfig object
|
||
15 years ago
|
*
|
||
14 years ago
|
* The combination of the group_or_prefix variable and the parent
|
||
15 years ago
|
* dockwidget's name will be the group the configuration is loaded from
|
||
14 years ago
|
* \param group_or_prefix the prefix to append to the parent dockwidget's name
|
||
15 years ago
|
*/
|
||
12 years ago
|
virtual void load( TDEConfig *, const TQString& group_or_prefix );
|
||
15 years ago
|
|
||
|
/**
|
||
14 years ago
|
* Save the config to a TQDomElement
|
||
15 years ago
|
*/
|
||
15 years ago
|
virtual void save( TQDomElement& );
|
||
15 years ago
|
|
||
|
/**
|
||
14 years ago
|
* Load the config from a TQDomElement
|
||
15 years ago
|
*/
|
||
15 years ago
|
virtual void load( TQDomElement& );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Set the style for the tabbar
|
||
|
*/
|
||
|
void setStyle( int );
|
||
|
|
||
|
protected:
|
||
15 years ago
|
bool eventFilter( TQObject*, TQEvent* );
|
||
15 years ago
|
|
||
|
public slots:
|
||
|
void init();
|
||
|
void collapseOverlapped();
|
||
|
void toggle();
|
||
|
void nextToolView();
|
||
|
void prevToolView();
|
||
|
protected slots:
|
||
|
void tabClicked( int );
|
||
|
void delayedRaise();
|
||
|
void changeOverlapMode();
|
||
|
private:
|
||
15 years ago
|
TQWidget *m_mainWin;
|
||
|
TQWidgetStack *m_ws;
|
||
15 years ago
|
KMultiTabBar *m_tb;
|
||
|
int mTabCnt;
|
||
|
int oldtab;
|
||
|
int m_previousTab;
|
||
|
int m_position;
|
||
|
int m_separatorPos;
|
||
15 years ago
|
TQMap<KDockWidget*, int> m_map;
|
||
|
TQMap<int, KDockWidget*> m_revMap;
|
||
|
TQMap<KDockWidget*, KDockButton_Private*> m_overlapButtons;
|
||
|
TQStringList itemNames;
|
||
|
TQMap<TQString, TQString> tabCaptions;
|
||
|
TQMap<TQString, TQString> tabTooltips;
|
||
15 years ago
|
int m_inserted;
|
||
|
int m_delayedRaise;
|
||
|
bool m_horizontal;
|
||
|
bool m_block;
|
||
|
bool m_tabSwitching;
|
||
15 years ago
|
TQObject *m_dragPanel;
|
||
15 years ago
|
KDockManager *m_dockManager;
|
||
15 years ago
|
TQMouseEvent *m_startEvent;
|
||
15 years ago
|
enum MovingState {NotMoving = 0, WaitingForMoveStart, Moving} m_movingState;
|
||
|
signals:
|
||
|
void activated( KMdiDockContainer* );
|
||
|
void deactivated( KMdiDockContainer* );
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|
||
14 years ago
|
// kate: space-indent off; tab-width 4; replace-tabs off; indent-mode csands;
|