kmdi Library API Documentation

KMdiMainFrm Class Reference

Base class for all your special main frames. More...

#include <kmdimainfrm.h>

List of all members.

Public Types

enum  ExistsAs { DocumentView, ToolView, AnyView }

Public Slots

KMdiChildViewcreateWrapper (QWidget *view, const QString &name, const QString &shortName)
virtual void addWindow (KMdiChildView *pView, int flags=KMdi::StandardAdd)
void addWindow (KMdiChildView *pView, int flags, int index)
virtual void addWindow (KMdiChildView *pView, QPoint pos, int flags=KMdi::StandardAdd)
virtual void addWindow (KMdiChildView *pView, QRect rectNormal, int flags=KMdi::StandardAdd)
virtual KMdiToolViewAccessor * addToolWindow (QWidget *pWnd, KDockWidget::DockPosition pos=KDockWidget::DockNone, QWidget *pTargetWnd=0L, int percent=50, const QString &tabToolTip=0, const QString &tabCaption=0)
virtual void deleteToolWindow (QWidget *pWnd)
virtual void deleteToolWindow (KMdiToolViewAccessor *accessor)
KMdiToolViewAccessor * createToolWindow ()
virtual void removeWindowFromMdi (KMdiChildView *pWnd)
virtual void closeWindow (KMdiChildView *pWnd, bool layoutTaskBar=true)
virtual void slot_toggleTaskBar ()
virtual void attachWindow (KMdiChildView *pWnd, bool bShow=true, bool bAutomaticResize=false)
virtual void detachWindow (KMdiChildView *pWnd, bool bShow=true)
virtual void childWindowCloseRequest (KMdiChildView *pWnd)
virtual void closeAllViews ()
virtual void iconifyAllViews ()
virtual void closeActiveView ()
virtual void switchToToplevelMode ()
virtual void finishToplevelMode ()
virtual void switchToChildframeMode ()
virtual void finishChildframeMode ()
virtual void switchToTabPageMode ()
virtual void finishTabPageMode ()
virtual void switchToIDEAlMode ()
virtual void finishIDEAlMode (bool full=true)
void setIDEAlModeStyle (int flags) KDE_DEPRECATED
void setToolviewStyle (int flags)
bool isViewTaskBarOn ()
virtual void showViewTaskBar ()
virtual void hideViewTaskBar ()
virtual void fillWindowMenu ()
virtual void cascadeWindows ()
virtual void cascadeMaximized ()
virtual void expandVertical ()
virtual void expandHorizontal ()
virtual void tilePragma ()
virtual void tileAnodine ()
virtual void tileVertically ()
virtual void setFrameDecorOfAttachedViews (int frameDecor)
virtual void setEnableMaximizedChildFrmMode (bool bEnable)
virtual void activateNextWin ()
virtual void activatePrevWin ()
virtual void activateFirstWin ()
virtual void activateLastWin ()
virtual void activateView (int index)
void prevToolViewInDock ()
void nextToolViewInDock ()

Signals

void lastChildFrmClosed ()
void lastChildViewClosed ()
void leftTopLevelMode ()
void childViewIsDetachedNow (QWidget *)
void collapseOverlapContainers ()
void mdiModeHasBeenChangedTo (KMdi::MdiMode)
void viewActivated (KMdiChildView *)
void viewDeactivated (KMdiChildView *)
void toggleTop ()
void toggleLeft ()
void toggleRight ()
void toggleBottom ()

Public Member Functions

 KMdiMainFrm (QWidget *parentWidget, const char *name="", KMdi::MdiMode mdiMode=KMdi::ChildframeMode, WFlags flags=WType_TopLevel|WDestructiveClose)
virtual ~KMdiMainFrm ()
void setStandardMDIMenuEnabled (bool showModeMenu=true)
void setManagedDockPositionModeEnabled (bool enabled)
bool isInMaximizedChildFrmMode ()
KMdi::MdiMode mdiMode ()
KMdiChildViewactiveWindow ()
virtual QPopupMenutaskBarPopup (KMdiChildView *pWnd, bool bIncludeWindowPopup=false)
virtual QPopupMenuwindowPopup (KMdiChildView *pWnd, bool bIncludeTaskbarPopup=true)
virtual void applyOptions ()
KMdiChildViewfindWindow (const QString &caption)
bool windowExists (KMdiChildView *pWnd, ExistsAs as)
virtual bool event (QEvent *e)
virtual void setSysButtonsAtMenuPosition ()
virtual int taskBarHeight ()
virtual void setUndockPositioningOffset (QPoint offset)
KMdiIterator< KMdiChildView * > * createIterator ()
void deleteIterator (KMdiIterator< KMdiChildView * > *pIt)
QPopupMenuwindowMenu () const
virtual void setBackgroundColor (const QColor &c)
virtual void setBackgroundPixmap (const QPixmap &pm)
void setDefaultChildFrmSize (const QSize &sz)
QSize defaultChildFrmSize ()
virtual void setMinimumSize (int minw, int minh)
int childFrameModeHeight ()
virtual void setMenuForSDIModeSysButtons (KMenuBar *=0)
void fakeSDIApplication ()
bool isFakingSDIApplication () const
virtual bool eventFilter (QObject *obj, QEvent *e)
void findRootDockWidgets (QPtrList< KDockWidget > *pRootDockWidgetList, QValueList< QRect > *pPositionList)
void setSwitching (const bool switching)
bool switching (void) const

Static Public Member Functions

int frameDecorOfAttachedViews ()

Protected Slots

virtual void activateView (KMdiChildView *pWnd)
virtual void taskbarButtonRightClicked (KMdiChildView *pWnd)
void switchOffMaximizeModeForMenu (KMdiChildFrm *oldChild)
void updateSysButtonConnections (KMdiChildFrm *oldChild, KMdiChildFrm *newChild)
void windowMenuItemActivated (int id)
void dockMenuItemActivated (int id)
void popupWindowMenu (QPoint p)
void dragEndTimeOut ()
void closeViewButtonPressed ()

Protected Member Functions

virtual void resizeEvent (QResizeEvent *)
virtual void createTaskBar ()
virtual void createMdiManager ()
void blockClearingOfWindowMenu (bool bBlocked)
void findToolViewsDockedToMain (QPtrList< KDockWidget > *list, KDockWidget::DockPosition dprtmw)
void dockToolViewsIntoContainers (QPtrList< KDockWidget > &widgetsToReparent, KDockWidget *container)
QStringList prepareIdealToTabs (KDockWidget *container)
void idealToolViewsToStandardTabs (QStringList widgetNames, KDockWidget::DockPosition pos, int sizee)
KMdi::TabWidgetVisibility tabWidgetVisibility ()
void setTabWidgetVisibility (KMdi::TabWidgetVisibility)
KTabWidget * tabWidget () const

Protected Attributes

KMdi::MdiMode m_mdiMode
KMdiChildAream_pMdi
KMdiTaskBarm_pTaskBar
QPtrList< KMdiChildView > * m_pDocumentViews
QMap< QWidget *, KMdiToolViewAccessor * > * m_pToolViews
KMdiChildViewm_pCurrentWindow
QPopupMenum_pWindowPopup
QPopupMenum_pTaskBarPopup
QPopupMenum_pWindowMenu
QPopupMenum_pDockMenu
QPopupMenum_pMdiModeMenu
QPopupMenum_pPlacingMenu
KMenuBar * m_pMainMenuBar
QPixmapm_pUndockButtonPixmap
QPixmapm_pMinButtonPixmap
QPixmapm_pRestoreButtonPixmap
QPixmapm_pCloseButtonPixmap
QToolButtonm_pUndock
QToolButtonm_pMinimize
QToolButtonm_pRestore
QToolButtonm_pClose
QPoint m_undockPositioningOffset
bool m_bMaximizedChildFrmMode
int m_oldMainFrmHeight
int m_oldMainFrmMinHeight
int m_oldMainFrmMaxHeight
bool m_bSDIApplication
KDockWidget * m_pDockbaseAreaOfDocumentViews
QDomDocumentm_pTempDockSession
bool m_bClearingOfWindowMenuBlocked
QTimerm_pDragEndTimer
bool m_bSwitching
KDockWidget * m_leftContainer
KDockWidget * m_rightContainer
KDockWidget * m_topContainer
KDockWidget * m_bottomContainer

Static Protected Attributes

KMdi::FrameDecor m_frameDecoration = KMdi::KDELook


Detailed Description

Base class for all your special main frames.

It contains the child frame area (QMainWindow's central widget) and a child view taskbar for switching the MDI views. Most methods are virtual functions for later overriding.

Basically, this class provides functionality for docking/undocking view windows and manages the taskbar. Usually the programmer just need to know about this class and the child view class.

Your program mainwidget should inherit KMdiMainFrm. Then usually you'll just need addWindow() and removeWindowFromMdi() to control the views.

   class MyMainWindow : public KMdiMainFrm
   { .... };
   ...
   MyMainWindow mainframe;
   qApp->setMainWidget(&mainframe);
   mainframe->addWindow(view1); // put it under MDI control
   mainframe->addWindow(view2);

Most public and protected methods of this class are for program calls of the actions the user could click.

Dynamic switching the MDI mode can be done via switchToChildframeMode(), switchToToplevelMode(), switchToTabPageMode() or fakeSDIApplication() or asked via mdiMode(), isFakingSDIApplication().

This class provides already the "Window" menu needed in common MDI applications. Just insert it in your main menu:

 if (!isFakingSDIApplication()) {
    menuBar()->insertItem( tr("&Window"), windowMenu());
 }

Synchronize the positions of the MDI control buttons inserted in your mainmenu:

 void B_MainModuleWidget::initMenuBar()
 {
   setMenuForSDIModeSysButtons( menuBar());
 ...
 void B_MainModuleWidget::resizeEvent ( QResizeEvent *e)
 {
   KMdiMainFrm::resizeEvent( e);
   setSysButtonsAtMenuPosition();
 }

You can dynamically change the shape of the attached MDI views using setFrameDecorOfAttachedViews().

Additionally, here's a hint how to restore the mainframe's settings from config file:

    // restore MDI mode (toplevel, childframe, tabpage)
    int mdiMode = config->readIntEntry( "mainmodule session", "MDI mode", KMdi::ChildframeMode);
    switch (mdiMode) {
    case KMdi::ToplevelMode:
       {
          int childFrmModeHt = config->readIntEntry( "mainmodule session", "Childframe mode height", desktop()->height() - 50);
          mainframe->resize( m_pMdiMainFrm->width(), childFrmModeHt);
          mainframe->switchToToplevelMode();
       }
       break;
    case KMdi::ChildframeMode:
       break;
    case KMdi::TabPageMode:
       {
          int childFrmModeHt = m_pCfgFileManager->readIntEntry( "mainmodule session", "Childframe mode height", desktop()->height() - 50);
          mainframe->resize( m_pMdiMainFrm->width(), childFrmModeHt);
          mainframe->switchToTabPageMode();
       }
       break;
    default:
       break;
    }

    // restore a possible maximized Childframe mode
    bool maxChildFrmMode = config->readBoolEntry( "mainmodule session", "maximized childframes", true);
    mainframe->setEnableMaximizedChildFrmMode(maxChildFrmMode);
The maximized-Childframe mode means that currently all views are maximized in Childframe mode's application desktop.

This class provides placing algorithms in Childframe mode. Call tilePragma(), tileAnodine(), tileVertically(), cascadeWindows(), cascadeMaximized(), expandVertical(), expandHorizontal() for those actions.

activateView(KMdiChildView*) and activateView(int index) set the appropriate MDI child view as the active one. It will be raised, gets an active MDI frame and gets the focus. Call activeView() to find out what the current MDI view is.

Use detachWindow() and attachWindow() for docking the MDI views to desktop and back.

Connect accels of your program with activatePrevWin(), activateNextWin() and activateView(int index).

Note: KMdiChildViews can be added in 2 meanings: Either as a normal child view (usually containing user document views) or as a tool-view (usually containing status, info or control widgets). The tool-views can be added as floating dockwidgets or as stay-on-top desktop windows in tool style.

Here's an example how you can suggest things for the adding of views to the MDI control via flags:

 m_mapOfMdiWidgets.insert( pWnd, mh);
 unsigned int mdiFlags = KMdi::StandardAdd;
 if( !bShow)
    mdiFlags |= KMdi::Hide;
 if( !bAttach)
    mdiFlags |= KMdi::Detach;
 if( bMinimize)
    mdiFlags |= KMdi::Minimize;
 if( bToolWindow)
    mdiFlags |= KMdi::ToolWindow;
 if (m_pMdiMainFrm->isFakingSDIApplication()) {
    if (bAttach) { // fake an SDI app
       mdiFlags |= KMdi::Maximize;
    }
    else {
       m_pMdiMainFrm->addWindow( pWnd, QPoint(20, 20), KMdi::AddWindowFlags(mdiFlags));
       return;
    }
 }
 m_pMdiMainFrm->addWindow( pWnd, KMdi::AddWindowFlags(mdiFlags));

Further note: Pay attention to the fact that when you click on the close button of MDI views that their close event should be redirected to closeWindow(). Otherwise the mainframe class will not get noticed about the deleted view and a dangling pointer will remain in the MDI control. The closeWindow() or the removeWindowFromMdi() method is for that issue. The difference is closeWindow() deletes the view object. So if your application wants to control that by itself, call removeWindowFromMdi() and call delete by yourself. See also KMdiChildView::closeEvent() for tat issue.

Definition at line 204 of file kmdimainfrm.h.


Member Enumeration Documentation

enum KMdiMainFrm::ExistsAs
 

Returns whether this MDI child view is under MDI control (using addWindow() ) or not.

Definition at line 315 of file kmdimainfrm.h.


Constructor & Destructor Documentation

KMdiMainFrm::KMdiMainFrm QWidget parentWidget,
const char *  name = "",
KMdi::MdiMode  mdiMode = KMdi::ChildframeMode,
WFlags  flags = WType_TopLevel|WDestructiveClose
 

Constructor.

Definition at line 137 of file kmdimainfrm.cpp.

References applyOptions(), createMdiManager(), createTaskBar(), dragEndTimeOut(), fillWindowMenu(), setMenuForSDIModeSysButtons(), switchToIDEAlMode(), switchToTabPageMode(), and switchToToplevelMode().

KMdiMainFrm::~KMdiMainFrm  )  [virtual]
 

Destructor.

Definition at line 271 of file kmdimainfrm.cpp.

References closeWindow(), and lastChildViewClosed().


Member Function Documentation

bool KMdiMainFrm::isInMaximizedChildFrmMode  )  [inline]
 

Returns whether the application's MDI views are in maximized state or not.

Definition at line 280 of file kmdimainfrm.h.

KMdi::MdiMode KMdiMainFrm::mdiMode  )  [inline]
 

Returns the MDI mode.

This can be one of the enumerations KMdi::MdiMode. Definition at line 284 of file kmdimainfrm.h.

Referenced by detachWindow().

KMdiChildView * KMdiMainFrm::activeWindow  ) 
 

Returns the focused attached MDI view.

Definition at line 879 of file kmdimainfrm.cpp.

Referenced by activateFirstWin(), activateLastWin(), activateNextWin(), activatePrevWin(), closeViewButtonPressed(), eventFilter(), switchToIDEAlMode(), and switchToTabPageMode().

QPopupMenu * KMdiMainFrm::taskBarPopup KMdiChildView pWnd,
bool  bIncludeWindowPopup = false
[virtual]
 

Returns a popup menu filled according to the MDI view state.

You can override this method to insert additional entries there. The popup menu is usually popuped when the user clicks with the right mouse button on a taskbar entry. The default entries are: Undock/Dock, Restore/Maximize/Minimize, Close and an empty sub-popup ( windowPopup() ) menu called Operations. Definition at line 910 of file kmdimainfrm.cpp.

References KMdiChildView::isAttached(), KMdiChildView::isMaximized(), KMdiChildView::isMinimized(), and windowPopup().

Referenced by taskbarButtonRightClicked(), and windowPopup().

QPopupMenu * KMdiMainFrm::windowPopup KMdiChildView pWnd,
bool  bIncludeTaskbarPopup = true
[virtual]
 

Returns a popup menu with only a title "Window".

You can fill it with own operations entries on the MDI view. This popup menu is inserted as last menu item in taskBarPopup() . Definition at line 899 of file kmdimainfrm.cpp.

References taskBarPopup().

Referenced by taskBarPopup().

void KMdiMainFrm::applyOptions  )  [virtual]
 

Called in the constructor (forces a resize of all MDI views).

Definition at line 313 of file kmdimainfrm.cpp.

Referenced by KMdiMainFrm().

KMdiChildView * KMdiMainFrm::findWindow const QString caption  ) 
 

Returns the KMdiChildView belonging to the given caption string.

Definition at line 870 of file kmdimainfrm.cpp.

References KMdiChildView::caption().

bool KMdiMainFrm::event QEvent e  )  [virtual]
 

Catches certain Qt events and processes it here.

Currently, here this catches only the KMdiViewCloseEvent (a KMdi user event) which is sent from itself in childWindowCloseRequest() right after a KMdiChildView::closeEvent() . The reason for this event to itself is simple: It just wants to break the function call stack. It continues the processing with calling closeWindow() . You see, a close() is translated to a closeWindow() . It is necessary that the main frame has to start an MDI view close action because it must remove the MDI view from MDI control, additionally.

This method calls QMainWindow::event , additionally. Definition at line 1037 of file kmdimainfrm.cpp.

References closeWindow().

void KMdiMainFrm::setSysButtonsAtMenuPosition  )  [virtual]
 

If there's a main menubar given, it will create the 4 maximize mode buttons there (undock, minimize, restore, close).

Definition at line 2065 of file kmdimainfrm.cpp.

References frameDecorOfAttachedViews().

Referenced by setMenuForSDIModeSysButtons().

virtual int KMdiMainFrm::taskBarHeight  )  [inline, virtual]
 

Returns the height of the taskbar.

Definition at line 337 of file kmdimainfrm.h.

virtual void KMdiMainFrm::setUndockPositioningOffset QPoint  offset  )  [inline, virtual]
 

Sets an offset value that is used on detachWindow() .

The undocked window is visually moved on the desktop by this offset. Definition at line 342 of file kmdimainfrm.h.

Referenced by switchToToplevelMode().

KMdiIterator<KMdiChildView*>* KMdiMainFrm::createIterator  )  [inline]
 

If you don't want to know about the inner structure of the KMdi system, you can use this iterator to handle with the MDI view list in a more abstract way.

The iterator hides what special data structure is used in KMdi. Definition at line 349 of file kmdimainfrm.h.

Referenced by activateFirstWin(), activateLastWin(), activateNextWin(), and activatePrevWin().

void KMdiMainFrm::deleteIterator KMdiIterator< KMdiChildView * > *  pIt  )  [inline]
 

Deletes an KMdiIterator created in the KMdi library (needed for the windows dll problem).

Definition at line 359 of file kmdimainfrm.h.

QPopupMenu* KMdiMainFrm::windowMenu  )  const [inline]
 

Returns a popup menu that contains the MDI controlled view list.

Additionally, this menu provides some placing actions for these views. Usually, you insert this popup menu in your main menubar as "Window" menu. Definition at line 365 of file kmdimainfrm.h.

virtual void KMdiMainFrm::setBackgroundColor const QColor c  )  [inline, virtual]
 

Sets a background color for the MDI view area widget.

Definition at line 369 of file kmdimainfrm.h.

virtual void KMdiMainFrm::setBackgroundPixmap const QPixmap pm  )  [inline, virtual]
 

Sets a background pixmap for the MDI view area widget.

Definition at line 373 of file kmdimainfrm.h.

void KMdiMainFrm::setDefaultChildFrmSize const QSize sz  )  [inline]
 

Sets a size that is used as the default size for a newly to the MDI system added KMdiChildView .

By default this size is 600x400. So all non-resized added MDI views appear in that size. Definition at line 378 of file kmdimainfrm.h.

References KMdiChildArea::m_defaultChildFrmSize.

QSize KMdiMainFrm::defaultChildFrmSize  )  [inline]
 

Returns the default size for a newly added KMdiChildView.

See setDefaultChildFrmSize() . Definition at line 383 of file kmdimainfrm.h.

References KMdiChildArea::m_defaultChildFrmSize.

Referenced by detachWindow().

void KMdiMainFrm::setMinimumSize int  minw,
int  minh
[virtual]
 

Do nothing when in Toplevel mode.

Definition at line 364 of file kmdimainfrm.cpp.

int KMdiMainFrm::childFrameModeHeight  )  [inline]
 

Returns the Childframe mode height of this.

Makes only sense when in Toplevel mode. Definition at line 392 of file kmdimainfrm.h.

void KMdiMainFrm::setMenuForSDIModeSysButtons KMenuBar *  = 0  )  [virtual]
 

Tells the MDI system a QMenu where it can insert buttons for the system menu, undock, minimize, restore actions.

If no such menu is given, KMdi simply overlays the buttons at the upper right-hand side of the main widget. Definition at line 1996 of file kmdimainfrm.cpp.

References frameDecorOfAttachedViews(), and setSysButtonsAtMenuPosition().

Referenced by KMdiMainFrm(), and setFrameDecorOfAttachedViews().

int KMdiMainFrm::frameDecorOfAttachedViews  )  [inline, static]
 

Returns:
the decoration of the window frame of docked (attached) MDI views
Definition at line 404 of file kmdimainfrm.h.

Referenced by KMdiChildFrm::doResize(), KMdiChildFrmCaption::heightHint(), KMdiChildFrmCaption::mousePressEvent(), KMdiChildFrmCaption::mouseReleaseEvent(), KMdiChildFrmCaption::paintEvent(), KMdiChildFrm::redecorateButtons(), setEnableMaximizedChildFrmMode(), setMenuForSDIModeSysButtons(), setSysButtonsAtMenuPosition(), KMdiChildFrm::showSystemMenu(), KMdiChildFrmCaption::slot_moveViaSystemMenu(), KMdiChildFrm::systemMenu(), and updateSysButtonConnections().

void KMdiMainFrm::fakeSDIApplication  ) 
 

An SDI application user interface is faked:

  • an opened view is always maximized
  • buttons for maximized childframe mode aren't inserted in the main menubar
  • taskbar and windowmenu are not created/updated.

Definition at line 2572 of file kmdimainfrm.cpp.

bool KMdiMainFrm::isFakingSDIApplication  )  const [inline]
 

Returns:
if we are faking an SDI application (fakeSDIApplication())
Definition at line 415 of file kmdimainfrm.h.

Referenced by popupWindowMenu().

bool KMdiMainFrm::eventFilter QObject obj,
QEvent e
[virtual]
 

these are quite some assumptions: The key combination uses exactly one modifier key The WIN button in KDE is the meta button in Qt Definition at line 1076 of file kmdimainfrm.cpp.

References activeWindow(), KMdiChildArea::focusTopChild(), KMdiChildView::isAttached(), KMdiChildArea::topChild(), and KMdiChildView::updateTimeStamp().

void KMdiMainFrm::findRootDockWidgets QPtrList< KDockWidget > *  pRootDockWidgetList,
QValueList< QRect > *  pPositionList
 

find the root dockwidgets and store their geometry

Definition at line 1163 of file kmdimainfrm.cpp.

Referenced by switchToChildframeMode(), and switchToToplevelMode().

KMdiChildView * KMdiMainFrm::createWrapper QWidget view,
const QString name,
const QString shortName
[slot]
 

addWindow demands a KMdiChildView.

This method wraps every QWidget in such an object and this way you can every widget put under MDI control. Definition at line 373 of file kmdimainfrm.cpp.

References QBoxLayout::addWidget(), KMdiChildView::setCaption(), KMdiChildView::setTabCaption(), and KMdiChildView::trackIconAndCaptionChanges().

void KMdiMainFrm::addWindow KMdiChildView pView,
int  flags = KMdi::StandardAdd
[virtual, slot]
 

One of the most important methods at all! Adds a KMdiChildView to the MDI system.

The main frame takes it under control. You can specify here whether:

  • the view should be attached or detached.
  • shown or hidden
  • maximized, minimized or restored (normalized)
  • added as tool view (stay-on-top and toplevel) or added as document-type view.</LI?
Definition at line 397 of file kmdimainfrm.cpp.

Referenced by addWindow().

void KMdiMainFrm::addWindow KMdiChildView pView,
int  flags,
int  index
[slot]
 

One of the most important methods at all! Adds a KMdiChildView to the MDI system.

The main frame takes it under control. You can specify here whether:

  • the view should be attached or detached.
  • shown or hidden
  • maximized, minimized or restored (normalized)
  • added as tool view (stay-on-top and toplevel) or added as document-type view.</LI?
Parameters:
index defines an index of tab, after which the new tab will be inserted. This param have not any sence in ChildFrame mode. If index == -1 then the tab will be appended.
Since:
3.3
Definition at line 402 of file kmdimainfrm.cpp.

References activateView(), addToolWindow(), KMdiTaskBar::addWinButton(), attachWindow(), KMdiChildView::caption(), childViewIsDetachedNow(), childWindowCloseRequest(), detachWindow(), dockMenuItemActivated(), KMdiChildArea::getCascadePoint(), KMdiChildView::isAttached(), KMdiChildView::isMaximized(), KMdiChildView::maximize(), KMdiChildView::mdiParent(), KMdiChildView::minimize(), KMdiChildView::show(), KMdiChildView::tabCaption(), and windowMenuItemActivated().

void KMdiMainFrm::addWindow KMdiChildView pView,
QPoint  pos,
int  flags = KMdi::StandardAdd
[virtual, slot]
 

See the method above for more details.

Additionally, it moves to point pos. Definition at line 518 of file kmdimainfrm.cpp.

References addWindow(), KMdiChildView::isAttached(), KMdiChildView::restoreGeometry(), and KMdiChildView::setRestoreGeometry().

void KMdiMainFrm::addWindow KMdiChildView pView,
QRect  rectNormal,
int  flags = KMdi::StandardAdd
[virtual, slot]
 

See the method above for more details.

Additionally, it sets the geometry. Definition at line 507 of file kmdimainfrm.cpp.

References addWindow(), KMdiChildView::isAttached(), and KMdiChildView::setRestoreGeometry().

KMdiToolViewAccessor * KMdiMainFrm::addToolWindow QWidget pWnd,
KDockWidget::DockPosition  pos = KDockWidget::DockNone,
QWidget pTargetWnd = 0L,
int  percent = 50,
const QString tabToolTip = 0,
const QString tabCaption = 0
[virtual, slot]
 

Usually called from addWindow() when adding a tool view window.

It reparents the given widget as toplevel and stay-on-top on the application's main widget. Definition at line 548 of file kmdimainfrm.cpp.

Referenced by addWindow().

KMdiToolViewAccessor * KMdiMainFrm::createToolWindow  )  [slot]
 

Using this method you have to use the setWidget method of the access object, and it is very recommendet, that you use the widgetContainer() method for the parent of your newly created widget.

Definition at line 530 of file kmdimainfrm.cpp.

void KMdiMainFrm::removeWindowFromMdi KMdiChildView pWnd  )  [virtual, slot]
 

Removes a KMdiChildView from the MDI system and from the main frame`s control.

Note: The view will not be deleted, but it's getting toplevel (reparent to 0)! Definition at line 696 of file kmdimainfrm.cpp.

References KMdiChildView::activate(), activateView(), attachWindow(), childWindowCloseRequest(), KMdiChildArea::destroyChildButNotItsView(), detachWindow(), dockMenuItemActivated(), KMdiTaskBar::getButton(), KMdiChildArea::getVisibleChildCount(), KMdiChildView::isAttached(), KMdiChildView::isToolView(), lastChildViewClosed(), KMdiChildView::m_bToolView, KMdiChildFrm::m_pClient, KMdiChildView::mdiParent(), KMdiTaskBar::removeWinButton(), KMdiChildArea::topChild(), and windowMenuItemActivated().

void KMdiMainFrm::closeWindow KMdiChildView pWnd,
bool  layoutTaskBar = true
[virtual, slot]
 

Removes a KMdiChildView from the MDI system and from the main frame`s control.

Note: The view will be deleted! Definition at line 785 of file kmdimainfrm.cpp.

References KMdiChildView::activate(), KMdiChildArea::destroyChild(), KMdiChildArea::getVisibleChildCount(), KMdiChildView::isAttached(), lastChildViewClosed(), KMdiChildFrm::m_pClient, KMdiChildView::mdiParent(), KMdiTaskBar::removeWinButton(), and KMdiChildArea::topChild().

Referenced by event(), and ~KMdiMainFrm().

void KMdiMainFrm::slot_toggleTaskBar  )  [virtual, slot]
 

Switches the KMdiTaskBar on and off.

Definition at line 344 of file kmdimainfrm.cpp.

References KMdiTaskBar::isSwitchedOn(), and KMdiTaskBar::switchOn().

void KMdiMainFrm::attachWindow KMdiChildView pWnd,
bool  bShow = true,
bool  bAutomaticResize = false
[virtual, slot]
 

Makes a main frame controlled undocked KMdiChildView docked.

Doesn't work on KMdiChildView which aren't added to the MDI system. Use addWindow() for that. Definition at line 586 of file kmdimainfrm.cpp.

References KMdiChildFrm::captionHeight(), KMdiChildView::hide(), KMdiChildFrm::m_pClient, KMdiChildArea::manageChild(), KMdiChildFrm::setClient(), KMdiChildFrm::setRestoreGeometry(), switchToChildframeMode(), KMdiChildArea::topChild(), and KMdiChildView::youAreAttached().

Referenced by addWindow(), dockMenuItemActivated(), removeWindowFromMdi(), and switchToChildframeMode().

void KMdiMainFrm::detachWindow KMdiChildView pWnd,
bool  bShow = true
[virtual, slot]
 

Makes a docked KMdiChildView undocked.

The view window still remains under the main frame's MDI control. Definition at line 641 of file kmdimainfrm.cpp.

References activateView(), KMdiChildFrm::caption(), childViewIsDetachedNow(), defaultChildFrmSize(), KMdiChildArea::destroyChildButNotItsView(), KMdiChildArea::getCascadePoint(), KMdiChildFrm::icon(), KMdiChildView::isAttached(), mdiMode(), KMdiChildView::mdiParent(), KMdiChildView::setCaption(), KMdiChildFrm::unsetClient(), and KMdiChildView::youAreDetached().

Referenced by addWindow(), dockMenuItemActivated(), and removeWindowFromMdi().

void KMdiMainFrm::childWindowCloseRequest KMdiChildView pWnd  )  [virtual, slot]
 

Someone wants that the MDI view to be closed.

This method sends a KMdiViewCloseEvent to itself to break the function call stack. See also event() . Definition at line 1031 of file kmdimainfrm.cpp.

Referenced by addWindow(), and removeWindowFromMdi().

void KMdiMainFrm::closeAllViews  )  [virtual, slot]
 

Close all views.

Definition at line 1128 of file kmdimainfrm.cpp.

Referenced by fillWindowMenu().

void KMdiMainFrm::iconifyAllViews  )  [virtual, slot]
 

Iconfiy all views.

Definition at line 1146 of file kmdimainfrm.cpp.

References KMdiChildView::minimize().

Referenced by fillWindowMenu().

void KMdiMainFrm::closeActiveView  )  [virtual, slot]
 

Closes the view of the active (topchild) window.

Definition at line 1155 of file kmdimainfrm.cpp.

Referenced by fillWindowMenu().

void KMdiMainFrm::switchToToplevelMode  )  [virtual, slot]
 

Undocks all view windows (unix-like).

Definition at line 1233 of file kmdimainfrm.cpp.

References findRootDockWidgets(), setUndockPositioningOffset(), and KMdiChildView::show().

Referenced by fillWindowMenu(), and KMdiMainFrm().

void KMdiMainFrm::switchToChildframeMode  )  [virtual, slot]
 

Docks all view windows (Windows-like).

Definition at line 1337 of file kmdimainfrm.cpp.

References attachWindow(), findRootDockWidgets(), KMdiChildView::isAttached(), KMdiChildView::isToolView(), leftTopLevelMode(), and KMdiChildView::show().

Referenced by attachWindow(), and fillWindowMenu().

void KMdiMainFrm::switchToTabPageMode  )  [virtual, slot]
 

Docks all view windows (Windows-like).

Definition at line 1479 of file kmdimainfrm.cpp.

References activeWindow(), closeViewButtonPressed(), and KMdiTaskBar::switchOn().

Referenced by fillWindowMenu(), KMdiMainFrm(), and setToolviewStyle().

void KMdiMainFrm::switchToIDEAlMode  )  [virtual, slot]
 

Docks all view windows.

Toolviews use dockcontainers Definition at line 1670 of file kmdimainfrm.cpp.

References activeWindow(), closeViewButtonPressed(), and KMdiTaskBar::switchOn().

Referenced by fillWindowMenu(), KMdiMainFrm(), and setToolviewStyle().

void KMdiMainFrm::setIDEAlModeStyle int  flags  )  [slot]
 

Sets the appearance of the IDEAl mode.

See KMultiTabBar styles for the first 3 bits.

Deprecated:
use setToolviewStyle(int flags) instead
Definition at line 1599 of file kmdimainfrm.cpp.

Referenced by setToolviewStyle().

void KMdiMainFrm::setToolviewStyle int  flags  )  [slot]
 

Sets the appearance of the toolview tabs.

Parameters:
flags See KMdi::ToolviewStyle.
Since:
3.3
Definition at line 1623 of file kmdimainfrm.cpp.

References setIDEAlModeStyle(), switchToIDEAlMode(), and switchToTabPageMode().

bool KMdiMainFrm::isViewTaskBarOn  )  [slot]
 

Shows the view taskbar.

This should be connected with your "View" menu. Definition at line 2312 of file kmdimainfrm.cpp.

References KMdiTaskBar::isSwitchedOn().

void KMdiMainFrm::showViewTaskBar  )  [virtual, slot]
 

Shows the view taskbar.

This should be connected with your "View" menu. Definition at line 2321 of file kmdimainfrm.cpp.

References KMdiTaskBar::switchOn().

void KMdiMainFrm::hideViewTaskBar  )  [virtual, slot]
 

Hides the view taskbar.

This should be connected with your "View" menu. Definition at line 2328 of file kmdimainfrm.cpp.

References KMdiTaskBar::switchOn().

void KMdiMainFrm::fillWindowMenu  )  [virtual, slot]
 

Update of the window menu contents.

Definition at line 2335 of file kmdimainfrm.cpp.

References KMdiChildView::caption(), cascadeMaximized(), cascadeWindows(), closeActiveView(), closeAllViews(), expandHorizontal(), expandVertical(), KMdiChildView::getTimeStamp(), iconifyAllViews(), KMdiChildView::isAttached(), KMdiChildView::isMinimized(), KMdiChildView::isToolView(), KMdiChildView::setWindowMenuID(), switchToChildframeMode(), switchToIDEAlMode(), switchToTabPageMode(), switchToToplevelMode(), tileAnodine(), tilePragma(), and tileVertically().

Referenced by KMdiMainFrm().

virtual void KMdiMainFrm::cascadeWindows  )  [inline, virtual, slot]
 

Cascades the windows without resizing them.

Definition at line 572 of file kmdimainfrm.h.

References KMdiChildArea::cascadeWindows().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::cascadeMaximized  )  [inline, virtual, slot]
 

Cascades the windows resizing them to the maximum available size.

Definition at line 576 of file kmdimainfrm.h.

References KMdiChildArea::cascadeMaximized().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::expandVertical  )  [inline, virtual, slot]
 

Maximizes only in vertical direction.

Definition at line 580 of file kmdimainfrm.h.

References KMdiChildArea::expandVertical().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::expandHorizontal  )  [inline, virtual, slot]
 

Maximizes only in horizontal direction.

Definition at line 584 of file kmdimainfrm.h.

References KMdiChildArea::expandHorizontal().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::tilePragma  )  [inline, virtual, slot]
 

Tile Pragma.

Definition at line 588 of file kmdimainfrm.h.

References KMdiChildArea::tilePragma().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::tileAnodine  )  [inline, virtual, slot]
 

Tile Anodine.

Definition at line 592 of file kmdimainfrm.h.

References KMdiChildArea::tileAnodine().

Referenced by fillWindowMenu().

virtual void KMdiMainFrm::tileVertically  )  [inline, virtual, slot]
 

Tile Vertically.

Definition at line 596 of file kmdimainfrm.h.

References KMdiChildArea::tileVertically().

Referenced by fillWindowMenu().

void KMdiMainFrm::setFrameDecorOfAttachedViews int  frameDecor  )  [virtual, slot]
 

Sets the decoration of the window frame of docked (attached) MDI views.

Definition at line 2542 of file kmdimainfrm.cpp.

References KMdiChildView::isAttached(), KMdiChildView::isToolView(), KMdiChildView::mdiParent(), KMdiChildFrm::redecorateButtons(), and setMenuForSDIModeSysButtons().

void KMdiMainFrm::setEnableMaximizedChildFrmMode bool  bEnable  )  [virtual, slot]
 

If in Childframe mode, we can switch between maximized or restored shown MDI views.

Definition at line 2205 of file kmdimainfrm.cpp.

References frameDecorOfAttachedViews(), KMdiChildFrm::icon(), KMdiChildFrm::m_pClient, KMdiChildView::restore(), KMdiChildFrm::state(), switchOffMaximizeModeForMenu(), KMdiChildFrm::systemMenu(), and KMdiChildArea::topChild().

Referenced by createMdiManager().

void KMdiMainFrm::activateNextWin  )  [virtual, slot]
 

Activates the next open view.

Definition at line 2100 of file kmdimainfrm.cpp.

References activateView(), activeWindow(), and createIterator().

void KMdiMainFrm::activatePrevWin  )  [virtual, slot]
 

Activates the previous open view.

Definition at line 2120 of file kmdimainfrm.cpp.

References activateView(), activeWindow(), and createIterator().

void KMdiMainFrm::activateFirstWin  )  [virtual, slot]
 

Activates the view first viewed concerning to the access time.

Definition at line 2140 of file kmdimainfrm.cpp.

References activateView(), activeWindow(), createIterator(), and KMdiChildView::getTimeStamp().

void KMdiMainFrm::activateLastWin  )  [virtual, slot]
 

Activates the view last viewed concerning to the access time.

Definition at line 2168 of file kmdimainfrm.cpp.

References activateView(), activeWindow(), createIterator(), and KMdiChildView::getTimeStamp().

void KMdiMainFrm::activateView int  index  )  [virtual, slot]
 

Activates the view with the tab page index (TabPage mode only).

Definition at line 2193 of file kmdimainfrm.cpp.

References KMdiChildView::activate().

Referenced by activateFirstWin(), activateLastWin(), activateNextWin(), activatePrevWin(), addWindow(), detachWindow(), removeWindowFromMdi(), taskbarButtonRightClicked(), and windowMenuItemActivated().

void KMdiMainFrm::createTaskBar  )  [protected, virtual]
 

Creates a new MDI taskbar (showing the MDI views as taskbar entries) and shows it.

Definition at line 338 of file kmdimainfrm.cpp.

Referenced by KMdiMainFrm().

void KMdiMainFrm::createMdiManager  )  [protected, virtual]
 

Creates the MDI view area and connects some signals and slots with the KMdiMainFrm widget.

Definition at line 326 of file kmdimainfrm.cpp.

References lastChildFrmClosed(), popupWindowMenu(), setEnableMaximizedChildFrmMode(), switchOffMaximizeModeForMenu(), and updateSysButtonConnections().

Referenced by KMdiMainFrm().

void KMdiMainFrm::blockClearingOfWindowMenu bool  bBlocked  )  [inline, protected]
 

prevents fillWindowMenu() from m_pWindowMenu->clear().

You have to care for it by yourself. This is useful if you want to add some actions in your overridden fillWindowMenu() method. Definition at line 648 of file kmdimainfrm.h.

KMdi::TabWidgetVisibility KMdiMainFrm::tabWidgetVisibility  )  [protected]
 

Get tabwidget visibility.

Definition at line 2640 of file kmdimainfrm.cpp.

void KMdiMainFrm::setTabWidgetVisibility KMdi::TabWidgetVisibility   )  [protected]
 

Set tabwidget visibility.

Definition at line 2648 of file kmdimainfrm.cpp.

KTabWidget * KMdiMainFrm::tabWidget  )  const [protected]
 

Returns the tabwidget used in IDEAl and Tabbed modes.

Returns 0 in other modes. Definition at line 2654 of file kmdimainfrm.cpp.

void KMdiMainFrm::activateView KMdiChildView pWnd  )  [protected, virtual, slot]
 

Sets the focus to this MDI view, raises it, activates its taskbar button and updates the system buttons in the main menubar when in maximized (Maximize mode).

Definition at line 970 of file kmdimainfrm.cpp.

References KMdiChildView::activate(), KMdiChildView::isAttached(), KMdiChildView::m_bInterruptActivation, KMdiChildView::m_bMainframesActivateViewIsPending, KMdiChildView::mdiParent(), KMdiChildView::raise(), KMdiChildFrm::raiseAndActivate(), KMdiTaskBar::setActiveButton(), KMdiChildArea::setTopChild(), and KMdiChildArea::topChild().

void KMdiMainFrm::taskbarButtonRightClicked KMdiChildView pWnd  )  [protected, virtual, slot]
 

Activates the MDI view (see activateView() ) and popups the taskBar popup menu (see taskBarPopup() ).

Definition at line 1024 of file kmdimainfrm.cpp.

References activateView(), and taskBarPopup().

void KMdiMainFrm::switchOffMaximizeModeForMenu KMdiChildFrm oldChild  )  [protected, slot]
 

Turns the system buttons for maximize mode (SDI mode) off, and disconnects them.

Definition at line 2253 of file kmdimainfrm.cpp.

Referenced by createMdiManager(), and setEnableMaximizedChildFrmMode().

void KMdiMainFrm::updateSysButtonConnections KMdiChildFrm oldChild,
KMdiChildFrm newChild
[protected, slot]
 

Reconnects the system buttons form maximize mode (SDI mode) with the new child frame.

Definition at line 2277 of file kmdimainfrm.cpp.

References frameDecorOfAttachedViews(), KMdiChildFrm::icon(), and KMdiChildFrm::systemMenu().

Referenced by createMdiManager().

void KMdiMainFrm::windowMenuItemActivated int  id  )  [protected, slot]
 

Usually called when the user clicks an MDI view item in the "Window" menu.

Definition at line 2485 of file kmdimainfrm.cpp.

References activateView(), KMdiChildView::isAttached(), KMdiChildView::isMinimized(), KMdiChildFrm::m_pClient, KMdiChildView::minimize(), and KMdiChildArea::topChild().

Referenced by addWindow(), and removeWindowFromMdi().

void KMdiMainFrm::dockMenuItemActivated int  id  )  [protected, slot]
 

Usually called when the user clicks an MDI view item in the sub-popup menu "Docking" of the "Window" menu.

Definition at line 2505 of file kmdimainfrm.cpp.

References attachWindow(), detachWindow(), KMdiChildView::isAttached(), KMdiChildView::isMinimized(), and KMdiChildView::minimize().

Referenced by addWindow(), and removeWindowFromMdi().

void KMdiMainFrm::popupWindowMenu QPoint  p  )  [protected, slot]
 

Popups the "Window" menu.

See also windowPopup() . Definition at line 2522 of file kmdimainfrm.cpp.

References isFakingSDIApplication().

Referenced by createMdiManager().

void KMdiMainFrm::dragEndTimeOut  )  [protected, slot]
 

The timer for main widget moving has elapsed -> send drag end to all concerned views.

Definition at line 2530 of file kmdimainfrm.cpp.

Referenced by KMdiMainFrm().

void KMdiMainFrm::closeViewButtonPressed  )  [protected, slot]
 

internally used to handle click on view close button (TabPage mode, only)

Definition at line 2580 of file kmdimainfrm.cpp.

References activeWindow().

Referenced by switchToIDEAlMode(), and switchToTabPageMode().

void KMdiMainFrm::lastChildFrmClosed  )  [signal]
 

Signals the last attached KMdiChildView has been closed.

Referenced by createMdiManager().

void KMdiMainFrm::lastChildViewClosed  )  [signal]
 

Signals the last KMdiChildView (that is under MDI control) has been closed.

Referenced by closeWindow(), removeWindowFromMdi(), and ~KMdiMainFrm().

void KMdiMainFrm::leftTopLevelMode  )  [signal]
 

Signals that the Toplevel mode has been left.

Referenced by switchToChildframeMode().

void KMdiMainFrm::childViewIsDetachedNow QWidget  )  [signal]
 

Signals that a child view has been detached (undocked to desktop).

Referenced by addWindow(), and detachWindow().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmdi Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Sep 29 09:44:40 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003