]> git.mxchange.org Git - flightgear.git/blob - src/ATC/ATCDialog.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / ATC / ATCDialog.hxx
1 // ATCDialog.hxx - Functions and classes to handle the pop-up ATC dialog
2 //
3 // Written by Alexander Kappes and David Luff, started February 2003.
4 //
5 // Copyright (C) 2003  Alexander Kappes and David Luff
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // 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, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 #ifndef ATC_DIALOG_HXX
22 #define ATC_DIALOG_HXX
23
24 #include <simgear/compiler.h>
25
26 #include "ATC.hxx"
27
28 // ATCMenuEntry - an encapsulation of an entry in the ATC dialog
29 struct ATCMenuEntry {
30
31   string  stationid;    // ID of transmitting station
32   int     stationfr;    // ?
33   string  transmission; // Actual speech of transmission
34   string  menuentry;    // Shortened version for display in the dialog
35
36   ATCMenuEntry();
37   ~ATCMenuEntry();
38 };
39
40 // convenience types
41 typedef vector < ATCMenuEntry > atcmentry_list_type;
42 typedef atcmentry_list_type::iterator atcmentry_list_iterator;
43 typedef atcmentry_list_type::const_iterator atcmentry_list_const_iterator;
44   
45 // typedef map < string, atcmentry_list_type, less<string> > atcmentry_map_type;
46 typedef map < string, atcmentry_list_type > atcmentry_map_type;
47 typedef atcmentry_map_type::iterator atcmentry_map_iterator;
48 typedef atcmentry_map_type::const_iterator atcmentry_map_const_iterator;
49
50 void ATCDialogInit();
51
52 void ATCDoDialog(atc_type type);
53
54 class FGATCDialog {
55         
56 public:
57
58         void Init();
59         
60         void DoDialog();
61         
62         void add_entry( string station, string transmission, string menutext );
63         
64         bool trans_reg( const string &station, const string &trans );
65
66 private:
67
68         atcmentry_map_type atcmentrylist_station;
69   
70         int  freq;
71         bool reset;
72 };
73         
74 extern FGATCDialog *current_atcdialog;  
75
76 #endif  // ATC_DIALOG_HXX
77