dbusmenu-lxqt
0.4.0
Toggle main menu visibility
Loading...
Searching...
No Matches
libdbusmenu-lxqt-0.4.0
src
dbusmenuimporter.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 DBUSMENUIMPORTER_H
22
#define DBUSMENUIMPORTER_H
23
24
// Qt
25
#include <QtCore/QObject>
26
#include <QMenu>
27
28
// Local
29
#include <dbusmenu_export.h>
30
31
class
QAction;
32
class
QDBusAbstractInterface;
33
class
QDBusPendingCallWatcher;
34
class
QDBusVariant;
35
class
QIcon;
36
class
QEvent;
37
38
class
DBusMenuImporterPrivate;
39
40
// For working around a crash triggered by "QMenu::timerEvent"
41
class
Menu :
public
QMenu {
42
Q_OBJECT
43
public
:
44
Menu(QWidget *parent =
nullptr
);
45
bool
blockEvents;
46
47
protected
:
48
bool
event(QEvent *e)
override
;
49
};
50
55
enum
DBusMenuImporterType {
56
ASYNCHRONOUS,
57
SYNCHRONOUS
58
};
59
64
class
DBUSMENU_EXPORT
DBusMenuImporter
:
public
QObject
65
{
66
Q_OBJECT
67
public
:
71
DBusMenuImporter
(
const
QString &service,
const
QString &path, QObject *parent = 0);
72
77
DBusMenuImporter
(
const
QString &service,
const
QString &path, DBusMenuImporterType type, QObject *parent = 0);
78
79
virtual
~DBusMenuImporter
();
80
84
QMenu *
menu
()
const
;
85
86
public
Q_SLOTS:
100
void
updateMenu
();
101
102
Q_SIGNALS:
107
void
menuUpdated
();
108
116
void
menuReadyToBeShown
();
117
121
void
actionActivationRequested
(QAction *);
122
123
protected
:
128
virtual
QMenu *
createMenu
(QWidget *parent);
129
134
virtual
QIcon
iconForName
(
const
QString &);
135
136
private
Q_SLOTS:
137
void
sendClickedEvent(
int
);
138
void
slotMenuAboutToShow();
139
void
slotMenuAboutToHide();
140
void
slotAboutToShowDBusCallFinished(QDBusPendingCallWatcher *);
141
void
slotItemActivationRequested(
int
id
, uint timestamp);
142
void
processPendingLayoutUpdates();
143
void
slotLayoutUpdated(uint revision,
int
parentId);
144
void
slotGetLayoutFinished(QDBusPendingCallWatcher *);
145
146
private
:
147
Q_DISABLE_COPY(
DBusMenuImporter
)
148
DBusMenuImporterPrivate *
const
d;
149
friend
class
DBusMenuImporterPrivate;
150
151
// Use Q_PRIVATE_SLOT to avoid exposing DBusMenuItemList
152
Q_PRIVATE_SLOT(d,
void
slotItemsPropertiesUpdated(
const
DBusMenuItemList &updatedList,
const
DBusMenuItemKeysList &removedList))
153
};
154
155
#endif
/* DBUSMENUIMPORTER_H */
DBusMenuImporter::DBusMenuImporter
DBusMenuImporter(const QString &service, const QString &path, DBusMenuImporterType type, QObject *parent=0)
DBusMenuImporter::actionActivationRequested
void actionActivationRequested(QAction *)
DBusMenuImporter::menu
QMenu * menu() const
DBusMenuImporter::updateMenu
void updateMenu()
DBusMenuImporter::createMenu
virtual QMenu * createMenu(QWidget *parent)
DBusMenuImporter::iconForName
virtual QIcon iconForName(const QString &)
DBusMenuImporter::DBusMenuImporter
DBusMenuImporter(const QString &service, const QString &path, QObject *parent=0)
DBusMenuImporter::menuUpdated
void menuUpdated()
DBusMenuImporter::menuReadyToBeShown
void menuReadyToBeShown()
Generated on
for dbusmenu-lxqt by
1.18.0