1 | /* |
2 | This file is part of the KDE project |
3 | SPDX-FileCopyrightText: 2001 Ian Reinhart Geiser <geiseri@yahoo.com> |
4 | SPDX-FileCopyrightText: 2006 Thiago Macieira <thiago@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #ifndef KMAINWINDOWIFACE_P_H |
10 | #define KMAINWINDOWIFACE_P_H |
11 | |
12 | #include <QDBusAbstractAdaptor> |
13 | |
14 | class KXmlGuiWindow; |
15 | |
16 | /** |
17 | * @short D-Bus interface to KMainWindow. |
18 | * |
19 | * This is the main interface to the KMainWindow. This will provide a consistent |
20 | * D-Bus interface to all KDE applications that use it. |
21 | * |
22 | * @author Ian Reinhart Geiser <geiseri@yahoo.com> |
23 | */ |
24 | class KMainWindowInterface : public QDBusAbstractAdaptor |
25 | { |
26 | Q_OBJECT |
27 | Q_CLASSINFO("D-Bus Interface" , "org.kde.KMainWindow" ) |
28 | |
29 | public: |
30 | /** |
31 | Construct a new interface object. |
32 | @param mainWindow - The parent KMainWindow object |
33 | that will provide us with the QAction objects. |
34 | */ |
35 | explicit KMainWindowInterface(KXmlGuiWindow *mainWindow); |
36 | /** |
37 | Destructor |
38 | Cleans up the dcop action proxy object. |
39 | **/ |
40 | ~KMainWindowInterface() override; |
41 | |
42 | public Q_SLOTS: |
43 | /** |
44 | Return a list of actions available to the application's window. |
45 | @return A QStringList containing valid names actions. |
46 | */ |
47 | QStringList actions(); |
48 | |
49 | /** |
50 | Activates the requested action. |
51 | @param action The name of the action to activate. The names of valid |
52 | actions can be found by calling actions(). |
53 | @return The success of the operation. |
54 | */ |
55 | bool activateAction(const QString &action); |
56 | |
57 | /** |
58 | Disables the requested action. |
59 | @param action The name of the action to disable. The names of valid |
60 | actions can be found by calling actions(). |
61 | @return The success of the operation. |
62 | */ |
63 | bool disableAction(const QString &action); |
64 | |
65 | /** |
66 | Enables the requested action. |
67 | @param action The name of the action to enable. The names of valid |
68 | actions can be found by calling actions(). |
69 | @return The success of the operation. |
70 | */ |
71 | bool enableAction(const QString &action); |
72 | |
73 | /** |
74 | Returns the status of the requested action. |
75 | @param action The name of the action. The names of valid |
76 | actions can be found by calling actions(). |
77 | @returns The state of the action, true - enabled, false - disabled. |
78 | */ |
79 | bool actionIsEnabled(const QString &action); |
80 | |
81 | /** |
82 | Returns the tool tip text of the requested action. |
83 | @param action The name of the action to activate. The names of valid |
84 | actions can be found by calling actions(). |
85 | @return A QString containing the text of the action's tool tip. |
86 | */ |
87 | QString actionToolTip(const QString &action); |
88 | |
89 | /** |
90 | Returns the ID of the current main window. |
91 | This is useful for automated screen captures or other evil |
92 | widget fun. |
93 | @return A integer value of the main window's ID. |
94 | **/ |
95 | qlonglong winId(); |
96 | /** |
97 | Copies a pixmap representation of the current main window to |
98 | the clipboard. |
99 | **/ |
100 | void grabWindowToClipBoard(); |
101 | |
102 | private: |
103 | KXmlGuiWindow *m_MainWindow; |
104 | }; |
105 | |
106 | #endif // KMAINWINDOWIFACE_P_H |
107 | |