2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file textbuf_gui.h Stuff related to the text buffer GUI. */
13 #include "window_type.h"
14 #include "string_type.h"
15 #include "strings_type.h"
17 /** Flags used in ShowQueryString() call */
18 enum QueryStringFlags
{
20 QSF_ACCEPT_UNCHANGED
= 0x01, ///< return success even when the text didn't change
21 QSF_ENABLE_DEFAULT
= 0x02, ///< enable the 'Default' button ("\0" is returned)
22 QSF_LEN_IN_CHARS
= 0x04, ///< the length of the string is counted in characters
25 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags
)
27 /** Callback procedure for the ShowQuery method. */
28 typedef void QueryCallbackProc(Window
*, bool);
30 void ShowQueryString(StringID str
, StringID caption
, uint max_len
, Window
*parent
, CharSetFilter afilter
, QueryStringFlags flags
);
31 void ShowQuery(StringID caption
, StringID message
, Window
*w
, QueryCallbackProc
*callback
, bool focus
= false);
33 /** The number of 'characters' on the on-screen keyboard. */
34 static const uint OSK_KEYBOARD_ENTRIES
= 50;
37 * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these
38 * have to be UTF-8 encoded, which means up to 4 bytes per character.
40 extern std::string _keyboard_opt
[2];
42 #endif /* TEXTBUF_GUI_H */