2018-11-11 21:11:58 -05:00
|
|
|
#ifndef CABRILLO_LOG_HPP_
|
|
|
|
#define CABRILLO_LOG_HPP_
|
|
|
|
|
2019-05-30 17:20:09 -04:00
|
|
|
#include <QObject>
|
2019-05-29 18:35:18 -04:00
|
|
|
#include <QSet>
|
2019-05-30 17:20:09 -04:00
|
|
|
#include <QPair>
|
2019-05-29 18:35:18 -04:00
|
|
|
#include <QString>
|
2018-11-11 21:11:58 -05:00
|
|
|
#include "Radio.hpp"
|
|
|
|
#include "pimpl_h.hpp"
|
|
|
|
|
|
|
|
class Configuration;
|
|
|
|
class QDateTime;
|
2018-11-25 17:19:41 -05:00
|
|
|
class QSqlTableModel;
|
2018-11-11 21:11:58 -05:00
|
|
|
class QTextStream;
|
2019-05-29 18:35:18 -04:00
|
|
|
class AD1CCty;
|
2018-11-11 21:11:58 -05:00
|
|
|
|
|
|
|
class CabrilloLog final
|
2019-05-30 17:20:09 -04:00
|
|
|
: public QObject
|
2018-11-11 21:11:58 -05:00
|
|
|
{
|
2019-05-30 17:20:09 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
2018-11-11 21:11:58 -05:00
|
|
|
public:
|
|
|
|
using Frequency = Radio::Frequency;
|
2019-05-30 17:20:09 -04:00
|
|
|
using worked_item = QPair<QString, QString>;
|
|
|
|
using worked_set = QSet<worked_item>;
|
2018-11-11 21:11:58 -05:00
|
|
|
|
2019-05-30 17:20:09 -04:00
|
|
|
explicit CabrilloLog (Configuration const *, QObject * parent = nullptr);
|
2018-11-11 21:11:58 -05:00
|
|
|
~CabrilloLog ();
|
|
|
|
|
|
|
|
// returns false if insert fails
|
2019-05-30 17:20:09 -04:00
|
|
|
bool add_QSO (Frequency, QString const& mode, QDateTime const&, QString const& call
|
2018-11-11 21:11:58 -05:00
|
|
|
, QString const& report_sent, QString const& report_received);
|
|
|
|
bool dupe (Frequency, QString const& call) const;
|
|
|
|
|
2018-11-25 17:19:41 -05:00
|
|
|
QSqlTableModel * model ();
|
2018-11-11 21:11:58 -05:00
|
|
|
void reset ();
|
|
|
|
void export_qsos (QTextStream&) const;
|
2019-05-30 17:20:09 -04:00
|
|
|
worked_set unique_DXCC_entities (AD1CCty const *) const;
|
|
|
|
|
|
|
|
Q_SIGNAL void data_changed () const;
|
2018-11-11 21:11:58 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
class impl;
|
|
|
|
pimpl<impl> m_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|