klog
klogdefinitions.h
1 #ifndef KLOG_KLOGDEFINITIONS_H
2 #define KLOG_KLOGDEFINITIONS_H
3 /***************************************************************************
4  klogdefinitions.h - description
5  -------------------
6  begin : oct 2020
7  copyright : (C) 2020 by Jaime Robles
8  user : jaime@robles.es
9  ***************************************************************************/
10 
11 /*****************************************************************************
12  * This file is part of KLog. *
13  * *
14  * KLog is free software: you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation, either version 3 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * KLog is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with KLog. If not, see <https://www.gnu.org/licenses/>. *
26  * *
27  *****************************************************************************/
28 
29 #include <QString>
30 #include "frequency.h"
31 
32 //using namespace std;
33 
34 enum ExportMode {ModeLotW, ModeADIF, ModeClubLog, ModeEQSL, ModeQRZ};
35 enum OnLineProvider {ClubLog, LoTW, eQSL, QRZ}; //, HamQTH, HRDLog
36 enum OnlineErrorCode {Ok, Fail};
37 enum OnlineErrorReason {Other, Auth, DupeQSO, WrongLogBook};
38 enum DebugLogLevel {
39  None, // No logging
40  Fatal, // Non recuprable error. App can't continue
41  Error, // Recuperable error, failed operation
42  Warning, // Not normal situation
43  Info, // Informational event (connection, disconnection, ...)
44  Debug, // Debug for diagnostic
45  Devel // Verbose entry (i.e. Start of each method)
46 };
47 
48 enum ValidFieldsForStats {DXCC, GridSquare};
49 enum FilesToDownload {CTY, Sats};
50 enum QSOStatus {unknown, ATNO, needed, worked, confirmed};
51 enum WJTXStatus {NewContinent, NewContinentInBand, NewContinentInMode,
52  NewCQ, NewCQInBand, NewCQInMode,
53  NewITU, NewITUInBand, NewITUInMode,
54  NewDXCC, NewDXCCInBand, NewDXCCInMode,
55  NewGrid, NewGridInBand, NewGridInMode,
56  NewCall, NewCallInBand, NewCallInMode };
57 
58 enum MouseClicks {NoClick, RightClick, SingleClick, DoubleClick};
59 //enum DataTableHash {WorldData, BandData, ModeData}; // Used by World & DataProxy to select the table to build a Hash
60 
61 //struct EntityData { // Used to pass a list of data from World to dxccstatuswidget
62 // int dxcc;
63 // QString mainprefix;
64 // QString name;
65 // QString isoname;
66 //};
67 
68 struct EntityData { // Used to pass a list of data from World to dxccstatuswidget
69  int dxcc = -1;
70  QString mainprefix = QString();
71  QString name = QString();
72  QString isoname = QString();
73 
74  bool operator<(const EntityData &other) const {
75  return std::tie(dxcc, mainprefix, name, isoname) < std::tie(other.dxcc, other.mainprefix, other.name, other.isoname);
76  }
77 
78  bool operator==(const EntityData &other) const {
79  return std::tie(dxcc, mainprefix, name, isoname) == std::tie(other.dxcc, other.mainprefix, other.name, other.isoname);
80  }
81 };
82 
83 struct EntityStatus { // Used to pass a list of data from Awards to dxccstatuswidget
84  int dxcc = -1;
85  int bandId = -1;
86  int modeId = -1;
87  QSOStatus status = unknown; // status of this Entity in this band & mode
88  int qsoId = -1; // QSOid that provides this status
89  int logId = -1; // Log where we are checking the status (TODO: This may be redundant as the qsoId may be used to get the log)
90 };
91 
92 struct Coordinate {
93  double lat = 0.0;
94  double lon = 0.0;
95 };
96 
97 struct PrimarySubdivision { // Used to return data to MainWindow for each prefix
98  QString name;
99  QString shortName;
100  QString prefix;
101  int cqz = -1;
102  int ituz = -1;
103  int dxcc = -1;
104 };
105 
106 struct ADIFField {
107  QString field;
108  QString value;
109  bool valid = false;
110  // qChar type;
111 };
112 
113 struct RadioStatus {
114  Frequency freq_VFO_TX;
115  Frequency freq_VFO_RX;
116  bool split = false;
117  QString mode_VFO_TX;
118  QString mode_VFO_RX;
119  bool memoryMode = false;
120  int memoryChannel = -1;
121 };
122 
123 #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 2))
124 #define QT_SKIP Qt::SkipEmptyParts
125 #define QT_ENDL Qt::endl
126 #define QT_RETURNBYVALUE Qt::ReturnByValue
127 #else
128 #define QT_SKIP QString::SkipEmptyParts
129 #define QT_ENDL endl
130 #define QT_RETURNBYVALUE
131 #endif
132 
133 #endif // KLOGDEFINITIONS_H
Definition: klogdefinitions.h:97
Definition: klogdefinitions.h:113
Definition: klogdefinitions.h:68
Definition: klogdefinitions.h:92
Definition: klogdefinitions.h:106
Definition: klogdefinitions.h:83
Definition: frequency.h:36