ScummVM API documentation
bubble_box.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 ACCESS_BUBBLE_BOX_H
23 #define ACCESS_BUBBLE_BOX_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/rect.h"
28 #include "common/str-array.h"
29 #include "common/stream.h"
30 #include "common/types.h"
31 #include "graphics/surface.h"
32 #include "access/data.h"
33 
34 namespace Access {
35 
36 class AccessEngine;
37 
38 enum BoxType { TYPE_0 = 0, TYPE_1 = 1, TYPE_2 = 2, TYPE_3 = 3, kBoxTypeFileDialog = 4 };
39 
40 class BubbleBox : public Manager {
41 private:
42  int _startItem, _startBox;
43  int _charCol, _rowOff;
44  Common::Point _fileStart;
45  Common::Point _fileOff;
46  int _boxStartX, _boxStartY;
47  int _boxEndX, _boxEndY;
48  int _bIconStartX, _bIconStartY;
49  int _boxPStartX, _boxPStartY;
50 
51  void displayBoxData();
52  void drawSelectBox();
56  void printBubble_v1(const Common::String &msg);
57  void printBubble_v2(const Common::String &msg);
58 
59 public:
60  BoxType _type;
61  Common::Rect _bounds;
62  Common::StringArray _nameIndex;
63  Common::String _bubbleTitle;
64  Common::String _bubbleDisplStr;
65  Common::String _tempList[60];
66  int _tempListIdx[60];
67  int _btnId1;
68  int _btnX1;
69  int _btnId2;
70  int _btnX2;
71  int _btnId3;
72  int _btnX3;
73  Common::Rect _btnUpPos;
74  Common::Rect _btnDownPos;
76 public:
77  BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, Common::String title);
78 
79  void load(Common::SeekableReadStream *stream);
80 
81  void clearBubbles();
82 
83  void placeBubble(const Common::String &msg);
84  void placeBubble1(const Common::String &msg);
85 
89  void calcBubble(const Common::String &msg);
90 
94  void printBubble(const Common::String &msg);
95 
96  /*
97  * Draws the background for a text bubble
98  * @param index Index of bounds in _bubbles array
99  */
100  void drawBubble(int index);
101 
102  void doBox(int item, int box);
103 
104  int doBox_v1(int item, int box, int &btnSelected);
105  void getList(const char *const data[], int *flags);
106  void setCursorPos(int posX, int posY);
107  void printString(Common::String msg);
108 };
109 
110 } // End of namespace Access
111 
112 #endif /* ACCESS_BUBBLE_BOX_H */
Definition: str.h:59
Definition: data.h:37
Definition: access.h:84
Definition: rect.h:144
Definition: stream.h:745
void printBubble(const Common::String &msg)
Definition: rect.h:45
Definition: access.h:62
void calcBubble(const Common::String &msg)
Definition: bubble_box.h:40