QWlanManager
Loading...
Searching...
No Matches
interface.h
1#ifndef QWLANMAN_DATAS_INTERFACE_H
2#define QWLANMAN_DATAS_INTERFACE_H
3
4#include "qwlanmanager/qwlanman_global.h"
5
6#include "qwlanmanager/cache/cachepolicy.h"
7#include "qwlanmanager/datas/network.h"
8#include "qwlanmanager/qwlantypes.h"
9
10#include <QUuid>
11
12/*****************************/
13/* Namespace instructions */
14/*****************************/
15namespace qwm
16{
17
18/*****************************/
19/* Class definitions */
20/*****************************/
21
22class InterfaceData;
23class QWLANMAN_EXPORT Interface
24{
25 Q_GADGET
26
27 Q_PROPERTY(QUuid uid READ getUid)
28 Q_PROPERTY(QString hwAddress READ getHwAddress)
29 Q_PROPERTY(QString name READ getName)
30 Q_PROPERTY(QString description READ getDescription)
31
32 Q_PROPERTY(CachePolicy cachePolicy READ getCachePolicy WRITE setCachePolicy)
33 Q_PROPERTY(IfaceOptions options READ getOptions WRITE setOptions)
34
35 friend class InterfaceMutator;
36
37public:
38 Interface();
39
40 Interface(const Interface &other);
41 Interface(Interface &&other);
42
43 ~Interface();
44
45public:
46 bool isValid() const;
47 bool isBusy() const;
48
49 IfaceState getState() const;
50 IfaceOptions getOptions() const;
51
52 const QUuid& getUid() const;
53 const QString& getHwAddress() const;
54 const QString& getName() const;
55 const QString& getDescription() const;
56 const CachePolicy& getCachePolicy() const;
57
58 const MapNetworks& getMapNetworks() const;
59
60 ListNetworks getListNetworks() const;
61 Network getNetwork(const QString &ssid) const;
62 Network getNetworkConnected() const;
63
64public:
65 void setCachePolicy(const CachePolicy &cachePolicy);
66 void setOptions(IfaceOptions opts);
67
68public:
69 Interface& operator=(const Interface &other);
70 Interface& operator=(Interface &&other) noexcept;
71
72public:
73 bool operator==(const Interface &other) const;
74 bool operator!=(const Interface &other) const;
75
76private:
77 QSharedPointer<InterfaceData> d_ptr;
78};
79
80/*****************************/
81/* Qt specific methods */
82/*****************************/
83
84QWLANMAN_EXPORT QDebug operator<<(QDebug debug, const Interface &interface);
85
86/*****************************/
87/* Alias for related types */
88/*****************************/
89
90using ListInterfaces = QList<Interface>;
91using MapInterfaces = QHash<QUuid, Interface>;
93/*****************************/
94/* End namespaces */
95/*****************************/
96
97} // namespace qwm
98
99/*****************************/
100/* Qt specific meta-system */
101/*****************************/
102
103Q_DECLARE_METATYPE(qwm::Interface)
104
105#endif // QWLANMAN_DATAS_INTERFACE_H
Class allowing to determine the cache policy to adopt.
Definition cachepolicy.h:21
Class containing interface properties.
Definition interface.h:24
Class containing network properties.
Definition network.h:25
Namespace used for QWlanManager library.
Definition cachepolicy.h:13
IfaceState
Interface states.
Definition qwlantypes.h:118
IfaceOptions
QFlags type for qwm::IfaceOption enum
Definition qwlantypes.h:153
QHash< QUuid, Interface > MapInterfaces
Definition interface.h:91
QHash< QString, Network > MapNetworks
Definition network.h:76