org.kde.koala

Class KDockMainWindow

public class KDockMainWindow extends KMainWindow

A special kind of KMainWindow that is able to have dockwidget child widgets (and member of the dockwidget class set). The main widget should be a KDockWidget where other KDockWidget 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 KDockMainWindow has got the KDockManager 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:
 DockApplication.DockApplication( String name)
 {
   ...
   KDockWidget mainDock;
   mainDock = createDockWidget( "Falk's MainDockWidget", mainPixmap, null, "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, null, 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)
   ...
 
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. See KDockMainWindowSignals for signals emitted by KDockMainWindow

Author: Max Judin (documentation: Falk Brettschneider).

UNKNOWN: A special kind of KMainWindow that is able to have dockwidget child widgets (and member of the dockwidget class set).

Constructor Summary
protected KDockMainWindow(Class dummy)
KDockMainWindow(QWidget parent, String name, int f)
Constructs a dockmainwindow.
KDockMainWindow(QWidget parent, String name)
KDockMainWindow(QWidget parent)
KDockMainWindow()
Method Summary
voidactivateDock()
It runs through all dockwidgets which are under control of the dockmanager and calls show() for every encapsulated widget and show() for the dockwidget itself if it is not in tab mode.
StringclassName()
KDockWidgetcreateDockWidget(String name, QPixmap pixmap, QWidget parent, String strCaption, String strTabPageLabel)
This is one of the most important methods!
KDockWidgetcreateDockWidget(String name, QPixmap pixmap, QWidget parent, String strCaption)
KDockWidgetcreateDockWidget(String name, QPixmap pixmap, QWidget parent)
KDockWidgetcreateDockWidget(String name, QPixmap pixmap)
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
QPopupMenudockHideShowMenu()
Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.
protected voidfinalize()
Deletes the wrapped C++ instance
KDockWidgetgetMainDockWidget()
Returns the main dockwidget.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
voidmakeDockInvisible(KDockWidget dock)
This method hides the given dockwidget.
voidmakeDockVisible(KDockWidget dock)
This method shows the given dockwidget.
voidmakeWidgetDockVisible(QWidget widget)
This is an overloaded member function, provided for convenience.
KDockManagermanager()
Returns the dockmanager of this. (see KDockManager)
QMetaObjectmetaObject()
voidreadDockConfig(QDomElement base)
Reads the current dock window layout from a DOM tree below the given element.
voidreadDockConfig(KConfig c, String group)
It reads the current dock state from the given section of KConfig.
voidreadDockConfig(KConfig c)
voidreadDockConfig()
voidsetMainDockWidget(KDockWidget dockwidget)
Sets a new main dockwidget.
voidsetView(QWidget widget)
This method calls the base class method.
protected voidslotDockWidgetUndocked()
Called whenever one of the dockwidgets of this has been undocked.
voidwriteDockConfig(QDomElement base)
Saves the current dock window layout into a DOM tree below the given element.
voidwriteDockConfig(KConfig c, String group)
It writes the current dock state in the given section of KConfig.
voidwriteDockConfig(KConfig c)
voidwriteDockConfig()

Constructor Detail

KDockMainWindow

protected KDockMainWindow(Class dummy)

KDockMainWindow

public KDockMainWindow(QWidget parent, String name, int f)
Constructs a dockmainwindow. It calls its base class constructor and does additional things concerning to the dock stuff:
  • information about the dock state of this' children gets initialized
  • a dockmanager is created...
  • ...and gets initialized
  • the main dockwidget is set to 0
  • Parameters: parent Parent widget for the dock main widget name internal object name f Qt.WidgetFlags widget flags

    UNKNOWN: Constructs a dockmainwindow.

    KDockMainWindow

    public KDockMainWindow(QWidget parent, String name)

    KDockMainWindow

    public KDockMainWindow(QWidget parent)

    KDockMainWindow

    public KDockMainWindow()

    Method Detail

    activateDock

    public void activateDock()
    It runs through all dockwidgets which are under control of the dockmanager and calls show() for every encapsulated widget and show() for the dockwidget itself if it is not in tab mode. Additionally, if the main dockwidget is not a QDialog, it will be shown.

    UNKNOWN: It runs through all dockwidgets which are under control of the dockmanager and calls show() for every encapsulated widget and show() for the dockwidget itself if it is not in tab mode.

    className

    public String className()

    createDockWidget

    public KDockWidget createDockWidget(String name, QPixmap pixmap, QWidget parent, String strCaption, String strTabPageLabel)
    This is one of the most important methods! The KDockMainWindow 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.

    Parameters: name QObject name (default dockwidget caption) pixmap window icon (for instance shown when docked as tabwidget entry) parent parent widget for the new dockwidget strCaption window title (shown when toplevel) strTabPageLabel title of the tab page (visible when in tab page mode), if it is "", only the icon will be shown; if it is null, the label is set to strCaption

    Returns: a pointer to the new created dockwidget

    UNKNOWN: This is one of the most important methods! The KDockMainWindow creates a new dockwidget object here that usually should encapsulate the user's widget.

    createDockWidget

    public KDockWidget createDockWidget(String name, QPixmap pixmap, QWidget parent, String strCaption)

    createDockWidget

    public KDockWidget createDockWidget(String name, QPixmap pixmap, QWidget parent)

    createDockWidget

    public KDockWidget createDockWidget(String name, QPixmap pixmap)

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    dockHideShowMenu

    public QPopupMenu dockHideShowMenu()
    Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.

    Returns: the wanted popup menu

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

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    getMainDockWidget

    public KDockWidget getMainDockWidget()
    Returns the main dockwidget.

    Returns: pointer to the main dockwidget

    UNKNOWN: Returns the main dockwidget.

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    makeDockInvisible

    public void makeDockInvisible(KDockWidget dock)
    This method hides the given dockwidget.

    Parameters: dock the dockwidget that is to be shown

    UNKNOWN: This method hides the given dockwidget.

    makeDockVisible

    public void makeDockVisible(KDockWidget dock)
    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.

    Parameters: dock the dockwidget that is to be shown

    UNKNOWN: This method shows the given dockwidget.

    makeWidgetDockVisible

    public void makeWidgetDockVisible(QWidget widget)
    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    UNKNOWN: This is an overloaded member function, provided for convenience.

    manager

    public KDockManager manager()
    Returns the dockmanager of this. (see KDockManager)

    Returns: pointer to the wanted dockmanager

    UNKNOWN: Returns the dockmanager of this.

    metaObject

    public QMetaObject metaObject()

    readDockConfig

    public void readDockConfig(QDomElement base)
    Reads the current dock window layout from a DOM tree below the given element.

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

    readDockConfig

    public void readDockConfig(KConfig c, String group)
    It reads the current dock state from the given section of KConfig.

    Parameters: c KDE class for saving configurations group name of section to read from

    UNKNOWN: It reads the current dock state from the given section of KConfig.

    readDockConfig

    public void readDockConfig(KConfig c)

    readDockConfig

    public void readDockConfig()

    setMainDockWidget

    public void setMainDockWidget(KDockWidget dockwidget)
    Sets a new main dockwidget. Additionally, the toolbar is re-initialized.

    Parameters: dockwidget dockwidget that become the new main dockwidget

    UNKNOWN: Sets a new main dockwidget.

    setView

    public void setView(QWidget widget)
    This method calls the base class method. If the given widget inherits KDockWidget, applyToWidget(this) is called.

    Parameters: widget any widget that should become the main view

    UNKNOWN: This method calls the base class method.

    slotDockWidgetUndocked

    protected void slotDockWidgetUndocked()
    Called whenever one of the dockwidgets of this has been undocked.

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

    writeDockConfig

    public void writeDockConfig(QDomElement base)
    Saves the current dock window layout into a DOM tree below the given element.

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

    writeDockConfig

    public void writeDockConfig(KConfig c, String group)
    It writes the current dock state in the given section of KConfig.

    Parameters: c KDE class for saving configurations group name of section to write to

    UNKNOWN: It writes the current dock state in the given section of KConfig.

    writeDockConfig

    public void writeDockConfig(KConfig c)

    writeDockConfig

    public void writeDockConfig()