forked from lxqt/lxqt-connman-applet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitemcontroller.h
54 lines (44 loc) · 1.3 KB
/
itemcontroller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef ITEM_H
#define ITEM_H
#include <QStandardItem>
#include "agent.h"
#include "connmanobject.h"
class ItemController : public QObject
{
Q_OBJECT
public:
enum Role
{
WrapperRole = Qt::UserRole,
OrderRole
};
ItemController(QStandardItem* parent, const QString& path, const char* service, const QVariantMap& properties);
virtual ~ItemController();
virtual void activate() = 0;
virtual void update() = 0;
void setOrder(int order);
ConnmanObject* connmanObject;
QStandardItem* item;
signals:
void entityNamed(const QString& path, const QString& newName);
private slots:
virtual void onPropertyChanged(const QString& propertyName, const QDBusVariant& newValue);
};
Q_DECLARE_METATYPE(ItemController*)
class ServiceItemController : public ItemController
{
public:
ServiceItemController(QStandardItem* parent, const QString& path, const QVariantMap& properties);
virtual ~ServiceItemController() {}
virtual void activate();
virtual void update();
};
class TechnologyItemController : public ItemController
{
public:
TechnologyItemController(QStandardItem* parent, const QString& path, const QVariantMap& properties);
virtual ~TechnologyItemController() {}
virtual void activate();
virtual void update();
};
#endif // ITEM_H