File indexing completed on 2024-12-01 06:42:05

0001 /*
0002  * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef OBJECT_H
0008 #define OBJECT_H
0009 
0010 #include <QDBusObjectPath>
0011 #include <QVariant>
0012 
0013 class Object
0014 {
0015 public:
0016     explicit Object();
0017     virtual ~Object() = default;
0018 
0019     QObject *objectParent() const;
0020     void setObjectParent(QObject *parent);
0021 
0022     QDBusObjectPath path() const;
0023     void setPath(const QDBusObjectPath &path);
0024 
0025     QString name() const;
0026     void setName(const QString &name);
0027 
0028     bool haveProperties() const;
0029 
0030     QVariantMap properties() const;
0031     void setProperties(const QVariantMap &properties);
0032 
0033     QVariant property(const QString &name) const;
0034     void changeProperty(const QString &name, const QVariant &value);
0035 
0036 private:
0037     QObject *m_parent;
0038     QDBusObjectPath m_path;
0039     QString m_name;
0040     QVariantMap m_properties;
0041 };
0042 
0043 #endif // OBJECT_H