libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
smsextension.hh
1#ifndef SMSEXTENSION_HH
2#define SMSEXTENSION_HH
3
4#include "configobject.hh"
5#include "interval.hh"
6
7
11{
12 Q_OBJECT
13
15 Q_CLASSINFO("IdPrefix", "sms")
16
17
18 Q_PROPERTY(QString message READ message WRITE setMessage)
19
20public:
22 Q_INVOKABLE explicit SMSTemplate(QObject *parent = nullptr);
23
24 ConfigItem *clone() const;
25
27 const QString &message() const;
29 void setMessage(const QString message);
30
31protected:
33 QString _message;
34};
35
36
39{
40 Q_OBJECT
41
42public:
44 Q_INVOKABLE SMSTemplates(QObject *parent=nullptr);
45
46 ConfigItem *allocateChild(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack());
47
49 SMSTemplate *message(unsigned int i) const;
50};
51
52
55{
56 Q_OBJECT
57
59 Q_PROPERTY(Format format READ format WRITE setFormat)
61 Q_PROPERTY(SMSTemplates *templates READ smsTemplates)
62
63public:
65 enum class Format {
66 Motorola, Hytera, DMR
67 };
68 Q_ENUM(Format)
69
70public:
72 Q_INVOKABLE explicit SMSExtension(QObject *parent = nullptr);
73
74 ConfigItem *clone() const;
75
77 Format format() const;
79 void setFormat(Format format);
80
82 SMSTemplates *smsTemplates() const;
83
84protected:
89};
90
91#endif // SMSEXTENSION_HH
Base class of all device/vendor specific confiuration extensions.
Definition configobject.hh:246
Parse context for config objects.
Definition configobject.hh:48
Base class for all configuration objects (channels, zones, contacts, etc).
Definition configobject.hh:40
virtual ConfigItem * allocateChild(QMetaProperty &prop, const YAML::Node &node, const Context &ctx, const ErrorStack &err=ErrorStack())
Allocates an instance for the given property on the given YAML node.
Definition configobject.cc:490
List class for config objects.
Definition configobject.hh:349
Base class of all labeled and named objects.
Definition configobject.hh:199
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:41
Extension collecting all settings associated with SMS messages.
Definition smsextension.hh:55
SMSTemplates * _smsTemplates
Owns a reference to the list of SMS templates.
Definition smsextension.hh:88
Format _format
Holds the SMS format.
Definition smsextension.hh:86
Format
Possible SMS formats, DMR is usually a good idea.
Definition smsextension.hh:65
Represents a SMS message template (pre defined message).
Definition smsextension.hh:11
QString _message
Holds the message text.
Definition smsextension.hh:33
QString message
Specifies the prefix for every ID assigned to every message during serialization.
Definition smsextension.hh:18
ConfigItem * clone() const
Clones this item.
Definition smsextension.cc:14
void setMessage(const QString message)
Sets the message text.
Definition smsextension.cc:29
Just a list, holding the SMS templates.
Definition smsextension.hh:39