org.kde.koala

Class KMdiChildView

public class KMdiChildView extends QWidget

Base class for all MDI view widgets. KMdi stores additional information in this class to handle the attach/detach mechanism and such things. All such windows 'lives' attached to a KMdiChildFrm widget managed by KMdiChildArea, or detached (managed by the window manager.) So remember that the KMdiChildView.parent pointer may change, and may be null, too. There are 2 possibilities for you to put your widgets under MDI control: Either you inherit all the views from KMdiChildView:
   public class MyMdiWidget implements KMdiChildView
   { .... }
   ...
   MyMdiWidget w;
   mainframe.addWindow(w, flags);
   
or you wrap them by a KMdiChildView somehow like this:
 void DocViewMan.addKMdiFrame(QWidget pNewView, boolean bShow, QPixmap icon)
 {
   // cover it by a KMdi childview and add that MDI system
   KMdiChildView pMDICover = new KMdiChildView( pNewView.caption());
   pMDICover.setIcon(icon);
   m_MDICoverList.append( pMDICover);
   QBoxLayout pLayout = new QHBoxLayout( pMDICover, 0, -1, "layout");
   pNewView.reparent( pMDICover, QPoint(0,0));
   pLayout.addWidget( pNewView);
   pMDICover.setName( pNewView.name());
   // captions
   String shortName = pNewView.caption();
   int length = shortName.length();
   shortName = shortName.right(length - (shortName.findRev('/') +1));
   pMDICover.setTabCaption( shortName);
   pMDICover.setCaption(pNewView.caption());
   // fake a viewActivated to update the currentEditView/currentBrowserView pointers _before_ adding to MDI control
   slot_viewActivated( pMDICover);
   // take it under MDI mainframe control (note: this triggers also a setFocus())
   int flags;
   if (bShow) {
     flags = KMdi.StandardAdd;
   }
   else {
     flags = KMdi.Hide;
   }
   // set the accelerators for Toplevel MDI mode (each toplevel window needs its own accels
   connect( m_pParent, SIGNAL("childViewIsDetachedNow(QWidget)"), this, SLOT("initKeyAccel(QWidget)") );
   m_pParent.addWindow( pMDICover, flags);
   // correct the default settings of KMdi ('cause we haven't a tab order for subwidget focuses)
   pMDICover.setFirstFocusableChildWidget(null);
   pMDICover.setLastFocusableChildWidget(null);
 }
 
See KMdiChildViewSignals for signals emitted by KMdiChildView

UNKNOWN: Base class for all your special view windows.

Constructor Summary
protected KMdiChildView(Class dummy)
KMdiChildView(String caption, QWidget parentWidget, String name, int f)
Constructor
KMdiChildView(String caption, QWidget parentWidget, String name)
KMdiChildView(String caption, QWidget parentWidget)
KMdiChildView(String caption)
KMdiChildView(QWidget parentWidget, String name, int f)
Constructor sets "Unnamed" as default caption
KMdiChildView(QWidget parentWidget, String name)
KMdiChildView(QWidget parentWidget)
KMdiChildView()
Method Summary
voidactivate()
This method does the same as focusInEvent().
voidattach()
Attaches this window to the Mdi manager.
Stringcaption()
Returns the caption of the child window (different from the caption on the button in the taskbar)
StringclassName()
protected voidcloseEvent(QCloseEvent e)
Ignores the event and calls KMdiMainFrm.childWindowCloseRequest instead.
voiddetach()
Detaches this window from the Mdi manager.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
booleaneventFilter(QObject arg1, QEvent e)
It only catches QEvent.KeyPress events there.
QRectexternalGeometry()
Returns the frame geometry of this window or of the parent if there is any...
protected voidfinalize()
Deletes the wrapped C++ instance
QWidgetfocusedChildWidget()
Returns the current focused child widget of this widget
protected voidfocusInEvent(QFocusEvent e)
If attached, the childframe will be activated and the MDI taskbar button will be pressed.
protected voidfocusOutEvent(QFocusEvent e)
Send the lostFocus signal
CalendargetTimeStamp()
Recall a previously remembered time, i.e. the value of m_time
voidhide()
Calls QWidget.hide() or it's parent widget hide() if attached
QRectinternalGeometry()
Returns the geometry of this MDI child window as QWidget.geometry() does.
booleanisAttached()
Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI view is in toplevel mode
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisMaximized()
Tells if the window is minimized when attached to the Mdi manager, otherwise returns false.
booleanisMinimized()
Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating'.
booleanisToolView()
Returns if this is added as MDI tool-view
voidmaximize(boolean bAnimate)
Maximizes this window when it is attached to the Mdi manager.
voidmaximize()
Maximizes the MDI view.
KMdiChildFrmmdiParent()
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached)
QMetaObjectmetaObject()
voidminimize(boolean bAnimate)
Minimizes this window when it is attached to the Mdi manager.
voidminimize()
Mimimizes the MDI view.
QPixmapmyIconPtr()
You should override this function in the derived class.
voidraise()
Calls QWidget.raise() or it's parent widget raise() if attached
voidremoveEventFilterForAllChildren()
Switches interposing in event loop of all current child widgets off.
protected voidresizeEvent(QResizeEvent e)
Internally used for the minimize/maximize/restore mechanism when in attach mode.
voidrestore()
Restores this window to its normal size.
QRectrestoreGeometry()
Returns the geometry that will be restored by calling restore().
voidsetCaption(String szCaption)
Sets the window caption string...
voidsetExternalGeometry(QRect newGeomety)
Sets the geometry of the frame of this MDI child window.
voidsetFirstFocusableChildWidget(QWidget arg1)
Memorizes the first focusable child widget of this widget
voidsetInternalGeometry(QRect newGeomety)
Sets the geometry of the client area of this MDI child window.
voidsetLastFocusableChildWidget(QWidget arg1)
Memorizes the last focusable child widget of this widget
voidsetMaximumSize(int maxw, int maxh)
Sets the maximum size of the widget to w by h pixels.
voidsetMDICaption(String caption)
Sets the caption of both the window and the button on the taskbar
voidsetMinimumSize(int minw, int minh)
Sets the minimum size of the widget to w by h pixels.
voidsetRestoreGeometry(QRect newRestGeo)
Sets the geometry that will be restored by calling restore().
voidsetTabCaption(String caption)
Sets the caption of the button referring to this window
voidsetWindowMenuID(int id)
Internally used for setting an ID for the 'Window' menu entry
voidshow()
Calls QWidget.show but also for it's parent widget if attached
voidshowMaximized()
Overridden from its base class method.
voidshowMinimized()
Overridden from its base class method.
voidshowNormal()
Overridden from its base class method.
protected voidslot_childDestroyed()
voidslot_clickedInDockMenu()
Called if someone click on the "Dock/Undock..." menu item for this child frame window
voidslot_clickedInWindowMenu()
Called if someone click on the "Window" menu item for this child frame window
StringtabCaption()
Returns the caption of the button on the taskbar
protected voidtrackIconAndCaptionChanges(QWidget view)
voidupdateTimeStamp()
Remember the current time
voidyouAreAttached(KMdiChildFrm lpC)
Internally called, if KMdiMainFrm.attach is called.
voidyouAreDetached()
Internally called, if KMdiMainFrm.detach is called.

Constructor Detail

KMdiChildView

protected KMdiChildView(Class dummy)

KMdiChildView

public KMdiChildView(String caption, QWidget parentWidget, String name, int f)
Constructor

UNKNOWN: Constructor

KMdiChildView

public KMdiChildView(String caption, QWidget parentWidget, String name)

KMdiChildView

public KMdiChildView(String caption, QWidget parentWidget)

KMdiChildView

public KMdiChildView(String caption)

KMdiChildView

public KMdiChildView(QWidget parentWidget, String name, int f)
Constructor sets "Unnamed" as default caption

UNKNOWN: Constructor sets "Unnamed" as default caption

KMdiChildView

public KMdiChildView(QWidget parentWidget, String name)

KMdiChildView

public KMdiChildView(QWidget parentWidget)

KMdiChildView

public KMdiChildView()

Method Detail

activate

public void activate()
This method does the same as focusInEvent(). That's why it is a replacement for the setFocus() call. It makes sense if you for instance want to focus (I mean raise and activate) this view although the real focus is in another toplevel widget. focusInEvent() will never get called in that case and your setFocus() call for this widget would fail without any effect. Use this method with caution, it always raises the view and pushes the taskbar button. Also when the focus is still on another MDI view in the same toplevel window where this is located!

UNKNOWN: This method does the same as focusInEvent().

attach

public void attach()
Attaches this window to the Mdi manager. It calls the KMdiMainFrm attachWindow function , so if you have a pointer to this KMdiMainFrm you'll be faster calling that function.

UNKNOWN: Attaches this window to the Mdi manager.

caption

public String caption()
Returns the caption of the child window (different from the caption on the button in the taskbar)

UNKNOWN: Returns the caption of the child window (different from the caption on the button in the taskbar)

className

public String className()

closeEvent

protected void closeEvent(QCloseEvent e)
Ignores the event and calls KMdiMainFrm.childWindowCloseRequest instead. This is because the mainframe has control over the views. Therefore the MDI view has to request the mainframe for a close.

UNKNOWN: Ignores the event and calls KMdiMainFrm.childWindowCloseRequest instead.

detach

public void detach()
Detaches this window from the Mdi manager. It calls the KMdiMainFrm detachWindow function , so if you have a pointer to this KMdiMainFrm you'll be faster calling that function.

UNKNOWN: Detaches this window from the Mdi manager.

dispose

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

eventFilter

public boolean eventFilter(QObject arg1, QEvent e)
It only catches QEvent.KeyPress events there. If a Qt.Key_Tab is pressed, the internal MDI focus handling is called. That means if the last focusable child widget of this is called, it will jump to the first focusable child widget of this. See KMdiChildView.setFirstFocusableChildWidget and KMdiChildView.lastFirstFocusableChildWidget

UNKNOWN: It only catches QEvent.KeyPress events there.

externalGeometry

public QRect externalGeometry()
Returns the frame geometry of this window or of the parent if there is any...

UNKNOWN: Returns the frame geometry of this window or of the parent if there is any.

finalize

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

focusedChildWidget

public QWidget focusedChildWidget()
Returns the current focused child widget of this widget

UNKNOWN: Returns the current focused child widget of this widget

focusInEvent

protected void focusInEvent(QFocusEvent e)
If attached, the childframe will be activated and the MDI taskbar button will be pressed. Additionally, the memorized old focused child widget of this is focused again. Sends the focusInEventOccurs signal before changing the focus and the gotFocus signal after changing the focus.

UNKNOWN: If attached, the childframe will be activated and the MDI taskbar button will be pressed.

focusOutEvent

protected void focusOutEvent(QFocusEvent e)
Send the lostFocus signal

UNKNOWN: Send the lostFocus signal

getTimeStamp

public Calendar getTimeStamp()
Recall a previously remembered time, i.e. the value of m_time

UNKNOWN: Recall a previously remembered time, i.

hide

public void hide()
Calls QWidget.hide() or it's parent widget hide() if attached

UNKNOWN: Calls QWidget.hide() or it's parent widget hide() if attached

internalGeometry

public QRect internalGeometry()
Returns the geometry of this MDI child window as QWidget.geometry() does.

UNKNOWN: Returns the geometry of this MDI child window as QWidget.geometry() does.

isAttached

public boolean isAttached()
Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI view is in toplevel mode

UNKNOWN: Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI view is in toplevel mode

isDisposed

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

isMaximized

public boolean isMaximized()
Tells if the window is minimized when attached to the Mdi manager, otherwise returns false.

UNKNOWN: Tells if the window is minimized when attached to the Mdi manager, otherwise returns false.

isMinimized

public boolean isMinimized()
Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating'.

UNKNOWN: Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating'.

isToolView

public boolean isToolView()
Returns if this is added as MDI tool-view

UNKNOWN: Returns if this is added as MDI tool-view

maximize

public void maximize(boolean bAnimate)
Maximizes this window when it is attached to the Mdi manager. Otherwise has no effect

UNKNOWN: Maximizes this window when it is attached to the Mdi manager.

maximize

public void maximize()
Maximizes the MDI view. If attached, this widget will fill the whole MDI view area widget. The system buttons move to the main menubar (if set by KMdiMainFrm.setMenuForSDIModeSysButtons ). If detached, it will use the minimize of the underlying system ( QWidget.showMaximized ).

UNKNOWN: Maximizes the MDI view.

mdiParent

public KMdiChildFrm mdiParent()
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached)

UNKNOWN: Returns the KMdiChildFrm parent widget (or 0 if the window is not attached)

metaObject

public QMetaObject metaObject()

minimize

public void minimize(boolean bAnimate)
Minimizes this window when it is attached to the Mdi manager. Otherwise has no effect

UNKNOWN: Minimizes this window when it is attached to the Mdi manager.

minimize

public void minimize()
Mimimizes the MDI view. If attached, the covering childframe widget is minimized (only a mini widget showing the caption bar and the system buttons will remain visible). If detached, it will use the minimize of the underlying system ( QWidget.showMinimized ).

UNKNOWN: Mimimizes the MDI view.

myIconPtr

public QPixmap myIconPtr()
You should override this function in the derived class.

UNKNOWN: You should override this function in the derived class.

raise

public void raise()
Calls QWidget.raise() or it's parent widget raise() if attached

UNKNOWN: Calls QWidget.raise() or it's parent widget raise() if attached

removeEventFilterForAllChildren

public void removeEventFilterForAllChildren()
Switches interposing in event loop of all current child widgets off.

UNKNOWN: Switches interposing in event loop of all current child widgets off.

resizeEvent

protected void resizeEvent(QResizeEvent e)
Internally used for the minimize/maximize/restore mechanism when in attach mode.

UNKNOWN: Internally used for the minimize/maximize/restore mechanism when in attach mode.

restore

public void restore()
Restores this window to its normal size. Also known as 'normalize'.

UNKNOWN: Restores this window to its normal size.

restoreGeometry

public QRect restoreGeometry()
Returns the geometry that will be restored by calling restore().

UNKNOWN: Returns the geometry that will be restored by calling restore().

setCaption

public void setCaption(String szCaption)
Sets the window caption string... Calls updateButton on the taskbar button if it has been set.

UNKNOWN: Sets the window caption string.

setExternalGeometry

public void setExternalGeometry(QRect newGeomety)
Sets the geometry of the frame of this MDI child window. The top left position of the argument is the position of the top left point of the frame in its parent coordinates and the arguments width and height is the width and height of the widget frame. Please note: This differs from the behavior of QWidget.setGeometry()!

UNKNOWN: Sets the geometry of the frame of this MDI child window.

setFirstFocusableChildWidget

public void setFirstFocusableChildWidget(QWidget arg1)
Memorizes the first focusable child widget of this widget

UNKNOWN: Memorizes the first focusable child widget of this widget

setInternalGeometry

public void setInternalGeometry(QRect newGeomety)
Sets the geometry of the client area of this MDI child window. The top left position of the argument is the position of the top left point of the client area in its parent coordinates and the arguments width and height is the width and height of the client area. Please note: This differs from the behavior of QWidget.setGeometry()!

UNKNOWN: Sets the geometry of the client area of this MDI child window.

setLastFocusableChildWidget

public void setLastFocusableChildWidget(QWidget arg1)
Memorizes the last focusable child widget of this widget

UNKNOWN: Memorizes the last focusable child widget of this widget

setMaximumSize

public void setMaximumSize(int maxw, int maxh)
Sets the maximum size of the widget to w by h pixels. It extends it base clase method in a way that the maximum size of its childframe (if there is one) will be set, additionally.

UNKNOWN: Sets the maximum size of the widget to w by h pixels.

setMDICaption

public void setMDICaption(String caption)
Sets the caption of both the window and the button on the taskbar

UNKNOWN: Sets the caption of both the window and the button on the taskbar

setMinimumSize

public void setMinimumSize(int minw, int minh)
Sets the minimum size of the widget to w by h pixels. It extends it base clase method in a way that the minimum size of its childframe (if there is one) will be set, additionally.

UNKNOWN: Sets the minimum size of the widget to w by h pixels.

setRestoreGeometry

public void setRestoreGeometry(QRect newRestGeo)
Sets the geometry that will be restored by calling restore().

UNKNOWN: Sets the geometry that will be restored by calling restore().

setTabCaption

public void setTabCaption(String caption)
Sets the caption of the button referring to this window

UNKNOWN: Sets the caption of the button referring to this window

setWindowMenuID

public void setWindowMenuID(int id)
Internally used for setting an ID for the 'Window' menu entry

UNKNOWN: Internally used for setting an ID for the 'Window' menu entry

show

public void show()
Calls QWidget.show but also for it's parent widget if attached

UNKNOWN: Calls QWidget.show but also for it's parent widget if attached

showMaximized

public void showMaximized()
Overridden from its base class method. Emits a signal KMdiChildView.isMaximizedNow , additionally. Note that this method is not used by an external windows manager call on system maximizing.

UNKNOWN: Overridden from its base class method.

showMinimized

public void showMinimized()
Overridden from its base class method. Emits a signal KMdiChildView.isMinimizedNow , additionally. Note that this method is not used by an external windows manager call on system minimizing.

UNKNOWN: Overridden from its base class method.

showNormal

public void showNormal()
Overridden from its base class method. Emits a signal KMdiChildView.isRestoredNow , additionally. Note that this method is not used by an external windows manager call on system normalizing.

UNKNOWN: Overridden from its base class method.

slot_childDestroyed

protected void slot_childDestroyed()

slot_clickedInDockMenu

public void slot_clickedInDockMenu()
Called if someone click on the "Dock/Undock..." menu item for this child frame window

UNKNOWN: Called if someone click on the "Dock/Undock.

slot_clickedInWindowMenu

public void slot_clickedInWindowMenu()
Called if someone click on the "Window" menu item for this child frame window

UNKNOWN: Called if someone click on the "Window" menu item for this child frame window

tabCaption

public String tabCaption()
Returns the caption of the button on the taskbar

UNKNOWN: Returns the caption of the button on the taskbar

trackIconAndCaptionChanges

protected void trackIconAndCaptionChanges(QWidget view)

updateTimeStamp

public void updateTimeStamp()
Remember the current time

UNKNOWN: Remember the current time

youAreAttached

public void youAreAttached(KMdiChildFrm lpC)
Internally called, if KMdiMainFrm.attach is called. Actually, only the caption of the covering childframe is set.

UNKNOWN: Internally called, if KMdiMainFrm.attach is called.

youAreDetached

public void youAreDetached()
Internally called, if KMdiMainFrm.detach is called. Some things for going toplevel will be done here.

UNKNOWN: Internally called, if KMdiMainFrm.detach is called.