\section{KDock\-Main\-Window Class Reference}
\label{classKDockMainWindow}\index{KDockMainWindow@{KDockMainWindow}}
A special kind of {\bf KMain\-Window}{\rm (p.\,\pageref{classKMainWindow})} that is able to have dockwidget child widgets (and member of the dockwidget class set).  


{\tt \#include $<$kdockwidget.h$>$}

Inheritance diagram for KDock\-Main\-Window:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=165pt]{classKDockMainWindow__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KDock\-Main\-Window:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=220pt]{classKDockMainWindow__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf dock\-Widget\-Has\-Undocked} ({\bf KDock\-Widget} $\ast$)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDock\-Main\-Window} ({\bf QWidget} $\ast$parent=0L, const char $\ast$name=0L, WFlags f=WType\_\-Top\-Level$|$WDestructive\-Close)
\item 
virtual {\bf $\sim$KDock\-Main\-Window} ()
\item 
{\bf KDock\-Manager} $\ast$ {\bf manager} () const 
\item 
void {\bf set\-Main\-Dock\-Widget} ({\bf KDock\-Widget} $\ast$dockwidget)
\item 
{\bf KDock\-Widget} $\ast$ {\bf get\-Main\-Dock\-Widget} () const 
\item 
{\bf KDock\-Widget} $\ast$ {\bf create\-Dock\-Widget} (const {\bf QString} \&name, const {\bf QPixmap} \&pixmap, {\bf QWidget} $\ast$parent=0L, const {\bf QString} \&str\-Caption=QString::null, const {\bf QString} \&str\-Tab\-Page\-Label={\bf QString::from\-Latin1}(\char`\"{} \char`\"{}))
\item 
void {\bf write\-Dock\-Config} ({\bf QDom\-Element} \&base)
\item 
void {\bf read\-Dock\-Config} ({\bf QDom\-Element} \&base)
\item 
void {\bf write\-Dock\-Config} ({\bf KConfig} $\ast$c=0L, {\bf QString} group=QString::null)
\item 
void {\bf read\-Dock\-Config} ({\bf KConfig} $\ast$c=0L, {\bf QString} group=QString::null)
\item 
void {\bf activate\-Dock} ()
\item 
{\bf QPopup\-Menu} $\ast$ {\bf dock\-Hide\-Show\-Menu} () const 
\item 
void {\bf make\-Dock\-Visible} ({\bf KDock\-Widget} $\ast$dock)
\item 
void {\bf make\-Dock\-Invisible} ({\bf KDock\-Widget} $\ast$dock)
\item 
void {\bf make\-Widget\-Dock\-Visible} ({\bf QWidget} $\ast$widget)
\item 
void {\bf set\-View} ({\bf QWidget} $\ast$widget)
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Dock\-Widget\-Undocked} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKDockMainWindow_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KDock\-Widget} $\ast$ {\bf main\-Dock\-Widget}
\item 
{\bf KDock\-Manager} $\ast$ {\bf dock\-Manager}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KDock\-Manager}\label{classKDockMainWindow_n0}

\end{CompactItemize}


\subsection{Detailed Description}
A special kind of {\bf KMain\-Window}{\rm (p.\,\pageref{classKMainWindow})} that is able to have dockwidget child widgets (and member of the dockwidget class set). 

The main widget should be a {\bf KDock\-Widget}{\rm (p.\,\pageref{classKDockWidget})} where other {\bf KDock\-Widget}{\rm (p.\,\pageref{classKDockWidget})} 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.

Furthermore, the KDock\-Main\-Window has got the {\bf KDock\-Manager}{\rm (p.\,\pageref{classKDockManager})} and some data about the dock states.

If you've got some dockwidgets, you can dock them to the dockmainwindow to initialize a start scene: Here an example: 

\footnotesize\begin{verbatim} 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)
   ...
\end{verbatim}
\normalsize


Docking is fully dynamic at runtime. That means you can always move dockwidgets via drag and drop.

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.

\begin{Desc}
\item[Author:]Max Judin (documentation: Falk Brettschneider). \end{Desc}




Definition at line 1300 of file kdockwidget.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDockMainWindow@{KDock\-Main\-Window}!KDockMainWindow@{KDockMainWindow}}
\index{KDockMainWindow@{KDockMainWindow}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDock\-Main\-Window::KDock\-Main\-Window ({\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, const char $\ast$ {\em name} = {\tt 0L}, WFlags {\em f} = {\tt WType\_\-TopLevel$|$WDestructiveClose})}\label{classKDockMainWindow_a0}


Constructs a dockmainwindow. 

It calls its base class constructor and does additional things concerning to the dock stuff: \begin{itemize}
\item information about the dock state of this' children gets initialized \item a dockmanager is created... \item ...and gets initialized \item the main dockwidget is set to 0\end{itemize}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]Parent widget for the dock main widget \item[{\em name}]internal object name \item[{\em f}]Qt::Widget\-Flags widget flags \end{description}
\end{Desc}


Definition at line 102 of file kdockwidget.cpp.

References dock\-Manager, QString::latin1(), and main\-Dock\-Widget.\index{KDockMainWindow@{KDock\-Main\-Window}!~KDockMainWindow@{$\sim$KDockMainWindow}}
\index{~KDockMainWindow@{$\sim$KDockMainWindow}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDock\-Main\-Window::$\sim${\bf KDock\-Main\-Window} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKDockMainWindow_a1}


Destructs a dockmainwindow. 



Definition at line 110 of file kdockwidget.cpp.

References dock\-Manager.

\subsection{Member Function Documentation}
\index{KDockMainWindow@{KDock\-Main\-Window}!manager@{manager}}
\index{manager@{manager}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDock\-Manager}$\ast$ KDock\-Main\-Window::manager () const\hspace{0.3cm}{\tt  [inline]}}\label{classKDockMainWindow_a2}


Returns the dockmanager of this. 

(see {\bf KDock\-Manager}{\rm (p.\,\pageref{classKDockManager})}) \begin{Desc}
\item[Returns:]pointer to the wanted dockmanager \end{Desc}


Definition at line 1331 of file kdockwidget.h.\index{KDockMainWindow@{KDock\-Main\-Window}!setMainDockWidget@{setMainDockWidget}}
\index{setMainDockWidget@{setMainDockWidget}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::set\-Main\-Dock\-Widget ({\bf KDock\-Widget} $\ast$ {\em dockwidget})}\label{classKDockMainWindow_a3}


Sets a new main dockwidget. 

Additionally, the toolbar is re-initialized.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dockwidget}]dockwidget that become the new main dockwidget \end{description}
\end{Desc}


Definition at line 115 of file kdockwidget.cpp.

References dock\-Manager, main\-Dock\-Widget, and KDock\-Manager::set\-Main\-Dock\-Widget2().

Referenced by KDock\-Manager::read\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!getMainDockWidget@{getMainDockWidget}}
\index{getMainDockWidget@{getMainDockWidget}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDock\-Widget}$\ast$ KDock\-Main\-Window::get\-Main\-Dock\-Widget () const\hspace{0.3cm}{\tt  [inline]}}\label{classKDockMainWindow_a4}


Returns the main dockwidget. 

\begin{Desc}
\item[Returns:]pointer to the main dockwidget \end{Desc}


Definition at line 1346 of file kdockwidget.h.

Referenced by KDock\-Manager::write\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!createDockWidget@{createDockWidget}}
\index{createDockWidget@{createDockWidget}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDock\-Widget} $\ast$ KDock\-Main\-Window::create\-Dock\-Widget (const {\bf QString} \& {\em name}, const {\bf QPixmap} \& {\em pixmap}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, const {\bf QString} \& {\em str\-Caption} = {\tt QString::null}, const {\bf QString} \& {\em str\-Tab\-Page\-Label} = {\tt {\bf QString::from\-Latin1}(\char`\"{}~\char`\"{})})}\label{classKDockMainWindow_a5}


This is one of the most important methods! The KDock\-Main\-Window creates a new dockwidget object here that usually should encapsulate the user's widget. 

The new dockwidget is automatically taken under control by the dockmanager of the dockmainwindow.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]{\bf QObject} name (default dockwidget caption) \item[{\em pixmap}]window icon (for instance shown when docked as tabwidget entry) \item[{\em parent}]parent widget for the new dockwidget \item[{\em str\-Caption}]window title (shown when toplevel) \item[{\em str\-Tab\-Page\-Label}]title of the tab page (visible when in tab page mode), if it is \char`\"{}\char`\"{}, only the icon will be shown; if it is 0L, the label is set to str\-Caption \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a pointer to the new created dockwidget \end{Desc}


Definition at line 135 of file kdockwidget.cpp.

References dock\-Manager, and QString::latin1().\index{KDockMainWindow@{KDock\-Main\-Window}!writeDockConfig@{writeDockConfig}}
\index{writeDockConfig@{writeDockConfig}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::write\-Dock\-Config ({\bf QDom\-Element} \& {\em base})}\label{classKDockMainWindow_a6}


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



Definition at line 157 of file kdockwidget.cpp.

References dock\-Manager, and KDock\-Manager::write\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!readDockConfig@{readDockConfig}}
\index{readDockConfig@{readDockConfig}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::read\-Dock\-Config ({\bf QDom\-Element} \& {\em base})}\label{classKDockMainWindow_a7}


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



Definition at line 162 of file kdockwidget.cpp.

References dock\-Manager, and KDock\-Manager::read\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!writeDockConfig@{writeDockConfig}}
\index{writeDockConfig@{writeDockConfig}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::write\-Dock\-Config ({\bf KConfig} $\ast$ {\em c} = {\tt 0L}, {\bf QString} {\em group} = {\tt QString::null})}\label{classKDockMainWindow_a8}


It writes the current dock state in the given section of {\bf KConfig}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]{\bf KDE} class for saving configurations \item[{\em group}]name of section to write to \end{description}
\end{Desc}


Definition at line 168 of file kdockwidget.cpp.

References dock\-Manager, and KDock\-Manager::write\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!readDockConfig@{readDockConfig}}
\index{readDockConfig@{readDockConfig}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::read\-Dock\-Config ({\bf KConfig} $\ast$ {\em c} = {\tt 0L}, {\bf QString} {\em group} = {\tt QString::null})}\label{classKDockMainWindow_a9}


It reads the current dock state from the given section of {\bf KConfig}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]{\bf KDE} class for saving configurations \item[{\em group}]name of section to read from \end{description}
\end{Desc}


Definition at line 173 of file kdockwidget.cpp.

References dock\-Manager, and KDock\-Manager::read\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!activateDock@{activateDock}}
\index{activateDock@{activateDock}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::activate\-Dock ()\hspace{0.3cm}{\tt  [inline]}}\label{classKDockMainWindow_a10}


It runs through all dockwidgets which are under control of the dockmanager and calls {\bf show()}{\rm (p.\,\pageref{classKMainWindow_a5})} for every encapsulated widget and {\bf show()}{\rm (p.\,\pageref{classKMainWindow_a5})} for the dockwidget itself if it is not in tab mode. 

Additionally, if the main dockwidget is not a {\bf QDialog}, it will be shown. 

Definition at line 1395 of file kdockwidget.h.\index{KDockMainWindow@{KDock\-Main\-Window}!dockHideShowMenu@{dockHideShowMenu}}
\index{dockHideShowMenu@{dockHideShowMenu}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPopup\-Menu}$\ast$ KDock\-Main\-Window::dock\-Hide\-Show\-Menu () const\hspace{0.3cm}{\tt  [inline]}}\label{classKDockMainWindow_a11}


Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible. 

\begin{Desc}
\item[Returns:]the wanted popup menu \end{Desc}


Definition at line 1403 of file kdockwidget.h.\index{KDockMainWindow@{KDock\-Main\-Window}!makeDockVisible@{makeDockVisible}}
\index{makeDockVisible@{makeDockVisible}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::make\-Dock\-Visible ({\bf KDock\-Widget} $\ast$ {\em dock})}\label{classKDockMainWindow_a12}


This method shows the given dockwidget. 

The clue is that it also considers the dockwidget could be a tab page and must set to be the activate one.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dock}]the dockwidget that is to be shown \end{description}
\end{Desc}


Definition at line 140 of file kdockwidget.cpp.

References KDock\-Widget::make\-Dock\-Visible().

Referenced by make\-Widget\-Dock\-Visible().\index{KDockMainWindow@{KDock\-Main\-Window}!makeDockInvisible@{makeDockInvisible}}
\index{makeDockInvisible@{makeDockInvisible}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::make\-Dock\-Invisible ({\bf KDock\-Widget} $\ast$ {\em dock})}\label{classKDockMainWindow_a13}


This method hides the given dockwidget. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dock}]the dockwidget that is to be shown \end{description}
\end{Desc}


Definition at line 146 of file kdockwidget.cpp.

References KDock\-Widget::undock().\index{KDockMainWindow@{KDock\-Main\-Window}!makeWidgetDockVisible@{makeWidgetDockVisible}}
\index{makeWidgetDockVisible@{makeWidgetDockVisible}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::make\-Widget\-Dock\-Visible ({\bf QWidget} $\ast$ {\em widget})}\label{classKDockMainWindow_a14}


This is an overloaded member function, provided for convenience. 

It differs from the above function only in what argument(s) it accepts. 

Definition at line 152 of file kdockwidget.cpp.

References dock\-Manager, KDock\-Manager::find\-Widget\-Parent\-Dock(), and make\-Dock\-Visible().\index{KDockMainWindow@{KDock\-Main\-Window}!setView@{setView}}
\index{setView@{setView}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::set\-View ({\bf QWidget} $\ast$ {\em widget})}\label{classKDockMainWindow_a15}


This method calls the base class method. 

If the given widget inherits {\bf KDock\-Widget}{\rm (p.\,\pageref{classKDockWidget})}, apply\-To\-Widget(this) is called.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]any widget that should become the main view \end{description}
\end{Desc}


Definition at line 122 of file kdockwidget.cpp.

References QMain\-Window::set\-Central\-Widget().

Referenced by KDock\-Manager::read\-Config().\index{KDockMainWindow@{KDock\-Main\-Window}!dockWidgetHasUndocked@{dockWidgetHasUndocked}}
\index{dockWidgetHasUndocked@{dockWidgetHasUndocked}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::dock\-Widget\-Has\-Undocked ({\bf KDock\-Widget} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKDockMainWindow_l0}


Signals a certain dockwidget is undocked now. 



Referenced by slot\-Dock\-Widget\-Undocked().\index{KDockMainWindow@{KDock\-Main\-Window}!slotDockWidgetUndocked@{slotDockWidgetUndocked}}
\index{slotDockWidgetUndocked@{slotDockWidgetUndocked}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDock\-Main\-Window::slot\-Dock\-Widget\-Undocked ()\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKDockMainWindow_j0}


Called whenever one of the dockwidgets of this has been undocked. 



Definition at line 179 of file kdockwidget.cpp.

References dock\-Widget\-Has\-Undocked(), and QObject::inherits().

\subsection{Member Data Documentation}
\index{KDockMainWindow@{KDock\-Main\-Window}!mainDockWidget@{mainDockWidget}}
\index{mainDockWidget@{mainDockWidget}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDock\-Widget}$\ast$ {\bf KDock\-Main\-Window::main\-Dock\-Widget}\hspace{0.3cm}{\tt  [protected]}}\label{classKDockMainWindow_p0}


A pointer to the main dockwidget (where one can manual\-Dock() to. 



Definition at line 1446 of file kdockwidget.h.

Referenced by KDock\-Main\-Window(), and set\-Main\-Dock\-Widget().\index{KDockMainWindow@{KDock\-Main\-Window}!dockManager@{dockManager}}
\index{dockManager@{dockManager}!KDockMainWindow@{KDock\-Main\-Window}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDock\-Manager}$\ast$ {\bf KDock\-Main\-Window::dock\-Manager}\hspace{0.3cm}{\tt  [protected]}}\label{classKDockMainWindow_p1}


A pointer to the manager for the dock process. 



Definition at line 1451 of file kdockwidget.h.

Referenced by create\-Dock\-Widget(), KDock\-Main\-Window(), make\-Widget\-Dock\-Visible(), read\-Dock\-Config(), set\-Main\-Dock\-Widget(), write\-Dock\-Config(), and $\sim$KDock\-Main\-Window().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kdockwidget.h\item 
kdockwidget.cpp\end{CompactItemize}
