File indexing completed on 2024-11-17 04:54:26

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org>
0003  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004  */
0005 
0006 
0007 
0008 #ifndef DOMAIN_CONTEXT_H
0009 #define DOMAIN_CONTEXT_H
0010 
0011 #include <QMetaType>
0012 #include <QObject>
0013 #include <QSharedPointer>
0014 #include <QString>
0015 
0016 namespace Domain {
0017 
0018 class Context : public QObject
0019 {
0020     Q_OBJECT
0021     Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
0022 
0023 public:
0024     typedef QSharedPointer<Context> Ptr;
0025     typedef QList<Context::Ptr> List;
0026 
0027     explicit Context(QObject *parent = nullptr);
0028     virtual ~Context();
0029 
0030     QString name() const;
0031 
0032 public slots:
0033     void setName(const QString &name);
0034 
0035 signals:
0036     void nameChanged(const QString &name);
0037 
0038 private:
0039     QString m_name;
0040 };
0041 
0042 }
0043 
0044 Q_DECLARE_METATYPE(Domain::Context::Ptr)
0045 
0046 #endif // DOMAIN_CONTEXT_H