1
/* This file is part of the KDE libraries
2
Copyright (C) 2003 Joseph Wenninger
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16
Boston, MA 02111-1307, USA.
19
#ifndef KMDIGUICLIENT_H
20
#define KMDIGUICLIENT_H
23
#include <qguardedptr.h>
24
#include <kxmlguiclient.h>
26
#include "kmdidefines.h"
30
class KMdiToolViewAccessor;
34
namespace KMDIPrivate {
37
* A class derived from KXMLGUIClient that handles the various
40
class KMDI_EXPORT KMDIGUIClient : public QObject,
46
KMDIGUIClient( KMdiMainFrm *mdiMainFrm, bool showMDIModeAction, const char *name = 0 );
47
virtual ~KMDIGUIClient();
50
* Add a new tool view to this KMDIGUIClient. Reads the shortcut
51
* for the tool view from the KMDI application's config file and also
52
* adds a ToggleToolViewAction so that the visibility of the toolviews
53
* can be turned on and off
55
void addToolView(KMdiToolViewAccessor*);
60
* The XMLGUIClient factory has added an XMLGUI client. Plug our actions
61
* in if we're the client that's been added.
63
void clientAdded( KXMLGUIClient *client );
65
* Plug in the various toggle actions we have into the tool views menu
70
* Change the view mode. This will automatically change the view mode
71
* of the KMdiMainFrm associated with this KMDIGUIClient
73
void changeViewMode(int id);
76
* One of our tool view toggle actions has been deleted. Redo the
79
void actionDeleted(QObject*);
82
* Updates the action that lets the user change the MDI mode to the
83
* correct value based on the current mode
85
void mdiModeHasBeenChangedTo(KMdi::MdiMode);
88
/** Toggle the top tool dock */
91
/** Toggle the left tool dock */
94
/** Toggle the right tool dock */
97
/** Toggle the bottom tool dock */
101
class KMDIGUIClientPrivate;
102
KMDIGUIClientPrivate *d;
103
KMdi::MdiMode m_mdiMode;
105
QGuardedPtr<KMdiMainFrm> m_mdiMainFrm;
106
QPtrList<KAction> m_toolViewActions;
107
QPtrList<KAction> m_documentViewActions;
109
KActionMenu *m_docMenu;
110
KActionMenu *m_toolMenu;
111
KSelectAction *m_mdiModeAction;
113
KActionMenu *m_gotoToolDockMenu;
117
* A KToggleAction specifically for toggling the showing
118
* or the hiding of a KMDI tool view
120
class KMDI_EXPORT ToggleToolViewAction:public KToggleAction
125
ToggleToolViewAction( const QString& text, const KShortcut& cut = KShortcut(),KDockWidget *dw=0,KMdiMainFrm *mdiMainFrm=0,
126
QObject* parent = 0, const char* name = 0 );
128
virtual ~ToggleToolViewAction();
133
KMdiMainFrm *m_mdiMainFrm;
136
void slotToggled(bool);
138
void slotWidgetDestroyed();