summaryrefslogtreecommitdiff
path: root/logbook/AD1CCty.hpp
blob: 4afb7d9b7461248e43957520092b89a064a0668d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef AD1C_CTY_HPP_
#define AD1C_CTY_HPP_

#include <QObject>
#include <QDebug>
#include "pimpl_h.hpp"

class QString;
class Configuration;

//
// AD1CCty  - Fast  access database  of Jim  Reisert, AD1C's,  cty.dat
// 						entity and entity override information file.
// 
class AD1CCty final
  : public QObject
{
  Q_OBJECT

public:
  //
  // Continent enumeration
  // 
  enum class Continent {UN, AF, AN, AS, EU, NA, OC, SA};
  static Continent continent (QString const& continent_id);
  static char const * continent (Continent);
  Q_ENUM (Continent)

  struct Record
  {
    explicit Record ();

    Continent continent;
    int CQ_zone;
    int ITU_zone;
    QString entity_name;
    QString abbreviated_entity_name;
    bool WAE_only;
    float latitude;
    float longtitude;
    int UTC_offset;
    QString primary_prefix;
  };

  explicit AD1CCty (Configuration const *);
  void reload(Configuration const * configuration);
  ~AD1CCty ();
  Record lookup (QString const& call) const;
  QString version () const;
  Q_SIGNAL void cty_loaded (QString const& version) const;

  QString findState (QString const& grid) const;   //NJ0A

private:
  class impl;
  pimpl<impl> m_;
};

#if !defined (QT_NO_DEBUG_STREAM)
QDebug operator << (QDebug, AD1CCty::Record const&);
#endif

#endif