1 /* This file is part of the KDE project
2 Copyright (C) 2001 Ian Reinhart Geiser <geiseri@yahoo.com>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KWINDOW_INTERFACE_H
21 #define KWINDOW_INTERFACE_H
23 #include <dcopobject.h>
24 #include <qstringlist.h>
28 class KDCOPActionProxy
;
29 class KDCOPPropertyProxy
;
33 * @short DCOP interface to KMainWindow.
35 * This is the main interface to the KMainWindow. This will provide a consistent
36 * DCOP interface to all KDE applications that use it.
38 * @author Ian Reinhart Geiser <geiseri@yahoo.com>
40 class KDEUI_EXPORT KMainWindowInterface
: virtual public DCOPObject
46 Construct a new interface object.
47 @param mainWindow - The parent KMainWindow object
48 that will provide us with the KAction objects.
50 KMainWindowInterface( KMainWindow
* mainWindow
);
53 Cleans up the dcop action proxy object.
55 ~KMainWindowInterface();
57 QCStringList
functionsDynamic();
58 bool processDynamic(const QCString
&fun
, const QByteArray
&data
, QCString
& replyType
, QByteArray
&replyData
);
63 Return a list of actions available to the application's window.
64 @return A QCStringList containing valid names actions.
66 QCStringList
actions();
69 Activates the requested action.
70 @param action The name of the action to activate. The names of valid
71 actions can be found by calling actions().
72 @return The success of the operation.
74 bool activateAction( QCString action
);
77 Disables the requested action.
78 @param action The name of the action to disable. The names of valid
79 actions can be found by calling actions().
80 @return The success of the operation.
82 bool disableAction( QCString action
);
85 Enables the requested action.
86 @param action The name of the action to enable. The names of valid
87 actions can be found by calling actions().
88 @return The success of the operation.
90 bool enableAction( QCString action
);
93 Returns the status of the requested action.
94 @param action The name of the action. The names of valid
95 actions can be found by calling actions().
96 @returns The state of the action, true - enabled, false - disabled.
98 bool actionIsEnabled( QCString action
);
101 Returns the tool tip text of the requested action.
102 @param action The name of the action to activate. The names of valid
103 actions can be found by calling actions().
104 @return A QCString containing the text of the action's tool tip.
106 QCString
actionToolTip( QCString action
);
109 Returns a dcop reference to the selected KAction
110 @param name The name of the action. The names of valid
111 actions can be found by calling actions().
112 @return A DCOPRef for the kaction.
114 DCOPRef
action( const QCString
&name
);
117 Returns and action map
119 QMap
<QCString
,DCOPRef
> actionMap();
121 Returns the ID of the current main window.
122 This is useful for automated screen captures or other evil
124 @return A integer value of the main window's ID.
128 Copies a pixmap representation of the current main window to
131 void grabWindowToClipBoard();
134 // bool isMaximized();
136 // bool isMinimized();
140 void resize(int newWidth
, int newHeight
);
143 void move(int newX
, int newY
);
144 void setGeometry(int newX
, int newY
, int newWidth
, int newHeight
);
150 // QCStringList getQTProperties();
153 KMainWindow
*m_MainWindow
;
154 KDCOPActionProxy
*m_dcopActionProxy
;
155 KDCOPPropertyProxy
*m_dcopPropertyProxy
;