.TH "KDockMainWindow" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDockMainWindow \- A special kind of \fBKMainWindow\fP that is able to have dockwidget child widgets (and member of the dockwidget class set).  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdockwidget.h>\fP
.PP
Inherits \fBKMainWindow\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBdockWidgetHasUndocked\fP (\fBKDockWidget\fP *)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDockMainWindow\fP (\fBQWidget\fP *parent=0L, const char *name=0L, WFlags f=WType_TopLevel|WDestructiveClose)"
.br
.ti -1c
.RI "virtual \fB~KDockMainWindow\fP ()"
.br
.ti -1c
.RI "\fBKDockManager\fP * \fBmanager\fP () const "
.br
.ti -1c
.RI "void \fBsetMainDockWidget\fP (\fBKDockWidget\fP *dockwidget)"
.br
.ti -1c
.RI "\fBKDockWidget\fP * \fBgetMainDockWidget\fP () const "
.br
.ti -1c
.RI "\fBKDockWidget\fP * \fBcreateDockWidget\fP (const \fBQString\fP &name, const \fBQPixmap\fP &pixmap, \fBQWidget\fP *parent=0L, const \fBQString\fP &strCaption=QString::null, const \fBQString\fP &strTabPageLabel=\fBQString::fromLatin1\fP(' '))"
.br
.ti -1c
.RI "void \fBwriteDockConfig\fP (\fBQDomElement\fP &base)"
.br
.ti -1c
.RI "void \fBreadDockConfig\fP (\fBQDomElement\fP &base)"
.br
.ti -1c
.RI "void \fBwriteDockConfig\fP (\fBKConfig\fP *c=0L, \fBQString\fP group=QString::null)"
.br
.ti -1c
.RI "void \fBreadDockConfig\fP (\fBKConfig\fP *c=0L, \fBQString\fP group=QString::null)"
.br
.ti -1c
.RI "void \fBactivateDock\fP ()"
.br
.ti -1c
.RI "\fBQPopupMenu\fP * \fBdockHideShowMenu\fP () const "
.br
.ti -1c
.RI "void \fBmakeDockVisible\fP (\fBKDockWidget\fP *dock)"
.br
.ti -1c
.RI "void \fBmakeDockInvisible\fP (\fBKDockWidget\fP *dock)"
.br
.ti -1c
.RI "void \fBmakeWidgetDockVisible\fP (\fBQWidget\fP *widget)"
.br
.ti -1c
.RI "void \fBsetView\fP (\fBQWidget\fP *widget)"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotDockWidgetUndocked\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKDockWidget\fP * \fBmainDockWidget\fP"
.br
.ti -1c
.RI "\fBKDockManager\fP * \fBdockManager\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKDockManager\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A special kind of \fBKMainWindow\fP that is able to have dockwidget child widgets (and member of the dockwidget class set). 

The main widget should be a \fBKDockWidget\fP where other \fBKDockWidget\fP can be docked to the left, right, top, bottom or to the middle. Note: dock to the middle means to drop on a dockwidget and to unite them to a new widget, a tab control.
.PP
Furthermore, the KDockMainWindow has got the \fBKDockManager\fP and some data about the dock states.
.PP
If you've got some dockwidgets, you can dock them to the dockmainwindow to initialize a start scene: Here an example: 
.PP
.nf
 DockApplication::DockApplication( const char* name) : KDockMainWindow( name)
 {
   ...
   KDockWidget* mainDock;
   mainDock = createDockWidget( 'Falk's MainDockWidget', mainPixmap, 0L, 'main_dock_widget');
   AnyContentsWidget* cw = new AnyContentsWidget( mainDock);
   mainDock->setWidget( cw);
   // allow others to dock to the 4 sides
   mainDock->setDockSite(KDockWidget::DockCorner);
   // forbit docking abilities of mainDock itself
   mainDock->setEnableDocking(KDockWidget::DockNone);
   setView( mainDock); // central widget in a KDE mainwindow
   setMainDockWidget( mainDock); // master dockwidget
   ...
   KDockWidget* dockLeft;
   dockLeft = createDockWidget( 'Intially left one', anyOtherPixmap, 0L, i18n('The left dockwidget'));
   AnotherWidget* aw = new AnotherWidget( dockLeft);
   dockLeft->setWidget( aw);
   dockLeft->manualDock( mainDock,              // dock target
                         KDockWidget::DockLeft, // dock site
                         20 );                  // relation target/this (in percent)
   ...

.fi
.PP
.PP
Docking is fully dynamic at runtime. That means you can always move dockwidgets via drag and drop.
.PP
And last but not least you can use the popupmenu for showing or hiding any controlled dockwidget of this class and insert it to your main menu bar or anywhere else.
.PP
\fBAuthor:\fP
.RS 4
Max Judin (documentation: Falk Brettschneider). 
.RE
.PP

.PP
Definition at line 1300 of file kdockwidget.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDockMainWindow::KDockMainWindow (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP, WFlags f = \fCWType_TopLevel|WDestructiveClose\fP)"
.PP
Constructs a dockmainwindow. 
.PP
It calls its base class constructor and does additional things concerning to the dock stuff: 
.PD 0

.IP "\(bu" 2
information about the dock state of this' children gets initialized 
.IP "\(bu" 2
a dockmanager is created... 
.IP "\(bu" 2
...and gets initialized 
.IP "\(bu" 2
the main dockwidget is set to 0
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP Parent widget for the dock main widget 
.br
\fIname\fP internal object name 
.br
\fIf\fP Qt::WidgetFlags widget flags 
.RE
.PP

.PP
Definition at line 102 of file kdockwidget.cpp.
.PP
References dockManager, QString::latin1(), and mainDockWidget.
.SS "KDockMainWindow::~\fBKDockMainWindow\fP ()\fC [virtual]\fP"
.PP
Destructs a dockmainwindow. 
.PP
Definition at line 110 of file kdockwidget.cpp.
.PP
References dockManager.
.SH "Member Function Documentation"
.PP 
.SS "\fBKDockManager\fP* KDockMainWindow::manager () const\fC [inline]\fP"
.PP
Returns the dockmanager of this. 
.PP
(see \fBKDockManager\fP) 
.PP
\fBReturns:\fP
.RS 4
pointer to the wanted dockmanager 
.RE
.PP

.PP
Definition at line 1331 of file kdockwidget.h.
.SS "void KDockMainWindow::setMainDockWidget (\fBKDockWidget\fP * dockwidget)"
.PP
Sets a new main dockwidget. 
.PP
Additionally, the toolbar is re-initialized.
.PP
\fBParameters:\fP
.RS 4
\fIdockwidget\fP dockwidget that become the new main dockwidget 
.RE
.PP

.PP
Definition at line 115 of file kdockwidget.cpp.
.PP
References dockManager, mainDockWidget, and KDockManager::setMainDockWidget2().
.PP
Referenced by KDockManager::readConfig().
.SS "\fBKDockWidget\fP* KDockMainWindow::getMainDockWidget () const\fC [inline]\fP"
.PP
Returns the main dockwidget. 
.PP
\fBReturns:\fP
.RS 4
pointer to the main dockwidget 
.RE
.PP

.PP
Definition at line 1346 of file kdockwidget.h.
.PP
Referenced by KDockManager::writeConfig().
.SS "\fBKDockWidget\fP * KDockMainWindow::createDockWidget (const \fBQString\fP & name, const \fBQPixmap\fP & pixmap, \fBQWidget\fP * parent = \fC0L\fP, const \fBQString\fP & strCaption = \fCQString::null\fP, const \fBQString\fP & strTabPageLabel = \fC\fBQString::fromLatin1\fP(' ')\fP)"
.PP
This is one of the most important methods! The KDockMainWindow creates a new dockwidget object here that usually should encapsulate the user's widget. 
.PP
The new dockwidget is automatically taken under control by the dockmanager of the dockmainwindow.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP \fBQObject\fP name (default dockwidget caption) 
.br
\fIpixmap\fP window icon (for instance shown when docked as tabwidget entry) 
.br
\fIparent\fP parent widget for the new dockwidget 
.br
\fIstrCaption\fP window title (shown when toplevel) 
.br
\fIstrTabPageLabel\fP title of the tab page (visible when in tab page mode), if it is '', only the icon will be shown; if it is 0L, the label is set to strCaption 
.RE
.PP
\fBReturns:\fP
.RS 4
a pointer to the new created dockwidget 
.RE
.PP

.PP
Definition at line 135 of file kdockwidget.cpp.
.PP
References dockManager, and QString::latin1().
.SS "void KDockMainWindow::writeDockConfig (\fBQDomElement\fP & base)"
.PP
Saves the current dock window layout into a DOM tree below the given element. 
.PP
Definition at line 157 of file kdockwidget.cpp.
.PP
References dockManager, and KDockManager::writeConfig().
.SS "void KDockMainWindow::readDockConfig (\fBQDomElement\fP & base)"
.PP
Reads the current dock window layout from a DOM tree below the given element. 
.PP
Definition at line 162 of file kdockwidget.cpp.
.PP
References dockManager, and KDockManager::readConfig().
.SS "void KDockMainWindow::writeDockConfig (\fBKConfig\fP * c = \fC0L\fP, \fBQString\fP group = \fCQString::null\fP)"
.PP
It writes the current dock state in the given section of \fBKConfig\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIc\fP \fBKDE\fP class for saving configurations 
.br
\fIgroup\fP name of section to write to 
.RE
.PP

.PP
Definition at line 168 of file kdockwidget.cpp.
.PP
References dockManager, and KDockManager::writeConfig().
.SS "void KDockMainWindow::readDockConfig (\fBKConfig\fP * c = \fC0L\fP, \fBQString\fP group = \fCQString::null\fP)"
.PP
It reads the current dock state from the given section of \fBKConfig\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIc\fP \fBKDE\fP class for saving configurations 
.br
\fIgroup\fP name of section to read from 
.RE
.PP

.PP
Definition at line 173 of file kdockwidget.cpp.
.PP
References dockManager, and KDockManager::readConfig().
.SS "void KDockMainWindow::activateDock ()\fC [inline]\fP"
.PP
It runs through all dockwidgets which are under control of the dockmanager and calls \fBshow()\fP for every encapsulated widget and \fBshow()\fP for the dockwidget itself if it is not in tab mode. 
.PP
Additionally, if the main dockwidget is not a \fBQDialog\fP, it will be shown. 
.PP
Definition at line 1395 of file kdockwidget.h.
.SS "\fBQPopupMenu\fP* KDockMainWindow::dockHideShowMenu () const\fC [inline]\fP"
.PP
Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible. 
.PP
\fBReturns:\fP
.RS 4
the wanted popup menu 
.RE
.PP

.PP
Definition at line 1403 of file kdockwidget.h.
.SS "void KDockMainWindow::makeDockVisible (\fBKDockWidget\fP * dock)"
.PP
This method shows the given dockwidget. 
.PP
The clue is that it also considers the dockwidget could be a tab page and must set to be the activate one.
.PP
\fBParameters:\fP
.RS 4
\fIdock\fP the dockwidget that is to be shown 
.RE
.PP

.PP
Definition at line 140 of file kdockwidget.cpp.
.PP
References KDockWidget::makeDockVisible().
.PP
Referenced by makeWidgetDockVisible().
.SS "void KDockMainWindow::makeDockInvisible (\fBKDockWidget\fP * dock)"
.PP
This method hides the given dockwidget. 
.PP
\fBParameters:\fP
.RS 4
\fIdock\fP the dockwidget that is to be shown 
.RE
.PP

.PP
Definition at line 146 of file kdockwidget.cpp.
.PP
References KDockWidget::undock().
.SS "void KDockMainWindow::makeWidgetDockVisible (\fBQWidget\fP * widget)"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It differs from the above function only in what argument(s) it accepts. 
.PP
Definition at line 152 of file kdockwidget.cpp.
.PP
References dockManager, KDockManager::findWidgetParentDock(), and makeDockVisible().
.SS "void KDockMainWindow::setView (\fBQWidget\fP * widget)"
.PP
This method calls the base class method. 
.PP
If the given widget inherits \fBKDockWidget\fP, applyToWidget(this) is called.
.PP
\fBParameters:\fP
.RS 4
\fIwidget\fP any widget that should become the main view 
.RE
.PP

.PP
Definition at line 122 of file kdockwidget.cpp.
.PP
References QMainWindow::setCentralWidget().
.PP
Referenced by KDockManager::readConfig().
.SS "void KDockMainWindow::dockWidgetHasUndocked (\fBKDockWidget\fP *)\fC [signal]\fP"
.PP
Signals a certain dockwidget is undocked now. 
.PP
Referenced by slotDockWidgetUndocked().
.SS "void KDockMainWindow::slotDockWidgetUndocked ()\fC [protected, slot]\fP"
.PP
Called whenever one of the dockwidgets of this has been undocked. 
.PP
Definition at line 179 of file kdockwidget.cpp.
.PP
References dockWidgetHasUndocked(), and QObject::inherits().
.SH "Member Data Documentation"
.PP 
.SS "\fBKDockWidget\fP* \fBKDockMainWindow::mainDockWidget\fP\fC [protected]\fP"
.PP
A pointer to the main dockwidget (where one can manualDock() to. 
.PP
Definition at line 1446 of file kdockwidget.h.
.PP
Referenced by KDockMainWindow(), and setMainDockWidget().
.SS "\fBKDockManager\fP* \fBKDockMainWindow::dockManager\fP\fC [protected]\fP"
.PP
A pointer to the manager for the dock process. 
.PP
Definition at line 1451 of file kdockwidget.h.
.PP
Referenced by createDockWidget(), KDockMainWindow(), makeWidgetDockVisible(), readDockConfig(), setMainDockWidget(), writeDockConfig(), and ~KDockMainWindow().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
