summaryrefslogtreecommitdiff
path: root/widgets/displaytext.h
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
committerChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
commite0737c56c1e384e05064a0c6e1ac46979371041b (patch)
treea0123d694a2d36c43dabdf0a3907392fce11d457 /widgets/displaytext.h
parentb4aebf2d137b892f53503b13785ecae900062ff7 (diff)
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'widgets/displaytext.h')
-rw-r--r--widgets/displaytext.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/widgets/displaytext.h b/widgets/displaytext.h
new file mode 100644
index 00000000..1f20ac15
--- /dev/null
+++ b/widgets/displaytext.h
@@ -0,0 +1,58 @@
+// -*- Mode: C++ -*-
+#ifndef DISPLAYTEXT_H
+#define DISPLAYTEXT_H
+
+#include <QTextEdit>
+#include <QFont>
+#include <QHash>
+#include <QPair>
+#include <QString>
+
+#include "decodedtext.h"
+
+class QAction;
+class Configuration;
+class LogBook;
+
+class DisplayText
+ : public QTextEdit
+{
+ Q_OBJECT
+public:
+ explicit DisplayText(QWidget *parent = 0);
+ void set_configuration (Configuration const * configuration) {m_config = configuration;}
+ void setContentFont (QFont const&);
+ void insertLineSpacer(QString const&);
+ void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode,
+ bool displayDXCCEntity, LogBook const& logBook,
+ QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false);
+ void displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode);
+ void displayQSY(QString text);
+ void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});
+
+ Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers);
+ Q_SIGNAL void erased ();
+
+ Q_SLOT void appendText (QString const& text, QColor bg = QColor {}, QColor fg = QColor {}
+ , QString const& call1 = QString {}, QString const& call2 = QString {});
+ Q_SLOT void erase ();
+ Q_SLOT void highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_only);
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent *e);
+
+private:
+ Configuration const * m_config;
+ bool m_bPrincipalPrefix;
+ QString appendWorkedB4(QString message, QString callsign
+ , QString const& grid, QColor * bg, QColor * fg
+ , LogBook const& logBook, QString const& currentBand
+ , QString const& currentMode);
+ QFont char_font_;
+ QAction * erase_action_;
+ QHash<QString, QPair<QColor, QColor>> highlighted_calls_;
+};
+
+ extern QHash<QString,int> m_LoTW;
+
+#endif // DISPLAYTEXT_H