]> git.mxchange.org Git - flightgear.git/blob - src/ATC/atcdialog.hxx
TACAN: fix receiving mobile TACAN.
[flightgear.git] / src / ATC / atcdialog.hxx
1 // atcdialog.hxx - classes to manage user interactions with AI traffic
2 // Written by Durk Talsma, started April 3, 2011
3 // Based on earlier code written by Alexander Kappes and David Luff
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 //
19 // $Id$
20
21
22 #ifndef _ATC_DIALOG_HXX_
23 #define _ATC_DIALOG_HXX_
24
25
26 #ifndef __cplusplus
27 # error This library requires C++
28 #endif
29
30 #include <simgear/constants.h>
31 #include <simgear/compiler.h>
32 #include <simgear/misc/strutils.hxx>
33 #include <simgear/structure/SGSharedPtr.hxx>
34
35 class NewGUI;
36 class SGPropertyNode;
37
38 class FGATCDialogNew
39 {
40 private:
41      NewGUI *_gui;
42      bool dialogVisible;
43      string_list commands;
44
45      static FGATCDialogNew *_instance;
46 public:
47
48     FGATCDialogNew();
49     ~FGATCDialogNew();
50
51     void frequencySearch();
52     void frequencyDisplay(const std::string& ident);
53   
54     void init();
55
56     void update(double dt);
57     void PopupDialog();
58     void addEntry(int, const std::string&);
59     void removeEntry(int);
60
61     static bool popup( const SGPropertyNode * ) {
62         instance()->PopupDialog();
63         return true;
64     }
65   
66     inline static FGATCDialogNew * instance() {
67         if( _instance != NULL ) return _instance;
68         _instance = new FGATCDialogNew();
69         _instance->init();
70         return _instance;
71     }
72 };
73
74
75 #endif // _ATC_DIALOG_HXX_