dlgTextEntry_Keyboard: rename to TouchTextEntry
[xcsoar.git] / src / PageState.hpp
blob75362435323ccfc2a9ad2f5fb83369df7f27b71c
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_PAGE_STATE_HPP
25 #define XCSOAR_PAGE_STATE_HPP
27 #include "PageSettings.hpp"
28 #include "Math/fixed.hpp"
30 #include <array>
31 #include <type_traits>
33 /**
34 * The state of one configured page.
36 struct PageState {
37 /**
38 * The last map scale on this page. Negative means it's undefined.
39 * This attribute is only used if PageSettings::distinct_zoom is
40 * enabled.
42 fixed map_scale;
44 void Clear() {
45 map_scale = fixed(-1);
49 /**
50 * Keeps track of the state of the "pages" subsystem.
52 struct PagesState {
53 static constexpr unsigned MAX_PAGES = PageSettings::MAX_PAGES;
55 /**
56 * The index of the current page in the list of configured pages,
57 * see #PageSettings.
59 * This setting is only active if #special_page is not defined.
60 * Otherwise, it is the page that we will return to after the user
61 * decides to leave the #special_page.
63 unsigned current_index;
65 /**
66 * If this attribute is defined (see PageLayout::IsDefined()), then
67 * the current page is not the one in #PageSettings, specified by
68 * #page_index, but a page that was created automatically. For
69 * example, it could be a page that was created by clicking on the
70 * FLARM radar. Pressing left/right will return to the last
71 * configured page.
73 PageLayout special_page;
75 std::array<PageState, MAX_PAGES> pages;
77 void Clear();
80 static_assert(std::is_trivial<PagesState>::value, "type is not trivial");
82 #endif