guiclient.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
00003    Copyright (C) 2004 Christoph Cullmann <cullmann@kde.org>
00004    based on ktoolbarhandler.cpp: Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
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 
00021 #ifndef _KMDI_GUICLIENT_H_
00022 #define _KMDI_GUICLIENT_H_
00023 
00024 #include <qobject.h>
00025 #include <qguardedptr.h>
00026 #include <kxmlguiclient.h>
00027 #include <kaction.h>
00028 
00029 #include <kmdi/global.h>
00030 
00031 class KMainWindow;
00032 class KToolBar;
00033 
00034 namespace KMDI {
00035   class MainWindow;
00036   class ToolViewAccessor;
00037 }
00038 
00039 class KDockWidget;
00040 
00041 namespace KMDIPrivate {
00042 
00043 class GUIClientPrivate;
00044 
00045 class GUIClient : public QObject, public KXMLGUIClient
00046 {
00047   Q_OBJECT
00048 
00049   public:
00050     GUIClient( KMDI::MainWindow *mdiMainFrm, const char *name = 0 );
00051     virtual ~GUIClient();
00052 
00053     void addToolView(KMDI::ToolViewAccessor*);
00054 
00055   private slots:
00056     void clientAdded( KXMLGUIClient *client );
00057     void setupActions();
00058     void actionDeleted(QObject*);
00059 
00060   signals:
00061     void toggleTop();
00062     void toggleLeft();
00063     void toggleRight();
00064     void toggleBottom();
00065 
00066   private:
00067     GUIClientPrivate *d;
00068 
00069     QGuardedPtr<KMDI::MainWindow> m_mdiMainFrm;
00070     QPtrList<KAction> m_toolViewActions;
00071     QPtrList<KAction> m_documentViewActions;
00072 
00073     KActionMenu *m_docMenu;
00074     KActionMenu *m_toolMenu;
00075 
00076     KActionMenu *m_gotoToolDockMenu;
00077 };
00078 
00079 class ToggleToolViewAction:public KToggleAction
00080 {
00081   Q_OBJECT
00082 
00083   public:
00084     ToggleToolViewAction ( const QString& text, const KShortcut& cut = KShortcut(),
00085                            KDockWidget *dw=0,KMDI::MainWindow *mdiMainFrm=0, QObject* parent = 0, const char* name = 0 );
00086 
00087     virtual ~ToggleToolViewAction();
00088 
00089   protected slots:
00090     void slotToggled(bool);
00091     void anDWChanged();
00092     void slotWidgetDestroyed();
00093 
00094   private:
00095     KDockWidget *m_dw;
00096     KMDI::MainWindow *m_mdiMainFrm;
00097 };
00098 
00099 }
00100 
00101 #endif
00102 
00103 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE Home | KDE Accessibility Home | Description of Access Keys