1 | /* |
2 | This file is part of the KDE project. |
3 | |
4 | Copyright (c) 2011 Lionel Chauvin <megabigbug@yahoo.fr> |
5 | Copyright (c) 2011,2012 Cédric Bellegarde <gnumdk@gmail.com> |
6 | |
7 | Permission is hereby granted, free of charge, to any person obtaining a |
8 | copy of this software and associated documentation files (the "Software"), |
9 | to deal in the Software without restriction, including without limitation |
10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
11 | and/or sell copies of the Software, and to permit persons to whom the |
12 | Software is furnished to do so, subject to the following conditions: |
13 | |
14 | The above copyright notice and this permission notice shall be included in |
15 | all copies or substantial portions of the Software. |
16 | |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
20 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | DEALINGS IN THE SOFTWARE. |
24 | */ |
25 | |
26 | #ifndef APPMENU_DBUS_H |
27 | #define APPMENU_DBUS_H |
28 | |
29 | // Qt |
30 | #include <QDBusContext> |
31 | #include <QDBusObjectPath> |
32 | #include <QObject> |
33 | #include <QDebug> |
34 | #include <qwindowdefs.h> |
35 | |
36 | class ; |
37 | |
38 | class : public QObject, protected QDBusContext |
39 | { |
40 | Q_OBJECT |
41 | |
42 | public: |
43 | (QObject*); |
44 | (); |
45 | |
46 | bool (const QString& service = QString(), const QString& path = QString()); |
47 | |
48 | /** |
49 | * DBus method showing menu at QPoint(x,y) for id |
50 | * if x or y == -1, show in application window |
51 | */ |
52 | void (int x, int y, WId id); |
53 | /** |
54 | * DBus method reconfiguring kded module |
55 | */ |
56 | void (); |
57 | |
58 | Q_SIGNALS: |
59 | /** |
60 | * This signal is emitted on showMenu() request |
61 | */ |
62 | void (int x, int y, WId id); |
63 | /** |
64 | * This signal is emitted on reconfigure() request |
65 | */ |
66 | void (); |
67 | |
68 | // Dbus signals |
69 | /** |
70 | * This signal is emitted whenever kded want to show menu |
71 | * We do not know where is menu decoration button, so tell kwin to show menu |
72 | */ |
73 | void (qulonglong); |
74 | /** |
75 | * This signal is emitted whenever application menu becomes available |
76 | */ |
77 | void (qulonglong); |
78 | /** |
79 | * This signal is emitted whenever menus are unavailables |
80 | */ |
81 | void (); |
82 | /** |
83 | * This signal is emitted whenever popup menu/menubar is hidden |
84 | * Useful for decorations to know if menu button should be release |
85 | */ |
86 | void (qulonglong); |
87 | /** |
88 | * This signal is emitted whenever a window register to appmenu |
89 | */ |
90 | void (qulonglong wid, const QString& service, const QDBusObjectPath&); |
91 | /** |
92 | * This signal is emitted whenever a window unregister from appmenu |
93 | */ |
94 | void (qulonglong wid); |
95 | |
96 | private: |
97 | QString ; |
98 | }; |
99 | |
100 | #endif // APPMENU_DBUS_H |
101 | |