libdrmconf 0.13.2
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{
19
20protected:
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
65 void modified();
66
67protected slots:
69 void onReferenceDeleted(QObject *obj);
70
71protected:
76};
77
78
83{
85
86protected:
88 ContactReference(const QMetaObject &elementType, QObject *parent = nullptr);
89
90public:
92 explicit ContactReference(QObject *parent=nullptr);
93};
94
95
99{
101
102public:
104 explicit DMRContactReference(QObject *parent=nullptr);
105};
106
107
110{
111 Q_OBJECT
112
113public:
115 explicit DMRContactRefList(QObject *parent=nullptr);
116};
117
118
123{
125
126protected:
128 ChannelReference(const QMetaObject &elementType, QObject *parent = nullptr);
129
130public:
132 explicit ChannelReference(QObject *parent=nullptr);
133};
134
135
139{
141
142public:
144 explicit DMRChannelReference(QObject *parent=nullptr);
145};
146
147
151{
153
154public:
156 explicit FMChannelReference(QObject *parent=nullptr);
157};
158
159
163{
164 Q_OBJECT
165
166protected:
168 explicit ChannelRefList(const QMetaObject &elementTypes, QObject *parent = nullptr);
169
170public:
172 explicit ChannelRefList(QObject *parent=nullptr);
173};
174
175
179{
180 Q_OBJECT
181
182public:
184 explicit DMRChannelRefList(QObject *parent=nullptr);
185};
186
187
191{
192 Q_OBJECT
193
194public:
196 explicit RoamingChannelRefList(QObject *parent=nullptr);
197};
198
199
203{
205
206public:
208 explicit ScanListReference(QObject *parent=nullptr);
209};
210
211
216
217protected:
219 PositioningSystemReference(const QMetaObject &elementType, QObject *parent = nullptr);
220
221public:
223 explicit PositioningSystemReference(QObject *parent=nullptr);
224};
225
226
231
232public:
234 explicit APRSSystemReference(QObject *parent=nullptr);
235};
236
237
242
243public:
245 explicit GPSSystemReference(QObject *parent=nullptr);
246};
247
248
253
254public:
256 explicit DMRRadioIDReference(QObject *parent=nullptr);
257};
258
259
264
265public:
267 explicit GroupListReference(QObject *parent=nullptr);
268};
269
270
275
276public:
278 explicit RoamingZoneReference(QObject *parent=nullptr);
279};
280
281
286
287public:
289 explicit EncryptionKeyReference(QObject *parent=nullptr);
290};
291
292
297
298public:
300 explicit ZoneReference(QObject *parent=nullptr);
301};
302
303
304#endif // CONFIGREFERENCE_HH
Implements a reference to an APRS system.
Definition configreference.hh:229
const QList< QMetaObject > & elementTypes() const
Returns the element type for this list.
Definition configobject.cc:1350
Represents a list of weak references to channels (analog and digital).
Definition configreference.hh:163
Represents a reference to a channel.
Definition configreference.hh:123
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:34
bool is() const
Returns true if this object is of class Object.
Definition configobject.hh:142
const Object * as() const
Casts this object to the given type.
Definition configobject.hh:148
List class for config objects.
Definition configobject.hh:385
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
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:194
Represents a reference to a contact.
Definition configreference.hh:83
Represents a list of references to some DMR channels.
Definition configreference.hh:179
Implements a reference to a DMR channel.
Definition configreference.hh:139
Extension to the DigitalChannel class to implement an DMR channel.
Definition channel.hh:363
List of references to DMR contacts.
Definition configreference.hh:110
Represents a reference to a DMR contact.
Definition configreference.hh:99
Implements a reference to a radio ID.
Definition configreference.hh:251
Implements a reference to an encryption key.
Definition configreference.hh:284
Base class of all encryption keys.
Definition encryptionextension.hh:10
Implements a reference to a FM channel.
Definition configreference.hh:151
Extension to the AnalogChannel class to implement an analog FM channel.
Definition channel.hh:221
Implements a reference to a GPS system.
Definition configreference.hh:240
Implements a reference to a group list.
Definition configreference.hh:262
Implements a reference to a positioning system.
Definition configreference.hh:214
Represents a list of references to some roaming channels.
Definition configreference.hh:191
Implements a reference to a roaming zone.
Definition configreference.hh:273
Implements a reference to a scan list.
Definition configreference.hh:203
Generic representation of a scan list.
Definition scanlist.hh:15
Implements a reference to a zone.
Definition configreference.hh:295