kmdichildarea.h

00001 //----------------------------------------------------------------------------
00002 //    filename             : kmdichildarea.h
00003 //----------------------------------------------------------------------------
00004 //    Project              : KDE MDI extension
00005 //
00006 //    begin                : 07/1999       by Szymon Stefanek as part of kvirc
00007 //                                         (an IRC application)
00008 //    changes              : 09/1999       by Falk Brettschneider to create an
00009 //                           - 06/2000     stand-alone Qt extension set of
00010 //                                         classes and a Qt-based library
00011 //                           2000-2003     maintained by the KDevelop project
00012 //
00013 //    copyright            : (C) 1999-2003 by Falk Brettschneider
00014 //                                         and
00015 //                                         Szymon Stefanek (stefanek@tin.it)
00016 //    email                :  falkbr@kdevelop.org (Falk Brettschneider)
00017 //----------------------------------------------------------------------------
00018 //
00019 //----------------------------------------------------------------------------
00020 //
00021 //    This program is free software; you can redistribute it and/or modify
00022 //    it under the terms of the GNU Library General Public License as
00023 //    published by the Free Software Foundation; either version 2 of the
00024 //    License, or (at your option) any later version.
00025 //
00026 //----------------------------------------------------------------------------
00027 
00028 #ifndef _KMDI_CHILD_AREA_H_
00029 #define _KMDI_CHILD_AREA_H_
00030 
00031 #include <qframe.h>
00032 #include <qptrlist.h>
00033 
00034 #include "kmdichildfrm.h"
00035 #include "kmdichildview.h"
00036 
00037 class KMdiChildAreaPrivate;
00038 
00052 class KMDI_EXPORT KMdiChildArea : public QFrame
00053 {
00054     friend class KMdiChildFrmCaption;
00055     friend class KMdiChildFrm;
00056 
00057 Q_OBJECT
00058 
00059     // attributes
00060 public:
00064     QPtrList<KMdiChildFrm> *m_pZ; //Auto delete enabled
00065 
00069     QSize m_defaultChildFrmSize;
00070 protected:
00074     QFont m_captionFont;
00075 
00079     QColor m_captionActiveBackColor;
00080 
00084     QColor m_captionActiveForeColor;
00085 
00089     QColor m_captionInactiveBackColor;
00090 
00094     QColor m_captionInactiveForeColor;
00095 
00096     int m_captionFontLineSpacing;
00097 
00098     // methods
00099 public:
00100 
00104     KMdiChildArea( QWidget *parent );
00105 
00110     ~KMdiChildArea();
00111 
00116     void manageChild( KMdiChildFrm *lpC, bool bShow = true, bool bCascade = true );
00117 
00122     void destroyChild( KMdiChildFrm* child, bool focusTopChild = true );
00123 
00128     void destroyChildButNotItsView( KMdiChildFrm *lpC, bool bFocusTopChild = true );
00129 
00135     void setTopChild( KMdiChildFrm* child, bool setFocus = false );
00136 
00141     inline KMdiChildFrm * topChild() const { return m_pZ->last(); }
00142 
00146     int getVisibleChildCount() const;
00147 
00153     QPoint getCascadePoint( int indexOfWindow = -1 );
00154 
00159     void setMdiCaptionFont( const QFont &fnt );
00160 
00165     void setMdiCaptionActiveForeColor( const QColor &clr );
00166 
00171     void setMdiCaptionActiveBackColor( const QColor &clr );
00172 
00177     void setMdiCaptionInactiveForeColor( const QColor &clr );
00178 
00183     void setMdiCaptionInactiveBackColor( const QColor &clr );
00184 
00194     static void getCaptionColors( const QPalette &pal, QColor &activeBG, QColor &activeFG,
00195                                   QColor &inactiveBG, QColor &inactiveFG ) KDE_DEPRECATED;
00196 
00197 public slots:
00201     void cascadeWindows();
00202 
00206     void cascadeMaximized();
00207 
00211     void expandVertical();
00212 
00216     void expandHorizontal();
00217 
00222     void focusTopChild();
00223 
00227     void tilePragma();
00228 
00232     void tileAnodine();
00233 
00237     void tileVertically();
00238 
00242     void layoutMinimizedChildren();
00243 
00244 protected:
00245 
00249     void tileAllInternal( int maxWnds );
00250 
00254     virtual void resizeEvent( QResizeEvent * );
00255 
00259     void mousePressEvent( QMouseEvent *e );
00260 
00264     void childMinimized( KMdiChildFrm *lpC, bool bWasMaximized );
00265 
00266 signals:
00270     void noMaximizedChildFrmLeft( KMdiChildFrm* );
00271 
00275     void nowMaximized( bool );
00276 
00283     void sysButtonConnectionsMustChange( KMdiChildFrm*, KMdiChildFrm* );
00284 
00289     void popupWindowMenu( QPoint );
00290 
00295     void lastChildFrmClosed();
00296 
00297 private:
00298 
00299     KMdiChildAreaPrivate *d;
00300 };
00301 
00302 #endif   // _KMDICHILDAREA_H_
00303 
00304 // kate: indent-mode csands; tab-width 4; auto-insert-doxygen on;
KDE Home | KDE Accessibility Home | Description of Access Keys