kdelibs/kdeui/notifications/kdbusmenuexporter.h
Ivailo Monev 2c730832c1 kdeui: remove unused KDBusMenuExporter and KDBusMenuImporter API
the methods and signals were implemenented for compat with libdbusmenu-qt
but KStatusNotifierItem tracks status by itself for example, internal menu
synchronization (e.g. triggering importer action when exporter action is
triggered) can be implemented via the D-Bus adaptor and interface but is
currently not required

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 21:19:47 +03:00

67 lines
2.1 KiB
C++

/* This file is part of the KDE libraries
Copyright (C) 2023 Ivailo Monev <xakepa10@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDBUSMENUEXPORTER_H
#define KDBUSMENUEXPORTER_H
#include "kdeui_export.h"
#include <QDBusConnection>
#include <QMenu>
#include <QAction>
class KDBusMenuExporterPrivate;
/*!
D-Bus menu exporting class
KDBusMenuExporter class can be used to export menu (QMenu or KMenu) from one application
to other applications.
@since 4.23
@see KDBusMenuImporter
*/
class KDEUI_EXPORT KDBusMenuExporter : public QObject
{
Q_OBJECT
public:
/*!
@brief Creates menu exporter for the given object path @p objectpath, path @p path and
connection @p connection.
@note The exporter is parented to the menu @p menu thus when the menu is destroyed the
exporter becomes non-operational and should not be used.
*/
KDBusMenuExporter(const QString &objectpath, QMenu *menu, const QDBusConnection &connection = QDBusConnection::sessionBus());
virtual ~KDBusMenuExporter();
protected:
/*!
@brief Reimplement to provide custom icons for actions and menus. The default
implementation returns the action icon name.
*/
virtual QString iconNameForAction(QAction *action);
private:
KDBusMenuExporterPrivate *d;
Q_DISABLE_COPY(KDBusMenuExporter);
friend class KDBusMenuAdaptor;
};
#endif // KDBUSMENUEXPORTER_H