6 #ifndef SWIFT_MISC_NETWORK_TEXTMESSAGE_H
7 #define SWIFT_MISC_NETWORK_TEXTMESSAGE_H
25 namespace swift::misc::network
36 IndexSenderCallsign = CPropertyIndexRef::GlobalIndexCTextMessage,
37 IndexRecipientCallsign,
38 IndexRecipientCallsignOrFrequency,
66 QString getRecipientCallsignOrFrequency()
const;
72 bool isSendToUnicom()
const;
75 bool hasValidRecipient()
const;
84 QString getAsciiOnlyMessage()
const;
87 QString getHtmlEncodedMessage()
const;
90 bool isEmpty()
const {
return m_message.isEmpty(); }
93 void setMessage(
const QString &message);
102 bool isPrivateMessage()
const;
105 bool isRadioMessage()
const;
108 bool isServerMessage()
const;
111 bool isBroadcastMessage()
const;
114 bool isWallopMessage()
const;
120 QString asString(
bool withSender,
bool withRecipient,
const QString &separator =
", ")
const;
127 CStatusMessage asStatusMessage(
bool withSender,
bool withRecipient,
const QString &separator =
", ")
const;
130 QString asHtmlSummary(
const QString &separator =
"<br>")
const;
133 void toggleSenderRecipient();
137 bool isSelcalMessage()
const;
140 bool isSelcalMessageFor(
const QString &selcal)
const;
143 bool isSupervisorMessage()
const;
153 bool isRelayedMessage()
const;
159 void markAsBroadcastMessage();
165 bool relayedMessageToPrivateMessage();
168 bool canBeAppended(
const CTextMessage &textMessage)
const;
174 QString getSelcalCode()
const;
180 QPixmap toPixmap()
const;
192 QString convertToQString(
bool i18n =
false)
const;
195 static const QString &swiftRelayMessage();
202 bool m_wasSent =
false;
203 bool m_relayedMessage =
false;
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Non-owning reference to a CPropertyIndex with a subset of its features.
Streamable status message, e.g.
Mix of the most commonly used mixin classes.
Value object encapsulating information of a callsign.
ColumnIndex
Base class enums.
Value object encapsulating information of a text message.
void setSenderCallsign(const aviation::CCallsign &callsign)
Set callsign (from)
void markAsRelayedMessage()
Mark as relayed message.
bool isEmpty() const
Empty message.
const QString & getMessage() const
Get message.
void setRecipientCallsign(const aviation::CCallsign &callsign)
Set callsign (recipient)
bool wasSent() const
Was sent?
const aviation::CCallsign & getSenderCallsign() const
Get callsign (from)
void setFrequency(const physical_quantities::CFrequency &frequency)
Set frequency.
const aviation::CCallsign & getRecipientCallsign() const
Get callsign (to)
CTextMessage()
Default constructor.
const physical_quantities::CFrequency & getFrequency() const
Get frequency.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...