ScummVM API documentation
scalpel_journal.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 SHERLOCK_SCALPEL_JOURNAL_H
23 #define SHERLOCK_SCALPEL_JOURNAL_H
24 
25 #include "sherlock/journal.h"
26 #include "sherlock/saveload.h"
27 #include "common/scummsys.h"
28 #include "common/array.h"
29 #include "common/rect.h"
30 #include "common/str-array.h"
31 #include "common/stream.h"
32 
33 namespace Sherlock {
34 
35 namespace Scalpel {
36 
37 enum JournalButton {
38  BTN_NONE, BTN_EXIT, BTN_BACK10, BTN_UP, BTN_DOWN, BTN_AHEAD110, BTN_SEARCH,
39  BTN_FIRST_PAGE, BTN_LAST_PAGE, BTN_PRINT_TEXT, BTN_BACKWARD, BTN_FORWARD
40 };
41 
42 class ScalpelJournal: public Journal {
43 public:
44  Common::String _fixedTextWatsonsJournal;
45  Common::String _fixedTextExit;
46  Common::String _fixedTextBack10;
47  Common::String _fixedTextUp;
48  Common::String _fixedTextDown;
49  Common::String _fixedTextAhead10;
50  Common::String _fixedTextSearch;
51  Common::String _fixedTextFirstPage;
52  Common::String _fixedTextLastPage;
53  Common::String _fixedTextPrintText;
54 
55  byte _hotkeyExit;
56  byte _hotkeyBack10;
57  byte _hotkeyUp;
58  byte _hotkeyDown;
59  byte _hotkeyAhead10;
60  byte _hotkeySearch;
61  byte _hotkeyFirstPage;
62  byte _hotkeyLastPage;
63  byte _hotkeyPrintText;
64 
65  Common::String _fixedTextSearchExit;
66  Common::String _fixedTextSearchBackward;
67  Common::String _fixedTextSearchForward;
68  Common::String _fixedTextSearchNotFound;
69 
70  byte _hotkeySearchExit;
71  byte _hotkeySearchBackward;
72  byte _hotkeySearchForward;
73 
74 private:
78  void loadLocations();
79 
83  void doArrows();
84 
88  int getSearchString(bool printError);
89 
93  JournalButton getHighlightedButton(const Common::Point &pt);
94 
95  Common::Rect getSearchButtonRect(int idx);
96  Common::Point getSearchButtonTextPoint(int idx);
97 public:
99  ~ScalpelJournal() override {}
100 
104  void drawInterface();
105 
109  bool handleEvents(int key);
110 public:
114  void drawFrame() override;
115 
119  void resetPosition() override;
120 
125  void record(int converseNum, int statementNum, bool replyOnly = false) override;
126 
127  Common::Rect getButtonRect(JournalButton btn);
128  Common::Point getButtonTextPoint(JournalButton btn);
129 };
130 
131 } // End of namespace Scalpel
132 
133 } // End of namespace Sherlock
134 
135 #endif
Definition: str.h:59
void record(int converseNum, int statementNum, bool replyOnly=false) override
Definition: animation.h:29
Definition: rect.h:144
Definition: sherlock.h:76
Definition: rect.h:45
Definition: scalpel_journal.h:42
Definition: journal.h:50