kmdichildview.h
//----------------------------------------------------------------------------
// filename : kmdichildview.h
//----------------------------------------------------------------------------
// Project : KDE MDI extension
//
// begin : 07/1999 by Szymon Stefanek as part of kvirc
// (an IRC application)
// changes : 09/1999 by Falk Brettschneider to create an
// - 06/2000 stand-alone Qt extension set of
// classes and a Qt-based library
// 2000-2003 maintained by the KDevelop project
// patches : 02/2000 by Massimo Morin (mmorin@schedsys.com)
// */2000 by Lars Beikirch (Lars.Beikirch@gmx.net)
// 02/2001 by Eva Brucherseifer (eva@rt.e-technik.tu-darmstadt.de)
// 01/2003 by Jens Zurheide (jens.zurheide@gmx.de)
//
// copyright : (C) 1999-2003 by Falk Brettschneider
// and
// Szymon Stefanek (stefanek@tin.it)
// email : falkbr@kdevelop.org (Falk Brettschneider)
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
//----------------------------------------------------------------------------
#ifndef _KMDI_CHILD_VIEW_H_
#define _KMDI_CHILD_VIEW_H_
#include <qwidget.h>
#include <qpixmap.h>
#include <qrect.h>
#include <qapplication.h>
#include <qdatetime.h>
#include "kmdichildfrm.h"
class KMdiChildViewPrivate;
class KMDI_EXPORT KMdiChildView : public QWidget
{
friend class KMdiMainFrm;
friend class KMdiChildFrm;
Q_OBJECT
// attributes
protected:
QString m_szCaption;
QString m_sTabCaption;
QWidget* m_focusedChildWidget;
QWidget* m_firstFocusableChildWidget;
QWidget* m_lastFocusableChildWidget;
int m_windowMenuID;
bool m_stateChanged;
QDateTime m_time;
private:
bool m_bToolView;
bool m_bInterruptActivation;
bool m_bMainframesActivateViewIsPending;
bool m_bFocusInEventIsPending;
// methods
public:
KMdiChildView( const QString& caption, QWidget* parentWidget = 0L, const char* name = 0L, WFlags f = 0 );
KMdiChildView( QWidget* parentWidget = 0L, const char* name = 0L, WFlags f = 0 );
~KMdiChildView();
void activate();
void setFirstFocusableChildWidget( QWidget* );
void setLastFocusableChildWidget( QWidget* );
QWidget* focusedChildWidget();
bool isAttached() const { return ( mdiParent() != 0L ); }
const QString& caption() const { return m_szCaption; }
const QString& tabCaption() const { return m_sTabCaption; }
virtual void setCaption( const QString& szCaption );
virtual void setTabCaption( const QString& caption );
virtual void setMDICaption( const QString &caption );
KMdiChildFrm *mdiParent() const;
bool isMinimized() const;
bool isMaximized() const;
QRect internalGeometry() const;
void setInternalGeometry( const QRect& newGeomety );
QRect externalGeometry() const;
void setExternalGeometry( const QRect& newGeomety );
virtual QPixmap* myIconPtr();
virtual void minimize( bool bAnimate );
virtual void maximize( bool bAnimate );
QRect restoreGeometry();
void setRestoreGeometry( const QRect& newRestGeo );
void removeEventFilterForAllChildren();
void setWindowMenuID( int id );
virtual void setMinimumSize ( int minw, int minh );
virtual void setMaximumSize ( int maxw, int maxh );
inline bool isToolView() const { return m_bToolView; }
inline void updateTimeStamp()
{
m_time.setDate( QDate::currentDate() );
m_time.setTime( QTime::currentTime() );
}
inline const QDateTime& getTimeStamp() const { return m_time; }
public slots:
virtual void attach();
virtual void detach();
virtual void minimize();
virtual void maximize();
virtual void restore();
virtual void youAreAttached( KMdiChildFrm *lpC );
virtual void youAreDetached();
virtual void slot_clickedInWindowMenu();
virtual void slot_clickedInDockMenu();
virtual void show();
virtual void hide();
virtual void raise();
virtual void showMinimized();
virtual void showMaximized();
virtual void showNormal();
protected:
virtual void closeEvent( QCloseEvent *e );
virtual bool eventFilter( QObject *obj, QEvent *e );
virtual void focusInEvent( QFocusEvent *e );
virtual void focusOutEvent( QFocusEvent *e );
virtual void resizeEvent( QResizeEvent *e );
void trackIconAndCaptionChanges( QWidget *view );
protected slots:
void slot_childDestroyed();
signals:
void attachWindow( KMdiChildView*, bool );
void detachWindow( KMdiChildView*, bool );
void focusInEventOccurs( KMdiChildView* );
void gotFocus( KMdiChildView* );
void activated( KMdiChildView* );
void lostFocus( KMdiChildView* );
void deactivated( KMdiChildView* );
void childWindowCloseRequest( KMdiChildView* );
void windowCaptionChanged( const QString& );
void tabCaptionChanged( const QString& );
void mdiParentNowMaximized( bool );
void clickedInWindowMenu( int );
void clickedInDockMenu( int );
void isMaximizedNow();
void isMinimizedNow();
void isRestoredNow();
void isAttachedNow();
void isDetachedNow();
void iconUpdated( QWidget*, QPixmap );
void captionUpdated( QWidget*, const QString& );
private:
KMdiChildViewPrivate *d;
QWidget *m_trackChanges;
};
inline KMdiChildFrm *KMdiChildView::mdiParent() const
{
QWidget * pw = parentWidget();
if ( pw != 0L )
if ( pw->inherits( "KMdiChildFrm" ) )
return ( KMdiChildFrm * ) pw;
return 0L;
}
#endif //_KMDICHILDVIEW_H_
// kate: space-indent off; replace-tabs off; indent-mode csands; tab-width 4;
KMdiChildFrm::setRestoreGeometry
void setRestoreGeometry(const QRect &newRestGeo)
Sets the geometry that will be restored by calling restore().
Definition: kmdichildfrm.cpp:680
KMdiChildView::tabCaption
const QString & tabCaption() const
Returns the caption of the button on the taskbar.
Definition: kmdichildview.h:237
KMdiChildFrm::eventFilter
virtual bool eventFilter(QObject *, QEvent *)
Reimplemented from the base class.
Definition: kmdichildfrm.cpp:1077
KMdiChildView::m_szCaption
QString m_szCaption
See KMdiChildView::caption.
Definition: kmdichildview.h:119
KMdiChildView::isToolView
bool isToolView() const
Returns if this is added as MDI tool-view.
Definition: kmdichildview.h:354
KMdiMainFrm
Base class for all your special main frames.
Definition: kmdimainfrm.h:239
KMdiChildView::updateTimeStamp
void updateTimeStamp()
Remember the current time.
Definition: kmdichildview.h:359
KMdiChildFrm::setMinimumSize
virtual void setMinimumSize(int minw, int minh)
Sets the minimum size of the widget to w by h pixels.
Definition: kmdichildfrm.cpp:1217
KMdiChildView::isAttached
bool isAttached() const
Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI vi...
Definition: kmdichildview.h:227
KMdiChildFrm::caption
const QString & caption()
Gets the caption of this mdi child.
Definition: kmdichildfrm.h:230
KMdiChildView::m_time
QDateTime m_time
Holds the time when this view was activated (not only displayed) for the last time.
Definition: kmdichildview.h:155
KMdiChildView::m_focusedChildWidget
QWidget * m_focusedChildWidget
See KMdiChildView::focusedChildWidget.
Definition: kmdichildview.h:129
KMdiChildView::caption
const QString & caption() const
Returns the caption of the child window (different from the caption on the button in the taskbar) ...
Definition: kmdichildview.h:232
KMdiChildView::m_stateChanged
bool m_stateChanged
Holds a temporary information about if the MDI view state has changed but is not processed yet (pendi...
Definition: kmdichildview.h:150
KMdiChildFrm::resizeEvent
virtual void resizeEvent(QResizeEvent *)
Reimplemented from the base class.
Definition: kmdichildfrm.cpp:982
KMdiChildFrm
Internal class.
Definition: kmdichildfrm.h:130
KMdiChildView::m_firstFocusableChildWidget
QWidget * m_firstFocusableChildWidget
See KMdiChildView::setFirstFocusableChildWidget.
Definition: kmdichildview.h:134
KMdiChildView::mdiParent
KMdiChildFrm * mdiParent() const
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached)
Definition: kmdichildview.h:604
KMdiChildView::m_sTabCaption
QString m_sTabCaption
See KMdiChildView::tabCaption.
Definition: kmdichildview.h:124
KMdiChildView::getTimeStamp
const QDateTime & getTimeStamp() const
Recall a previously remembered time, i.e.
Definition: kmdichildview.h:368
KMdiChildFrm::setCaption
void setCaption(const QString &text)
Sets the caption of this window.
Definition: kmdichildfrm.cpp:687
KMdiChildView
Base class for all your special view windows.
Definition: kmdichildview.h:108
KMdiChildView::m_lastFocusableChildWidget
QWidget * m_lastFocusableChildWidget
See KMdiChildView::setLastFocusableChildWidget.
Definition: kmdichildview.h:139
KMdiChildFrm::restoreGeometry
QRect restoreGeometry() const
Returns the geometry that will be restored by calling restore().
Definition: kmdichildfrm.cpp:673
KMdiChildView::m_windowMenuID
int m_windowMenuID
Every child view window has an temporary ID in the Window menu of the main frame. ...
Definition: kmdichildview.h:144

KDE Home | KDE Accessibility Home | Description of Access Keys