fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kdeui / xmlgui / kmainwindowiface_p.h
blobb59b2b1c83feb087d0533cb36ad7b12dd17e5e73
1 /* This file is part of the KDE project
2 Copyright (C) 2001 Ian Reinhart Geiser <geiseri@yahoo.com>
3 Copyright (C) 2006 Thiago Macieira <thiago@kde.org>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef KMAINWINDOWIFACE_P_H
22 #define KMAINWINDOWIFACE_P_H
24 #include <kdeui_export.h>
25 #include <QtDBus/QtDBus>
26 #include <QtCore/QMap>
28 class KXmlGuiWindow;
30 /**
31 * @short D-Bus interface to KMainWindow.
33 * This is the main interface to the KMainWindow. This will provide a consistent
34 * D-Bus interface to all KDE applications that use it.
36 * @author Ian Reinhart Geiser <geiseri@yahoo.com>
38 class KMainWindowInterface : public QDBusAbstractAdaptor
40 Q_OBJECT
41 Q_CLASSINFO("D-Bus Interface", "org.kde.KMainWindow")
43 public:
44 /**
45 Construct a new interface object.
46 @param mainWindow - The parent KMainWindow object
47 that will provide us with the KAction objects.
49 KMainWindowInterface( KXmlGuiWindow * mainWindow );
50 /**
51 Destructor
52 Cleans up the dcop action proxy object.
53 **/
54 ~KMainWindowInterface();
56 public Q_SLOTS:
57 /**
58 Return a list of actions available to the application's window.
59 @return A QStringList containing valid names actions.
61 QStringList actions();
63 /**
64 Activates the requested action.
65 @param action The name of the action to activate. The names of valid
66 actions can be found by calling actions().
67 @return The success of the operation.
69 bool activateAction( const QString& action);
71 /**
72 Disables the requested action.
73 @param action The name of the action to disable. The names of valid
74 actions can be found by calling actions().
75 @return The success of the operation.
77 bool disableAction( const QString& action);
79 /**
80 Enables the requested action.
81 @param action The name of the action to enable. The names of valid
82 actions can be found by calling actions().
83 @return The success of the operation.
85 bool enableAction( const QString& action);
87 /**
88 Returns the status of the requested action.
89 @param action The name of the action. The names of valid
90 actions can be found by calling actions().
91 @returns The state of the action, true - enabled, false - disabled.
93 bool actionIsEnabled( const QString& action);
95 /**
96 Returns the tool tip text of the requested action.
97 @param action The name of the action to activate. The names of valid
98 actions can be found by calling actions().
99 @return A QString containing the text of the action's tool tip.
101 QString actionToolTip( const QString& action);
104 Returns the ID of the current main window.
105 This is useful for automated screen captures or other evil
106 widget fun.
107 @return A integer value of the main window's ID.
109 qlonglong winId();
111 Copies a pixmap representation of the current main window to
112 the clipboard.
114 void grabWindowToClipBoard();
115 private:
116 KXmlGuiWindow *m_MainWindow;
119 #endif // KMAINWINDOWIFACE_P_H