mainwindow.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2004 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2002,2003 Joseph Wenninger <jowenn@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 
00020    Based on:
00021 
00022    //----------------------------------------------------------------------------
00023    //    Project              : KDE MDI extension
00024    //
00025    //    begin                : 07/1999       by Szymon Stefanek as part of kvirc
00026    //                                         (an IRC application)
00027    //    changes              : 09/1999       by Falk Brettschneider to create an
00028    //                           - 06/2000     stand-alone Qt extension set of
00029    //                                         classes and a Qt-based library
00030    //                         : 02/2000       by Massimo Morin (mmorin@schedsys.com)
00031    //                           2000-2003     maintained by the KDevelop project
00032    //    patches              : -/2000        by Lars Beikirch (Lars.Beikirch@gmx.net)
00033    //                         : 01/2003       by Jens Zurheide (jens.zurheide@gmx.de)
00034    //
00035    //    copyright            : (C) 1999-2003 by Falk Brettschneider
00036    //                                         and
00037    //                                         Szymon Stefanek (stefanek@tin.it)
00038    //    email                :  falkbr@kdevelop.org (Falk Brettschneider)
00039    //----------------------------------------------------------------------------
00040 */
00041 
00042 #ifndef _KMDI_MAINWINDOW_H_
00043 #define _KMDI_MAINWINDOW_H_
00044 
00045 #include <kparts/dockmainwindow.h>
00046 #include <kmenubar.h>
00047 #include <kpopupmenu.h>
00048 
00049 #include <qptrlist.h>
00050 #include <qrect.h>
00051 #include <qapplication.h>
00052 #include <qguardedptr.h>
00053 
00054 #include <kmdi/global.h>
00055 
00056 class QPopupMenu;
00057 class QMenuBar;
00058 
00059 #include <kmdi/toolviewaccessor.h>
00060 
00061 namespace KMDIPrivate {
00062   class MainWindowPrivate;
00063   class GUIClient;
00064 }
00065 
00066 namespace KMDI
00067 {
00068 
00069 class DockContainer;
00070 class TabWidget;
00071 
00072 class KMDI_EXPORT MainWindow : public KParts::DockMainWindow
00073 {
00074   Q_OBJECT
00075 
00076   friend class KMDI::ToolViewAccessor;
00077 
00078   public:
00082     MainWindow ( QWidget* parentWidget, const char* name = "");
00083 
00087     virtual ~MainWindow ();
00088 
00089   public:
00096     TabWidget *tabWidget ();
00097 
00103     KMDI::ToolViewAccessor *createToolWindow();
00104 
00116     KMDI::ToolViewAccessor *addToolWindow( QWidget* pWnd, KDockWidget::DockPosition pos = KDockWidget::DockNone, QWidget* pTargetWnd = 0L, int percent = 50, const QString& tabToolTip = 0, const QString& tabCaption = 0);
00117 
00122     void deleteToolWindow( KMDI::ToolViewAccessor *accessor);
00123 
00128     void deleteToolWindow( QWidget* pWnd);
00129 
00134     void setToolViewStyle(int flags);
00135 
00136   public slots:
00137     void prevToolViewInDock();
00138     void nextToolViewInDock();
00139 
00140   signals:
00141     void collapseOverlapContainers();
00142 
00143   protected:
00144     void findToolViewsDockedToMain(QPtrList<KDockWidget>* list,KDockWidget::DockPosition dprtmw);
00145     void dockToolViewsIntoContainers(QPtrList<KDockWidget>& widgetsToReparent,KDockWidget *container);
00146 
00147   private:
00151     void setupMainDock ();
00152 
00157     void setupToolViews ();
00158 
00163     void setupGUIClient ();
00164 
00165   private slots:
00166     void setActiveToolDock(DockContainer*);
00167     void removeFromActiveDockList(DockContainer*);
00168 
00169   #define protected public
00170   signals:
00171   #undef protected
00172     void toggleTop();
00173     void toggleLeft();
00174     void toggleRight();
00175     void toggleBottom();
00176 
00177   protected:
00178     KMDIPrivate::GUIClient *m_guiClient;
00179     QMap <QWidget*, KMDI::ToolViewAccessor*> *m_toolViews;
00180 
00181     KDockWidget *m_leftContainer;
00182     KDockWidget *m_rightContainer;
00183     KDockWidget *m_topContainer;
00184     KDockWidget *m_bottomContainer;
00185 
00186     KMDI::TabWidget *m_tabWidget;
00187 
00188   private:
00192     KMDIPrivate::MainWindowPrivate *d;
00193 };
00194 
00195 }
00196 
00197 #endif //_MainWindow_H_
00198 
00199 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE Home | KDE Accessibility Home | Description of Access Keys