The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
helper.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef GUI_AUXILIARY_WINDOW_BUILDER_HELPER_HPP_INCLUDED
16 #define GUI_AUXILIARY_WINDOW_BUILDER_HELPER_HPP_INCLUDED
17 
19 
20 #include <string>
21 #include <vector>
22 
23 class config;
24 
25 namespace gui2
26 {
27 
28 namespace implementation
29 {
30 
31 /**
32  * Returns the vertical alignment.
33  *
34  * @param v_align The string representing the alignment.
35  *
36  * @returns The alignment.
37  */
38 unsigned get_v_align(const std::string& v_align);
39 
40 /**
41  * Returns the horizontal alignment.
42  *
43  * @param h_align The string representing the alignment.
44  *
45  * @returns The alignment.
46  */
47 unsigned get_h_align(const std::string& h_align);
48 
49 /**
50  * Returns the border flags.
51  *
52  * @param borders The string representing the border flags.
53  *
54  * @returns The border flags.
55  */
56 unsigned get_border(const std::vector<std::string>& borders);
57 
58 /**
59  * Returns the placement/resize flags.
60  *
61  * @param cfg The config to look for flags for.
62  *
63  * @returns The placement/resize flags.
64  */
65 unsigned read_flags(const config& cfg);
66 
67 /**
68  * Returns the scrollbar mode flags.
69  *
70  * @param scrollbar_mode The string representing the scrollbar_mode.
71  *
72  * @returns The scrollbar mode flags.
73  */
75 get_scrollbar_mode(const std::string& scrollbar_mode);
76 
77 /**
78  * Returns the return value for a widget.
79  *
80  * If there's a valid retval_id that will be returned.
81  * Else if there's a retval that's returned.
82  * Else it falls back to the id.
83  */
84 int get_retval(const std::string& retval_id,
85  const int retval,
86  const std::string& id);
87 
88 } // namespace implementation
89 
90 } // namespace gui2
91 
92 #endif
unsigned read_flags(const config &cfg)
Returns the placement/resize flags.
Definition: helper.cpp:80
unsigned get_border(const std::vector< std::string > &borders)
Returns the border flags.
Definition: helper.cpp:60
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
Definition: helper.cpp:131
tscrollbar_container::tscrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
Definition: helper.cpp:114
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
tscrollbar_mode
The way to handle the showing or hiding of the scrollbar.
unsigned get_v_align(const std::string &v_align)
Returns the vertical alignment.
Definition: helper.cpp:30
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
unsigned get_h_align(const std::string &h_align)
Returns the horizontal alignment.
Definition: helper.cpp:45
GLsizei const GLcharARB ** string
Definition: glew.h:4503
Contains the implementation details for lexical_cast and shouldn't be used directly.