ScummVM API documentation
textbox.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NANCY_UI_TEXTBOX_H
23 #define NANCY_UI_TEXTBOX_H
24 
25 #include "engines/nancy/misc/hypertext.h"
26 #include "engines/nancy/renderobject.h"
27 
28 namespace Nancy {
29 
30 class NancyEngine;
31 class Scene;
32 struct NancyInput;
33 
34 namespace UI {
35 
36 class Scrollbar;
37 class ScrollTextBox;
38 
39 class Textbox : public RenderObject, public Misc::HypertextParser {
40 public:
41  Textbox();
42  virtual ~Textbox();
43 
44  void init() override;
45  void registerGraphics() override;
46  void updateGraphics() override;
47  void handleInput(NancyInput &input);
48 
49  void drawTextbox();
50  void clear() override;
51 
52  bool hasBeenDrawn() const;
53 
54  void addTextLine(const Common::String &text, uint32 autoClearTime = 0);
55  void setOverrideFont(const uint fontID);
56 
57  // Nancy 10 only: picks the full, taskbar-covering box (AR 74) over the strip
58  // (AR 75). No effect on Nancy 1-9 (no such mode) or Nancy 11+ (a single box).
59  void setFullMode(bool open);
60  // True while the text box visually covers the taskbar buttons, so Scene can
61  // skip taskbar input. Always false before Nancy 10, whose box sits clear of them.
62  bool coversTaskbar() const;
63 
64 private:
65  uint16 getInnerHeight() const;
66  void onScrollbarMove();
67 
68  RenderObject _highlightRObj;
69  Scrollbar *_scrollbar;
70 
71  // Nancy 10+ overlay popup the public API forwards to (UICO/SCTB-driven).
72  // The legacy members above are unused in that mode.
73  ScrollTextBox *_scrollTextBox;
74 
75  float _scrollbarPos;
76 
77  uint32 _autoClearTime;
78  int _fontIDOverride;
79 };
80 
81 } // End of namespace UI
82 } // End of namespace Nancy
83 
84 #endif // NANCY_UI_TEXTBOX_H
Definition: scrolltextbox.h:43
Definition: str.h:59
Definition: scrollbar.h:45
Definition: textbox.h:39
Definition: input.h:41
Definition: soundequalizerpuzzle.h:27
Definition: hypertext.h:32
Definition: renderobject.h:36
Definition: actionmanager.h:32