textbuf_gui.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef TEXTBUF_GUI_H
00013 #define TEXTBUF_GUI_H
00014
00015 #include "window_type.h"
00016 #include "string_type.h"
00017 #include "strings_type.h"
00018 #include "core/enum_type.hpp"
00019
00021 struct Textbuf {
00022 char *buf;
00023 uint16 max_bytes;
00024 uint16 max_chars;
00025 uint16 max_pixels;
00026 uint16 bytes;
00027 uint16 chars;
00028 uint16 pixels;
00029 bool caret;
00030 uint16 caretpos;
00031 uint16 caretxoffs;
00032 };
00033
00034 bool HandleCaret(Textbuf *tb);
00035
00036 void DeleteTextBufferAll(Textbuf *tb);
00037 bool DeleteTextBufferChar(Textbuf *tb, int delmode);
00038 bool InsertTextBufferChar(Textbuf *tb, uint32 key);
00039 bool InsertTextBufferClipboard(Textbuf *tb);
00040 bool MoveTextBufferPos(Textbuf *tb, int navmode);
00041 void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 max_bytes, uint16 max_pixels);
00042 void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 max_bytes, uint16 max_chars, uint16 max_pixels);
00043 void UpdateTextBufferSize(Textbuf *tb);
00044
00046 enum QueryStringFlags {
00047 QSF_NONE = 0,
00048 QSF_ACCEPT_UNCHANGED = 0x01,
00049 QSF_ENABLE_DEFAULT = 0x02,
00050 QSF_LEN_IN_CHARS = 0x04,
00051 };
00052
00053 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
00054
00055
00056 typedef void QueryCallbackProc(Window*, bool);
00057
00058 void ShowQueryString(StringID str, StringID caption, uint max_len, uint max_pixels, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
00059 void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
00060
00062 static const uint OSK_KEYBOARD_ENTRIES = 50;
00063
00069 extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
00070
00071 #endif