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 | * \brief D-Bus interface to KMainWindow. |
18 | * \inmodule KXmlGui |
19 | * |
20 | * This is the main interface to the KMainWindow. This provides a consistent |
21 | * D-Bus interface to all KDE applications that use it. |
22 | */ |
23 | class KMainWindowInterface : public QDBusAbstractAdaptor |
24 | { |
25 | Q_OBJECT |
26 | Q_CLASSINFO("D-Bus Interface" , "org.kde.KMainWindow" ) |
27 | |
28 | public: |
29 | /*! |
30 | \brief Constructs a new interface object. |
31 | |
32 | \a mainWindow - The parent KMainWindow object |
33 | that will provide us with the QAction objects. |
34 | */ |
35 | explicit KMainWindowInterface(KXmlGuiWindow *mainWindow); |
36 | |
37 | /*! |
38 | \brief Destructor. |
39 | |
40 | Cleans up the dcop action proxy object. |
41 | */ |
42 | ~KMainWindowInterface() override; |
43 | |
44 | public Q_SLOTS: |
45 | /*! |
46 | \brief Returns a list of actions available to the application's window. |
47 | */ |
48 | QStringList actions(); |
49 | |
50 | /*! |
51 | \brief Activates the requested \a action. |
52 | |
53 | The names of valid actions can be found by calling actions(). |
54 | |
55 | Returns the success of the operation. |
56 | */ |
57 | bool activateAction(const QString &action); |
58 | |
59 | /*! |
60 | \brief Disables the requested \a action. |
61 | |
62 | The names of valid actions can be found by calling actions(). |
63 | |
64 | Returns the success of the operation. |
65 | */ |
66 | bool disableAction(const QString &action); |
67 | |
68 | /*! |
69 | \brief Enables the requested \a action. |
70 | |
71 | The names of valid actions can be found by calling actions(). |
72 | |
73 | Returns the success of the operation. |
74 | */ |
75 | bool enableAction(const QString &action); |
76 | |
77 | /*! |
78 | \brief Returns the status of the requested \a action. |
79 | |
80 | The names of valid actions can be found by calling actions(). |
81 | */ |
82 | bool actionIsEnabled(const QString &action); |
83 | |
84 | /*! |
85 | \brief Returns the tool tip text of the requested \a action. |
86 | The names of valid actions can be found by calling actions(). |
87 | */ |
88 | QString actionToolTip(const QString &action); |
89 | |
90 | /*! |
91 | \brief Returns the ID of the current main window. |
92 | |
93 | This is useful for automated screen captures or other evil |
94 | widget fun. |
95 | |
96 | Returns A integer value of the main window's ID. |
97 | **/ |
98 | qlonglong winId(); |
99 | |
100 | /*! |
101 | \brief Copies a pixmap representation of the current main window to |
102 | the clipboard. |
103 | **/ |
104 | void grabWindowToClipBoard(); |
105 | |
106 | private: |
107 | KXmlGuiWindow *m_MainWindow; |
108 | }; |
109 | |
110 | #endif // KMAINWINDOWIFACE_P_H |
111 | |