libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
configreference.hh
1#ifndef CONFIGREFERENCE_HH
2#define CONFIGREFERENCE_HH
3
4#include "configobject.hh"
5#include <QSet>
6
7class Channel;
8class DMRChannel;
9class FMChannel;
10class ScanList;
11class EncryptionKey;
12
16class ConfigObjectReference: public QObject
17{
18 Q_OBJECT
19
20protected:
22 ConfigObjectReference(const QMetaObject &elementType=ConfigObject::staticMetaObject, QObject *parent = nullptr);
23
24public:
27 bool isNull() const;
28
31 virtual void clear();
34 virtual bool set(ConfigObject *object);
36 virtual bool copy(const ConfigObjectReference *ref);
38 virtual bool allow(const QMetaObject *elementType);
39
41 const QStringList &elementTypeNames() const;
42
44 template <class Type>
45 Type *as() const {
46 if (nullptr == _object)
47 return nullptr;
48 return _object->as<Type>();
49 }
50
52 template <class Type>
53 bool is() const {
54 if (nullptr == _object)
55 return false;
56 return _object->is<Type>();
57 }
58
60 int compare(const ConfigObjectReference &other) const;
61
62signals:
65 void modified();
66
67protected slots:
69 void onReferenceDeleted(QObject *obj);
70
71protected:
73 QStringList _elementTypes;
76};
77
78
83{
84 Q_OBJECT
85
86protected:
88 ContactReference(const QMetaObject &elementType, QObject *parent = nullptr);
89
90public:
92 explicit ContactReference(QObject *parent=nullptr);
93};
94
95
99{
100 Q_OBJECT
101
102public:
104 explicit DMRContactReference(QObject *parent=nullptr);
105};
106
107
111{
112 Q_OBJECT
113
114public:
116 explicit M17ContactReference(QObject *parent=nullptr);
117};
118
119
122{
123 Q_OBJECT
124
125public:
127 explicit DMRContactRefList(QObject *parent=nullptr);
128};
129
130
135{
136 Q_OBJECT
137
138protected:
140 ChannelReference(const QMetaObject &elementType, QObject *parent = nullptr);
141
142public:
144 explicit ChannelReference(QObject *parent=nullptr);
145};
146
147
151{
152 Q_OBJECT
153
154public:
156 explicit DMRChannelReference(QObject *parent=nullptr);
157};
158
159
163{
164 Q_OBJECT
165
166public:
168 explicit FMChannelReference(QObject *parent=nullptr);
169};
170
171
175{
176 Q_OBJECT
177
178protected:
180 explicit ChannelRefList(const QMetaObject &elementTypes, QObject *parent = nullptr);
181
182public:
184 explicit ChannelRefList(QObject *parent=nullptr);
185};
186
187
191{
192 Q_OBJECT
193
194public:
196 explicit DMRChannelRefList(QObject *parent=nullptr);
197};
198
199
203{
204 Q_OBJECT
205
206public:
208 explicit RoamingChannelRefList(QObject *parent=nullptr);
209};
210
211
215{
216 Q_OBJECT
217
218public:
220 explicit ScanListReference(QObject *parent=nullptr);
221};
222
223
227 Q_OBJECT
228
229protected:
231 PositioningSystemReference(const QMetaObject &elementType, QObject *parent = nullptr);
232
233public:
235 explicit PositioningSystemReference(QObject *parent=nullptr);
236};
237
238
242 Q_OBJECT
243
244public:
246 explicit FMAPRSSystemReference(QObject *parent=nullptr);
247};
248
249
253 Q_OBJECT
254
255public:
257 explicit DMRAPRSSystemReference(QObject *parent=nullptr);
258};
259
260
264 Q_OBJECT
265
266public:
268 explicit DMRRadioIDReference(QObject *parent=nullptr);
269};
270
271
275 Q_OBJECT
276
277public:
279 explicit GroupListReference(QObject *parent=nullptr);
280};
281
282
286 Q_OBJECT
287
288public:
290 explicit RoamingZoneReference(QObject *parent=nullptr);
291};
292
293
297 Q_OBJECT
298
299public:
301 explicit EncryptionKeyReference(QObject *parent=nullptr);
302};
303
304
308 Q_OBJECT
309
310public:
312 explicit ZoneReference(QObject *parent=nullptr);
313};
314
315
316#endif // CONFIGREFERENCE_HH
const QList< QMetaObject > & elementTypes() const
Returns the element type for this list.
Definition configobject.cc:1476
ChannelRefList(const QMetaObject &elementTypes, QObject *parent=nullptr)
Hidden constructor.
Definition configreference.cc:197
ChannelReference(const QMetaObject &elementType, QObject *parent=nullptr)
Hidden constructor.
Definition configreference.cc:161
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:38
ConfigObjectRefList(const QMetaObject &elementTypes=ConfigObject::staticMetaObject, QObject *parent=nullptr)
Hidden constructor.
Definition configobject.cc:1662
Implements a reference to a config object.
Definition configreference.hh:17
const QStringList & elementTypeNames() const
Returns the type names of allowed objects.
Definition configreference.cc:97
void onReferenceDeleted(QObject *obj)
Internal call back whenever the referenced object gets deleted.
Definition configreference.cc:102
int compare(const ConfigObjectReference &other) const
Compares the references.
Definition configreference.cc:79
virtual bool copy(const ConfigObjectReference *ref)
Copies the reference from another reference.
Definition configreference.cc:71
QStringList _elementTypes
Holds the static QMetaObject of the possible element types.
Definition configreference.hh:73
ConfigObject * _object
The reference to the object.
Definition configreference.hh:75
virtual bool set(ConfigObject *object)
Sets the reference.
Definition configreference.cc:38
virtual void clear()
Resets the reference.
Definition configreference.cc:29
ConfigObjectReference(const QMetaObject &elementType=ConfigObject::staticMetaObject, QObject *parent=nullptr)
Hidden constructor.
Definition configreference.cc:17
void modified()
Gets emitted if the reference is changed.
virtual bool allow(const QMetaObject *elementType)
Adds a possible type to this reference.
Definition configreference.cc:90
bool is() const
Returns true if the reference is of the specified type.
Definition configreference.hh:53
bool isNull() const
Returns true if the reference is null.
Definition configreference.cc:24
Type * as() const
Returns the reference as the specified type.
Definition configreference.hh:45
Base class of all labeled and named objects.
Definition configobject.hh:192
ContactReference(const QMetaObject &elementType, QObject *parent=nullptr)
Constructor.
Definition configreference.cc:115
DMRAPRSSystemReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:269
DMRChannelRefList(QObject *parent=nullptr)
Empty constructor.
Definition configreference.cc:213
DMRChannelReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:177
Extension to the DigitalChannel class to implement an DMR channel.
Definition channel.hh:411
DMRContactRefList(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:151
DMRContactReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:131
DMRRadioIDReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:279
EncryptionKeyReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:309
Base class of all encryption keys.
Definition encryptionextension.hh:10
FMAPRSSystemReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:259
FMChannelReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:187
Extension to the AnalogChannel class to implement an analog FM channel.
Definition channel.hh:258
GroupListReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:289
M17ContactReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:141
PositioningSystemReference(const QMetaObject &elementType, QObject *parent=nullptr)
Hidden constructor.
Definition configreference.cc:243
RoamingChannelRefList(QObject *parent=nullptr)
Empty constructor.
Definition configreference.cc:223
RoamingZoneReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:299
ScanListReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:233
Generic representation of a scan list.
Definition scanlist.hh:15
ZoneReference(QObject *parent=nullptr)
Constructor.
Definition configreference.cc:319