2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2007-12-19 20:45:46 +00:00
|
|
|
/** @file textbuf_gui.h Stuff related to the text buffer GUI. */
|
|
|
|
|
|
|
|
#ifndef TEXTBUF_GUI_H
|
|
|
|
#define TEXTBUF_GUI_H
|
|
|
|
|
|
|
|
#include "window_type.h"
|
2008-01-07 14:23:25 +00:00
|
|
|
#include "string_type.h"
|
2008-03-26 10:08:17 +00:00
|
|
|
#include "strings_type.h"
|
2007-12-19 20:45:46 +00:00
|
|
|
|
2008-09-15 16:29:40 +00:00
|
|
|
/** Flags used in ShowQueryString() call */
|
|
|
|
enum QueryStringFlags {
|
2008-09-15 19:02:50 +00:00
|
|
|
QSF_NONE = 0,
|
2008-09-15 16:29:40 +00:00
|
|
|
QSF_ACCEPT_UNCHANGED = 0x01, ///< return success even when the text didn't change
|
2008-09-15 19:02:50 +00:00
|
|
|
QSF_ENABLE_DEFAULT = 0x02, ///< enable the 'Default' button ("\0" is returned)
|
2010-12-05 22:22:54 +00:00
|
|
|
QSF_LEN_IN_CHARS = 0x04, ///< the length of the string is counted in characters
|
2019-01-12 21:27:19 +00:00
|
|
|
QSF_PASSWORD = 0x08, ///< password entry box, show warning about password security
|
2008-09-15 16:29:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
|
|
|
|
|
2011-05-01 19:14:12 +00:00
|
|
|
/** Callback procedure for the ShowQuery method. */
|
2008-05-19 19:17:56 +00:00
|
|
|
typedef void QueryCallbackProc(Window*, bool);
|
|
|
|
|
2011-04-17 18:42:17 +00:00
|
|
|
void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
|
2008-05-19 19:17:56 +00:00
|
|
|
void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
|
2007-12-19 20:45:46 +00:00
|
|
|
|
2008-03-26 10:08:17 +00:00
|
|
|
/** The number of 'characters' on the on-screen keyboard. */
|
|
|
|
static const uint OSK_KEYBOARD_ENTRIES = 50;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these
|
|
|
|
* have to be UTF-8 encoded, which means up to 4 bytes per character.
|
|
|
|
*/
|
2021-04-28 15:32:33 +00:00
|
|
|
extern std::string _keyboard_opt[2];
|
2008-03-26 10:08:17 +00:00
|
|
|
|
2007-12-19 20:45:46 +00:00
|
|
|
#endif /* TEXTBUF_GUI_H */
|