libdrmconf 0.14.0
A library to program DMR radios.
Loading...
Searching...
No Matches
roamingzone.hh
1#ifndef ROAMINGZONE_HH
2#define ROAMINGZONE_HH
3
4#include <QAbstractListModel>
5#include "configreference.hh"
6#include "roamingchannel.hh"
7
74
75
81{
83
84protected:
87 explicit DefaultRoamingZone(QObject *parent=nullptr);
88
89public:
91 static DefaultRoamingZone *get();
92
93protected:
96};
97
98
103{
104 Q_OBJECT
105
106public:
108 explicit RoamingZoneList(QObject *parent=nullptr);
109
111 RoamingZone *zone(int idx) const;
112
113 int add(ConfigObject *obj, int row=-1, bool unique=true);
114
115public:
116 ConfigItem *allocateChild(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack());
117};
118
119#endif // ROAMINGZONE_HH
Parse context for config objects.
Definition configobject.hh:43
Base class for all configuration objects (channels, zones, contacts, etc).
Definition configobject.hh:35
const Object * as() const
Casts this object to the given type.
Definition configobject.hh:146
List class for config objects.
Definition configobject.hh:342
Base class of all labeled and named objects.
Definition configobject.hh:192
QString name
The name of the object.
Definition configobject.hh:196
Dummy roaming zone class that represents the default roaming zone.
Definition roamingzone.hh:81
static DefaultRoamingZone * _instance
Holds a reference to the singleton instance of this class.
Definition roamingzone.hh:95
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Represents a list of references to some roaming channels.
Definition configreference.hh:191
Represents a roaming channel.
Definition roamingchannel.hh:16
Represents the list of roaming zones within the abstract device configuration.
Definition roamingzone.hh:103
Represents a RoamingZone within the abstract device configuration.
Definition roamingzone.hh:15
ConfigItem * clone() const
Clones this item.
Definition roamingzone.cc:28
void clear()
Clears the zone list.
Definition roamingzone.cc:43
int addChannel(RoamingChannel *ch, int row=-1)
Adds a channel to the roaming zone.
Definition roamingzone.cc:63
bool contains(const RoamingChannel *ch) const
Returns true, if the given roaming channel is member of this zone.
Definition roamingzone.cc:48
bool link(const YAML::Node &node, const Context &ctx, const ErrorStack &err)
Links the channel reference list.
Definition roamingzone.cc:92
bool remChannel(int row)
Removes the channel from the roaming zone at index row.
Definition roamingzone.cc:72
RoamingChannelRefList _channel
Holds the actual channels of the roaming zone.
Definition roamingzone.hh:72
RoamingChannelRefList * channels
The channels in the roaming zone.
Definition roamingzone.hh:22
bool populate(YAML::Node &node, const Context &context, const ErrorStack &err)
Serializes the channel reference list.
Definition roamingzone.cc:143
int count() const
Returns the number of zones.
Definition roamingzone.cc:38
RoamingChannel * channel(int idx) const
Returns the roaming channel, which is the member at index idx (0-based).
Definition roamingzone.cc:56