class KDockManager

# class KDockManager | The manager that knows all dockwidgets and handles the dock process (and member of the dockwidget class set). More...
Definition | `#include <include/kdockwidget.h>`
Inherits | QObject (unknown) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KDockManager ( QWidget* mainWindow, const char* name = 0L )
- virtual ~KDockManager ()
- void writeConfig ( KConfig* c = 0L, QString group = QString::null )
- void readConfig ( KConfig* c = 0L, QString group = QString::null )
- void writeConfig (QDomElement &base)
- void readConfig (QDomElement &base)
- void activate ()
- virtual bool eventFilter ( QObject *, QEvent * )
- KDockWidget* findWidgetParentDock ( QWidget* w)
- void makeWidgetDockVisible ( QWidget* w )
- QPopupMenu* dockHideShowMenu ()
- KDockWidget* getDockWidgetFromName ( const QString& dockName )
- void setSplitterOpaqueResize (bool b=true)
- bool splitterOpaqueResize () const
- void setSplitterKeepSize (bool b=true)
- bool splitterKeepSize () const
- void setSplitterHighResolution (bool b=true)
- bool splitterHighResolution () const

#### Signals

- void change ()
- void replaceDock ( KDockWidget* oldDock, KDockWidget* newDock )
- void setDockDefaultPos ( KDockWidget* )

#### Private Types

- struct MenuDockData

#### Private Methods

- KDockWidget* findDockWidgetAt ( const QPoint& pos )
- void findChildDockWidget ( QWidget*& w, const QWidget* p, const QPoint& pos )
- void findChildDockWidget ( const QWidget* p, WidgetList*& l)
- void startDrag ( KDockWidget* )
- void dragMove ( KDockWidget* d, QPoint pos )
- void cancelDrop ()
- void drop ()

#### Private Slots

- void slotMenuPopup ()
- void slotMenuActivated ( int id)
- void drawDragRectangle ()

#### Private Members

- friend class KDockWidget
- friend class KDockMainWindow
- QWidget* main
- KDockMoveManager* mg
- KDockWidget* currentDragWidget
- KDockWidget* currentMoveWidget
- WidgetList* childDockWidgetList
- KDockWidget::DockPosition curPos
- QObjectList* childDock
- QObjectList* autoCreateDock
- int storeW
- int storeH
- bool draging
- bool undockProcess
- bool dropCancel
- QPopupMenu* menu
- QList *menuData
- Forward KDockManagerPrivate
- KDockManagerPrivate *d

## Detailed Description

The manager that knows all dockwidgets and handles the dock process (and member of the dockwidget class set). More or less a helper class for the KDockWidget class set but of interest for some functionality that can be called within a KDockMainWindow or a KDockWidget .

An important feature is the ability to read or save the current state of all things concerning to dockwidgets to KConfig .

The dockmanager is also often used when a certain dockwidget or a child of such dockwidget must be found.

friend class KDockWidget | ### KDockWidget

[private]

friend class KDockMainWindow | ### KDockMainWindow

[private]

KDockManager ( QWidget* mainWindow, const char* name = 0L ) | ### KDockManager

Constructs a dockmanager. Some initialization happen:

- It installs an event filter for the main window,
- a control list for dock objects
- a control list for menu items concerning to menus provided by the dockmanager
- Some state variables are set

Parameters:

mainWindow | the main window controlled by this
name | the internal QOject name

~KDockManager () | ### ~KDockManager

[virtual]

Destructs a dockmanager.

void writeConfig ( KConfig* c = 0L, QString group = QString::null ) | ### writeConfig

Saves the current state of the dockmanager and of all controlled widgets. State means here to save the geometry, visibility, parents, internal object names, orientation, separator positions, dockwidget-group information, tab widget states (if it is a tab group) and last but not least some necessary things for recovering the dockmainwindow state.

Parameters:

c | the KDE configuration saver
group | the name of the section in KConfig

void readConfig ( KConfig* c = 0L, QString group = QString::null ) | ### readConfig

Like writeConfig but reads the whole stuff in.

In order to restore a window configuration from a config file, it looks up widgets by name (QObject::name) in the childDock variable of KDockManager. This list in turn contains all KDockWidgets (according to the KDockWidget constructor). So in principle, in order to restore a window layout, one must first construct all widgets, put each of them in a KDockWidget and then call readConfig(). And for all that to work, each widget must have a unique name.

Parameters:

c | the KDE configuration saver
group | the name of the section in KConfig

void writeConfig (QDomElement &base) | ### writeConfig

Saves the current dock window layout into a DOM tree below the given element.

void readConfig (QDomElement &base) | ### readConfig

Reads the current dock window layout from a DOM tree below the given element.

void activate () | ### activate

Shows all encapsulated widgets of all controlled dockwidgets and shows all dockwidgets which are parent of a dockwidget tab group.

bool eventFilter ( QObject *, QEvent * ) | ### eventFilter

[virtual]

It's more or less a method that catches several events which are interesting for the dockmanager. Mainly mouse events during the drag process of a dockwidgets are of interest here.

Parameters:

_ | the object that sends the event
_ | the event

Returns: the return value of the method call of the base class method

KDockWidget* findWidgetParentDock ( QWidget* w) | ### findWidgetParentDock

This method finds out what a widgets' dockwidget is. That means the dockmanager has a look at all dockwidgets it knows and tells you when one of those dockwidgets covers the given widget.

Parameters:

w | any widget that is supposed to be encapsulated by one of the controlled dockwidgets

Returns: the dockwidget that encapsulates that widget, otherwise 0

void makeWidgetDockVisible ( QWidget* w ) | ### makeWidgetDockVisible

Works like makeDockVisible() but can be called for widgets that covered by a dockwidget.

Parameters:

w | the widget that is encapsulated by a dockwidget that turns to visible.

QPopupMenu* dockHideShowMenu () | ### dockHideShowMenu

Returns: the popupmenu for showing/hiding dockwidgets

KDockWidget* getDockWidgetFromName ( const QString& dockName ) | ### getDockWidgetFromName

Parameters:

dockName | an internal QObject name

Returns: the dockwidget that has got that internal QObject name

void setSplitterOpaqueResize (bool b=true) | ### setSplitterOpaqueResize

Enables opaque resizing. Opaque resizing is initially turned off. Call this method before you create any dock widgets!

bool splitterOpaqueResize () | ### splitterOpaqueResize

[const]

Returns TRUE if opaque resizing is enabled, FALSE otherwise.

void setSplitterKeepSize (bool b=true) | ### setSplitterKeepSize

Try to preserve the widget's size. Works like KeepSize resize mode of QSplitter. Off by default. Call this method before you create any dock widgets!

bool splitterKeepSize () | ### splitterKeepSize

[const]

Returns TRUE if the KeepSize is enabled, FALSE otherwise.

void setSplitterHighResolution (bool b=true) | ### setSplitterHighResolution

Operate the splitter with a higher resolution. Off by default. Call this method before you create any dock widgets! If high resolution is used all splitter position parameters are percent*100 instead of percent.

bool splitterHighResolution () | ### splitterHighResolution

[const]

Returns TRUE if the splitter uses the high resolution, FALSE otherwise.

void change () | ### change

[signal]

Signals changes of the docking state of a dockwidget. Usually the dock-toolbar will be updated then.

void replaceDock ( KDockWidget* oldDock, KDockWidget* newDock ) | ### replaceDock

[signal]

Signals a dockwidget is replaced with another one.

void setDockDefaultPos ( KDockWidget* ) | ### setDockDefaultPos

[signal]

Signals a dockwidget without parent (toplevel) is shown.

void slotMenuPopup () | ### slotMenuPopup

[private slots slot]

Clears the popupmenu for showing/hiding dockwidgets and fills it with the current states of all controlled dockwidgets.

void slotMenuActivated ( int id) | ### slotMenuActivated

[private slots slot]

This method assumes a menuitem of the popupmenu for showing/hiding dockwidgets is selected and toggles that state.

Parameters:

id | the popupmenu id of the selected menuitem

void drawDragRectangle () | ### drawDragRectangle

[private slots slot]

MenuDockData (struct) | ### MenuDockData

[private]

A data structure containing data about every dockwidget that is under control.

KDockWidget* findDockWidgetAt ( const QPoint& pos ) | ### findDockWidgetAt

[private]

Finds the KDockWidget at the position given as parameter

Parameters:

pos | global (desktop) position of the wanted dockwidget

Returns: the dockwidget at that position

void findChildDockWidget ( QWidget*& w, const QWidget* p, const QPoint& pos ) | ### findChildDockWidget

[private]

Finds the QWidget recursively at the position given as parameter

Parameters:

w | a variable where the method puts the QWidget at that position (instead of a return value)
p | the parent widget where the recursive search should start from
pos | global (desktop) position of the wanted dockwidget

void findChildDockWidget ( const QWidget* p, WidgetList*& l) | ### findChildDockWidget

[private]

Finds all dockwidgets which are child, grandchild and so on of p.

Parameters:

p | the parent widget where the recursive search starts from
l | the widget list that contains the search result after the return of this method

void startDrag ( KDockWidget* ) | ### startDrag

[private]

Sets a dockwidget in drag mode.

void dragMove ( KDockWidget* d, QPoint pos ) | ### dragMove

[private]

Moves a dockwidget that is in drag mode.

Parameters:

d | the dockwidget which is dragged
pos | the new position of the dragged dockwidget

void cancelDrop () | ### cancelDrop

[private]

Aborts the drag mode. Restores the cursor and hides the drag indicator.

void drop () | ### drop

[private]

Finishes the drag mode. If the user let it drop on an other dockwidget, it will possibly be docked (if allowed), if the user drops it outside of the application window it becomes toplevel.

QWidget* main | ### main

[private]

KDockMoveManager* mg | ### mg

[private]

KDockWidget* currentDragWidget | ### currentDragWidget

[private]

KDockWidget* currentMoveWidget | ### currentMoveWidget

[private]

WidgetList* childDockWidgetList | ### childDockWidgetList

[private]

KDockWidget::DockPosition curPos | ### curPos

[private]

QObjectList* childDock | ### childDock

[private]

QObjectList* autoCreateDock | ### autoCreateDock

[private]

int storeW | ### storeW

[private]

int storeH | ### storeH

[private]

bool draging | ### draging

[private]

bool undockProcess | ### undockProcess

[private]

bool dropCancel | ### dropCancel

[private]

QPopupMenu* menu | ### menu

[private]

QList * menuData | ### menuData

[private]

KDockManagerPrivate * d | ### d

[private]

- Author: Max Judin (documentation: Falk Brettschneider).
- Generated: falk on pc9 on Fri Nov 30 14:44:26 2001, using kdoc 2.0a53.