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 APPMENUMODULE_H |
27 | #define APPMENUMODULE_H |
28 | |
29 | #include <kdedmodule.h> |
30 | #include "menuimporter.h" |
31 | #include "gtkicons.h" |
32 | |
33 | class QDBusPendingCallWatcher; |
34 | class ; |
35 | class ; |
36 | class ; |
37 | class ; |
38 | |
39 | class : public KDEDModule, |
40 | protected QDBusContext |
41 | { |
42 | Q_OBJECT |
43 | public: |
44 | (QObject* parent, const QList<QVariant>& list); |
45 | virtual (); |
46 | |
47 | Q_SIGNALS: |
48 | /** |
49 | * We do not know where is menu decoration button, so tell kwin to show menu |
50 | */ |
51 | void (qulonglong); |
52 | /** |
53 | * This signal is emitted whenever application menu becomes available |
54 | */ |
55 | void (qulonglong); |
56 | /** |
57 | * This signal is emitted whenever menus are unavailables |
58 | */ |
59 | void (); |
60 | /** |
61 | * This signal is emitted whenever popup menu/menubar is hidden |
62 | * Useful for decorations to know if menu button should be release |
63 | */ |
64 | void (qulonglong); |
65 | /** |
66 | * This signal is emitted whenever a window register to appmenu |
67 | */ |
68 | void (qulonglong wid, const QString& service, const QDBusObjectPath&); |
69 | /** |
70 | * This signal is emitted whenever a window unregister from appmenu |
71 | */ |
72 | void (qulonglong wid); |
73 | |
74 | private Q_SLOTS: |
75 | /** |
76 | * Show menu at QPoint(x,y) for id |
77 | * if x or y == -1, show in application window |
78 | */ |
79 | void (int x, int y, WId); |
80 | /** |
81 | * Send menuHidden signal over bus when menu is about to hide |
82 | */ |
83 | void (); |
84 | /** |
85 | * New window registered to appmenu |
86 | * Emit WindowRegistered signal over bus |
87 | */ |
88 | void (WId id, const QString& service, const QDBusObjectPath& path); |
89 | /** |
90 | * Window unregistered from appmenu |
91 | * Emit WindowUnregistered signal over bus |
92 | */ |
93 | void (WId id); |
94 | /** |
95 | * Open a action in current menu |
96 | */ |
97 | void (QAction* a); |
98 | /** |
99 | * Active window changed, show menubar for id |
100 | */ |
101 | void (WId id); |
102 | /** |
103 | * Update menubar with current window menu |
104 | */ |
105 | void (); |
106 | /** |
107 | * Current screen changed, update menubar |
108 | */ |
109 | void (); |
110 | /** |
111 | * Resize menubar |
112 | */ |
113 | void (); |
114 | /** |
115 | * Reconfigure module |
116 | */ |
117 | void (); |
118 | |
119 | private: |
120 | /** |
121 | * return an importer for window id |
122 | */ |
123 | KDBusMenuImporter* (WId id); |
124 | /** |
125 | * Show menubar and update it with menu |
126 | */ |
127 | void (QMenu *); |
128 | /** |
129 | * Hide menubar |
130 | */ |
131 | void (); |
132 | /** |
133 | * Return current screen |
134 | */ |
135 | int (); |
136 | /** |
137 | * Return position of menubar for being centered on screen |
138 | */ |
139 | QPoint (); |
140 | |
141 | QObject* ; |
142 | MenuImporter* ; |
143 | AppmenuDBus* ; |
144 | QHash<WId, KDBusMenuImporter*> ; |
145 | GtkIcons ; |
146 | QString ; |
147 | TopMenuBar* ; |
148 | VerticalMenu* ; |
149 | QTimer* ; |
150 | QAction *; |
151 | int ; |
152 | }; |
153 | |
154 | #endif |
155 | |