mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-12 02:05:54 +00:00
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik <kde@privat.broulik.de>
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
#include "gdbusmenutypes_p.h"
|
|
|
|
class QStringList;
|
|
|
|
class Actions : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Actions(const QString &serviceName, const QString &objectPath, QObject *parent = nullptr);
|
|
~Actions() override;
|
|
|
|
void load();
|
|
|
|
bool get(const QString &name, GMenuAction &action) const;
|
|
GMenuActionMap getAll() const;
|
|
void trigger(const QString &name, const QVariant &target, uint timestamp = 0);
|
|
|
|
bool isValid() const; // basically "has actions"
|
|
|
|
Q_SIGNALS:
|
|
void loaded();
|
|
void failedToLoad(); // expose error?
|
|
void actionsChanged(const QStringList &dirtyActions);
|
|
|
|
private Q_SLOTS:
|
|
void onActionsChanged(const QStringList &removed, const StringBoolMap &enabledChanges, const QVariantMap &stateChanges, const GMenuActionMap &added);
|
|
|
|
private:
|
|
GMenuActionMap m_actions;
|
|
|
|
QString m_serviceName;
|
|
QString m_objectPath;
|
|
};
|