TaskStats: make "flight_mode_height_margin" a constant
[xcsoar.git] / src / ActionInterface.hpp
blobcc538aff41797619a291f2fa6ef4d4256b575cc3
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_ACTION_INTERFACE_HPP
25 #define XCSOAR_ACTION_INTERFACE_HPP
27 #include "Interface.hpp"
29 /**
30 * Class to hold data/methods accessible by interface subsystems
31 * that can perform actions
33 namespace ActionInterface {
34 using namespace CommonInterface;
36 /**
37 * Configure a new Ballast setting in #ComputerSettings, and
38 * forward it to all XCSoar modules that want it.
40 * @param to_devices send the new settings to all devices?
42 void SetBallast(fixed ballast, bool to_devices=true);
44 /**
45 * Configure a new Bugs setting in #ComputerSettings, and
46 * forward it to all XCSoar modules that want it.
48 * @param to_devices send the new settings to all devices?
50 void SetBugs(fixed mc, bool to_devices=true);
52 /**
53 * Configure a new MacCready setting in #ComputerSettings, and
54 * forward it to all XCSoar modules that want it.
56 * @param to_devices send the new settings to all devices?
58 void SetMacCready(fixed mc, bool to_devices=true);
60 /**
61 * Configure a new MacCready setting in #ComputerSettings, and
62 * forward it to all XCSoar modules that want it. Also switch
63 * to manual MC mode.
65 * @param to_devices send the new settings to all devices?
67 void SetManualMacCready(fixed mc, bool to_devices=true);
69 /**
70 * Same as SetManualMacCready(), but adds the given value to the
71 * current MacCready setting. It performs bounds checking.
73 void OffsetManualMacCready(fixed offset, bool to_devices=true);
75 /**
76 * Call this after MapSettings has been modified with
77 * SetMapSettings(). It sends the new values to all sub systems,
78 * and optionally forces a redraw.
79 * @param trigger_draw Triggers the draw event after sending if true
81 void SendMapSettings(const bool trigger_draw = false);
83 /**
84 * Update UIState::display_mode and other attributes related to it.
85 * You may have to call SendUIState() after this.
87 void UpdateDisplayMode();
89 /**
90 * Call this after UIState has been modified (via SetUIState() or
91 * UpdateDisplayMode()). It sends the new values to all subsystems,
92 * and redraws relevant parts of the screen.
94 void SendUIState();
97 /**
98 * Class to hold data/methods accessible by interface subsystems
99 * of main program
101 namespace XCSoarInterface {
102 using namespace ActionInterface;
105 * Receive GPS data (#MoreData) from the DeviceBlackboard.
107 void ReceiveGPS();
110 * Receive calculated data (#DerivedInfo) from the DeviceBlackboard.
112 void ReceiveCalculated();
114 void ExchangeBlackboard();
117 * Copy data from and to the DeviceBlackboard.
119 void ExchangeDeviceBlackboard();
122 #endif