# textfile_gui.h

Go to the documentation of this file.

    00001 /* $Id: textfile_gui.h 25339 2013-06-09 09:33:06Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef TEXTFILE_GUI_H
    00013 #define TEXTFILE_GUI_H
    00014
    00015 #include "fileio_type.h"
    00016 #include "strings_func.h"
    00017 #include "textfile_type.h"
    00018 #include "window_gui.h"
    00019
    00020 const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filename);
    00021
    00023 struct TextfileWindow : public Window, MissingGlyphSearcher {
    00024   TextfileType file_type;
    00025   int line_height;
    00026   Scrollbar *vscroll;
    00027   Scrollbar *hscroll;
    00028   char *text;
    00029   SmallVector<const char *, 64> lines;
    00030   uint max_length;
    00031   uint search_iterator;
    00032
    00033   static const int TOP_SPACING    = WD_FRAMETEXT_TOP;
    00034   static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM;
    00035
    00036   TextfileWindow(TextfileType file_type);
    00037   virtual ~TextfileWindow();
    00038   virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize);
    00039   virtual void DrawWidget(const Rect &r, int widget) const;
    00040   virtual void OnResize();
    00041   virtual void Reset();
    00042   virtual FontSize DefaultSize();
    00043   virtual const char *NextString();
    00044   virtual bool Monospace();
    00045   virtual void SetFontNames(FreeTypeSettings *settings, const char *font_name);
    00046   virtual void LoadTextfile(const char *textfile, Subdirectory dir);
    00047 };
    00048
    00049 #endif /* TEXTFILE_GUI_H */