OSDN Git Service

use only one case switch in DBusMenu::eventFilter()
[kde/libdbusmenu-qt.git] / src / dbusmenutypes_p.h
1 /* This file is part of the dbusmenu-qt library
2    Copyright 2009 Canonical
3    Author: Aurelien Gateau <aurelien.gateau@canonical.com>
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License (LGPL) as published by the Free Software Foundation;
8    either version 2 of the License, or (at your option) any later
9    version.
10
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Library General Public License for more details.
15
16    You should have received a copy of the GNU Library General Public License
17    along with this library; see the file COPYING.LIB.  If not, write to
18    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.
20 */
21 #ifndef DBUSMENUTYPES_P_H
22 #define DBUSMENUTYPES_P_H
23
24 // Qt
25 #include <QtCore/QList>
26 #include <QtCore/QStringList>
27 #include <QtCore/QVariant>
28 #include <QtDBus/QDBusArgument>
29
30 // Local
31 #include <dbusmenu_export.h>
32
33 //// DBusMenuItem
34 /**
35  * Internal struct used to communicate on DBus
36  */
37 struct DBUSMENU_EXPORT DBusMenuItem
38 {
39     int id;
40     QVariantMap properties;
41 };
42
43 Q_DECLARE_METATYPE(DBusMenuItem)
44
45 DBUSMENU_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItem &item);
46 DBUSMENU_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItem &item);
47
48 typedef QList<DBusMenuItem> DBusMenuItemList;
49
50 Q_DECLARE_METATYPE(DBusMenuItemList)
51
52
53 //// DBusMenuItemKeys
54 /**
55  * Represents a list of keys for a menu item
56  */
57 struct DBUSMENU_EXPORT DBusMenuItemKeys
58 {
59     int id;
60     QStringList properties;
61 };
62
63 Q_DECLARE_METATYPE(DBusMenuItemKeys)
64
65 DBUSMENU_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItemKeys &);
66 DBUSMENU_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItemKeys &);
67
68 typedef QList<DBusMenuItemKeys> DBusMenuItemKeysList;
69
70 Q_DECLARE_METATYPE(DBusMenuItemKeysList)
71
72 //// DBusMenuLayoutItem
73 /**
74  * Represents an item with its children. GetLayout() returns a
75  * DBusMenuLayoutItemList.
76  */
77 struct DBusMenuLayoutItem;
78 struct DBUSMENU_EXPORT DBusMenuLayoutItem
79 {
80     int id;
81     QVariantMap properties;
82     QList<DBusMenuLayoutItem> children;
83 };
84
85 Q_DECLARE_METATYPE(DBusMenuLayoutItem)
86
87 DBUSMENU_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuLayoutItem &);
88 DBUSMENU_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuLayoutItem &);
89
90 typedef QList<DBusMenuLayoutItem> DBusMenuLayoutItemList;
91
92 Q_DECLARE_METATYPE(DBusMenuLayoutItemList)
93
94 void DBusMenuTypes_register();
95 #endif /* DBUSMENUTYPES_P_H */