swift
textmessage.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_FSD_TEXTMESSAGE_H
7 #define SWIFT_CORE_FSD_TEXTMESSAGE_H
8 
9 #include <QString>
10 #include <QStringList>
11 #include <QVector>
12 
13 #include "core/fsd/messagebase.h"
14 
15 namespace swift::core::fsd
16 {
19  {
20  public:
22  enum Type
23  {
24  PrivateMessage,
25  RadioMessage,
26  };
27 
29  TextMessage(const QString &sender, const QString &receiver, const QString &message);
30 
32  QStringList toTokens() const;
33 
35  static TextMessage fromTokens(const QStringList &tokens);
36 
38  static QString pdu() { return "#TM"; }
39 
40  QString m_message;
41  Type m_type = PrivateMessage;
42  QVector<int> m_frequencies;
43 
44  private:
45  TextMessage();
46  };
47 } // namespace swift::core::fsd
48 
49 #endif // SWIFT_CORE_FSD_TEXTMESSAGE_H
FSD message base class.
Definition: messagebase.h:58
Text, radio or private message.
Definition: textmessage.h:19
static QString pdu()
PDU identifier.
Definition: textmessage.h:38
QString m_message
message text
Definition: textmessage.h:40
QVector< int > m_frequencies
frequencies in case of radio message.
Definition: textmessage.h:42
#define SWIFT_CORE_EXPORT
Export a class or function from the library.