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
23 QSF_PASSWORD
= 0x08, ///< password entry box, show warning about password security
26 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags
)
28 /** Callback procedure for the ShowQuery method. */
29 typedef void QueryCallbackProc(Window
*, bool);
31 void ShowQueryString(StringID str
, StringID caption
, uint max_len
, Window
*parent
, CharSetFilter afilter
, QueryStringFlags flags
);
32 void ShowQuery(StringID caption
, StringID message
, Window
*w
, QueryCallbackProc
*callback
);
34 /** The number of 'characters' on the on-screen keyboard. */
35 static const uint OSK_KEYBOARD_ENTRIES
= 50;
38 * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these
39 * have to be UTF-8 encoded, which means up to 4 bytes per character.
41 extern std::string _keyboard_opt
[2];
43 #endif /* TEXTBUF_GUI_H */