2014-04-03 15:29:13 -04:00
|
|
|
// -*- Mode: C++ -*-
|
2012-05-22 13:09:48 -04:00
|
|
|
#ifndef DISPLAYTEXT_H
|
|
|
|
#define DISPLAYTEXT_H
|
|
|
|
|
2015-02-13 03:53:02 -05:00
|
|
|
#include <QTextEdit>
|
2017-08-04 14:03:54 -04:00
|
|
|
#include <QFont>
|
2018-03-28 18:25:46 -04:00
|
|
|
#include <QHash>
|
|
|
|
#include <QPair>
|
|
|
|
#include <QString>
|
2017-08-04 14:03:54 -04:00
|
|
|
|
2013-08-24 21:48:45 -04:00
|
|
|
#include "decodedtext.h"
|
|
|
|
|
2017-09-16 16:27:33 -04:00
|
|
|
class QAction;
|
2018-10-16 19:26:04 -04:00
|
|
|
class Configuration;
|
2018-10-24 19:00:19 -04:00
|
|
|
class LogBook;
|
2017-09-16 16:27:33 -04:00
|
|
|
|
2017-08-04 14:03:54 -04:00
|
|
|
class DisplayText
|
|
|
|
: public QTextEdit
|
2012-05-22 13:09:48 -04:00
|
|
|
{
|
2017-08-04 14:03:54 -04:00
|
|
|
Q_OBJECT
|
2012-05-22 13:09:48 -04:00
|
|
|
public:
|
2017-08-04 14:03:54 -04:00
|
|
|
explicit DisplayText(QWidget *parent = 0);
|
2018-10-16 19:26:04 -04:00
|
|
|
void set_configuration (Configuration const * configuration) {m_config = configuration;}
|
2017-08-04 14:03:54 -04:00
|
|
|
void setContentFont (QFont const&);
|
|
|
|
void insertLineSpacer(QString const&);
|
2018-10-24 19:00:19 -04:00
|
|
|
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);
|
2018-08-24 13:18:49 -04:00
|
|
|
void displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode);
|
2017-08-04 14:03:54 -04:00
|
|
|
void displayQSY(QString text);
|
2018-10-16 19:26:04 -04:00
|
|
|
void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});
|
2012-05-22 13:09:48 -04:00
|
|
|
|
2018-02-06 16:49:57 -05:00
|
|
|
Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers);
|
2017-09-16 16:27:33 -04:00
|
|
|
Q_SIGNAL void erased ();
|
2012-05-22 13:09:48 -04:00
|
|
|
|
2018-10-16 19:26:04 -04:00
|
|
|
Q_SLOT void appendText (QString const& text, QColor bg = QColor {}, QColor fg = QColor {}
|
2018-03-28 18:25:46 -04:00
|
|
|
, QString const& call1 = QString {}, QString const& call2 = QString {});
|
2017-09-16 16:27:33 -04:00
|
|
|
Q_SLOT void erase ();
|
2018-03-28 18:25:46 -04:00
|
|
|
Q_SLOT void highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_only);
|
2013-08-11 07:45:17 -04:00
|
|
|
|
2012-05-22 13:09:48 -04:00
|
|
|
protected:
|
2017-08-04 14:03:54 -04:00
|
|
|
void mouseDoubleClickEvent(QMouseEvent *e);
|
2013-08-11 07:45:17 -04:00
|
|
|
|
|
|
|
private:
|
2018-10-16 19:26:04 -04:00
|
|
|
Configuration const * m_config;
|
2017-12-04 12:55:24 -05:00
|
|
|
bool m_bPrincipalPrefix;
|
2018-11-28 20:03:44 -05:00
|
|
|
QString appendWorkedB4(QString message, QString callsign
|
2018-10-24 19:00:19 -04:00
|
|
|
, QString const& grid, QColor * bg, QColor * fg
|
|
|
|
, LogBook const& logBook, QString const& currentBand
|
|
|
|
, QString const& currentMode);
|
2017-08-04 14:03:54 -04:00
|
|
|
QFont char_font_;
|
2017-09-16 16:27:33 -04:00
|
|
|
QAction * erase_action_;
|
2018-03-28 18:25:46 -04:00
|
|
|
QHash<QString, QPair<QColor, QColor>> highlighted_calls_;
|
2012-05-22 13:09:48 -04:00
|
|
|
};
|
|
|
|
|
2018-09-01 09:53:38 -04:00
|
|
|
extern QHash<QString,int> m_LoTW;
|
|
|
|
|
2012-05-22 13:09:48 -04:00
|
|
|
#endif // DISPLAYTEXT_H
|