Files

41 lines
1.5 KiB
C++
Raw Permalink Normal View History

#ifndef DBUSCONNECTION_H
#define DBUSCONNECTION_H
#include <QDBusAbstractAdaptor>
2024-02-18 20:58:27 +01:00
#include <QDBusMessage>
#include <QDBusVariant>
class IsolationManager;
class DBusConnection : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.tom.IsolationRunner")
2024-02-20 20:27:07 +01:00
Q_CLASSINFO("URL", "https://codeberg.org/zander/isolationRunner")
public:
explicit DBusConnection(IsolationManager *parent);
public slots:
2024-02-20 20:27:07 +01:00
// simple way to run an application in our setup.
// this is useful because on dbus introspection will show how to use it.
2024-02-19 10:47:36 +01:00
void run(const QString &fullPath, const QStringList &arguments, const QDBusMessage &message);
2024-02-20 20:27:07 +01:00
// a more complex version, which is called by run(), it has more features.
2024-02-19 19:52:24 +01:00
void run2(const QDBusMessage &message);
2024-02-20 20:27:07 +01:00
/// returns a list of our profiles.
2024-02-25 19:48:41 +01:00
QDBusVariant listProfiles(bool verbose) const;
2024-02-20 20:27:07 +01:00
/// Return an XML with details for a specific profile
void details(const QString &profile, const QDBusMessage &message) const;
// Update the permissions for a certain profile.
// Notice that if a property is not in the list of known properties, we ignore it.
2024-02-18 20:58:27 +01:00
// it doesn't make sense to reply since the only reply that makes sense is
// to return a full details() call.
2024-02-20 20:27:07 +01:00
Q_NOREPLY void setRights(const QString &profile, const QStringList &denied, const QStringList &allowed);
private:
2024-02-20 20:27:07 +01:00
// generates and returns a failure message.
2024-02-19 19:52:24 +01:00
void fail(const QDBusMessage &message, const QString &errorMessage) const;
IsolationManager *m_parent;
};
#endif