1 // ----------------------------------------------------------------------------
2 // Copyright (C) 2014
3 //              David Freese, W1HKJ
4 //
5 // This file is part of fldigi
6 //
7 // fldigi is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // fldigi is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 // ----------------------------------------------------------------------------
20 
21 #ifndef LOG_SUPPORT_H
22 #define LOG_SUPPORT_H
23 
24 #include <string>
25 
26 #include <FL/Fl_Widget.H>
27 #include <FL/Fl_Menu_.H>
28 
29 #include "qso_db.h"
30 #include "adif_io.h"
31 
32 #include "lgbook.h"
33 
34 #ifdef __WOE32__
35 #  define ADIF_SUFFIX "adi"
36 #else
37 #  define ADIF_SUFFIX "adif"
38 #endif
39 
40 enum savetype {ADIF, CSV, TEXT, LOTW, LO};
41 
42 enum logtype {
43   LOG_QSO, 			// No Contest
44   LOG_GENERIC,		// Generic contest
45   LOG_AIDX,			// Africa International DX
46   LOG_FD,			// ARRL Field Day
47   LOG_AICW,			// ARRL International DX (Cw)
48   LOG_JOTA,			// ARRL Jamboree On The Air
49   LOG_KD,			// ARRL Kids Day
50   LOG_ARR,			// ARRL Rookie Roundup
51   LOG_RTTY,			// ARRL RTTY
52   LOG_ASCR,			// ARRL School Club Roundup
53   LOG_CWSS,			// ARRL November Sweepstakes
54   LOG_WFD,			// ARRL Winter Field Day
55   LOG_BART,			// BARTG RTTY contest
56   LOG_CQ_WPX,		// CQ WPX
57   LOG_CQWW_DX,		// CQ WW Dx
58   LOG_CQWW_RTTY,	// CQ WW RTTY
59   LOG_IARI,			// Italian ARI International DX
60   LOG_NAQP,			// North American QSO Party
61   LOG_NAS,			// North American Sprint
62   LOG_1010,			// Ten Ten
63   LOG_VHF,			// VHF
64 //  LOG_WAE,			// Worked All Europe
65   LOG_SQSO			// State QSO parties
66 };
67 
68 extern cQsoDb        qsodb;
69 extern cAdifIO       adifFile;
70 extern std::string logbook_filename;
71 extern std::string sDate_on;
72 extern std::string sDate_off;
73 extern std::string sTime_on;
74 extern std::string sTime_off;
75 
76 extern void loadBrowser(bool keep_pos = false);
77 
78 extern void Export_log();
79 extern void cb_SortByCall();
80 extern void cb_SortByDate();
81 extern void cb_SortByMode();
82 extern void cb_SortByFreq();
83 extern void cb_browser(Fl_Widget *, void *);
84 
85 extern void cb_mnuNewLogbook(Fl_Menu_* m, void* d);
86 extern void cb_mnuOpenLogbook(Fl_Menu_* m, void* d);
87 extern void cb_mnuSaveLogbook(Fl_Menu_*m, void* d);
88 extern void cb_mnuMergeADIF_log(Fl_Menu_* m, void* d);
89 extern void cb_mnuExportADIF_log(Fl_Menu_* m, void* d);
90 extern void cb_mnuExportCSV_log(Fl_Menu_* m, void* d);
91 extern void cb_mnuExportTEXT_log(Fl_Menu_* m, void* d);
92 
93 extern string lotw_rec(cQsoRec &rec);
94 extern void cb_btnExportLoTW();
95 
96 extern Fl_Double_Window *lotw_review_dialog;
97 extern void cb_review_lotw();
98 extern void cb_send_lotw();
99 extern void send_to_lotw(void *);
100 extern void cb_btn_verify_lotw(Fl_Button *, void *);
101 extern void cb_btn_verify_eqsl(Fl_Button *, void *);
102 extern void cb_btn_view_unmatched(Fl_Button *, void *);
103 
104 extern void cb_Export_Cabrillo(Fl_Menu_* m, void* d);
105 extern void cb_export_date_select();
106 
107 extern void saveLogbook(bool force = false);
108 extern void cb_mnuShowLogbook(Fl_Menu_ *m, void* d);
109 
110 extern void activateButtons();
111 extern void saveRecord ();
112 extern void clearRecord ();
113 extern void updateRecord ();
114 extern void deleteRecord ();
115 extern void AddRecord ();
116 extern void DisplayRecord (int idxRec);
117 extern void SearchLastQSO (const char *);
118 extern cQsoRec* SearchLog(const char *callsign);
119 extern void DupCheck();
120 extern void show_dup(void *);
121 extern void cb_search(Fl_Widget* w, void*);
122 extern int log_search_handler(int);
123 extern void reload_browser();
124 extern void restore_sort();
125 
126 extern void cb_doExport();
127 
128 extern void WriteCabrillo();
129 
130 extern void dxcc_entity_cache_enable(bool v);
131 extern bool qsodb_dxcc_entity_find(const char* country);
132 
133 extern void adif_read_OK();
134 
135 #endif
136