ScummVM API documentation
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_JOURNAL_H
23 #define SHERLOCK_JOURNAL_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 "sherlock/saveload.h"
31 
32 namespace Sherlock {
33 
34 #define LINES_PER_PAGE (IS_SERRATED_SCALPEL ? 11 : 17)
35 #define JOURNAL_MAX_WIDTH (IS_SERRATED_SCALPEL ? 230 : 422)
36 #define JOURNAL_MAX_CHARS 80
37 
38 class SherlockEngine;
39 
40 struct JournalEntry {
41  int _converseNum;
42  bool _replyOnly;
43  int _statementNum;
44 
45  JournalEntry() : _converseNum(0), _replyOnly(false), _statementNum(0) {}
46  JournalEntry(int converseNum, int statementNum, bool replyOnly = false) :
47  _converseNum(converseNum), _statementNum(statementNum), _replyOnly(replyOnly) {}
48 };
49 
50 class Journal {
51 protected:
52  SherlockEngine *_vm;
53  Common::StringArray _directory;
54  Common::StringArray _locations;
56  Common::StringArray _lines;
57  bool _up, _down;
58  int _index;
59  int _page;
60  int _maxPage;
61  int _sub;
62  Common::String _find;
63 
65 
72  void loadJournalFile(bool alreadyLoaded);
73 
77  bool isPrintable(byte ch) const;
78 public:
79  static Journal *init(SherlockEngine *vm);
80  virtual ~Journal() {}
81 
85  bool drawJournal(int direction, int howFar);
86 
90  void synchronize(Serializer &s);
91 public:
95  virtual void drawFrame() = 0;
96 
100  virtual void resetPosition() {}
101 
106  virtual void record(int converseNum, int statementNum, bool replyOnly = false);
107 };
108 
109 } // End of namespace Sherlock
110 
111 #endif
Definition: str.h:59
Definition: animation.h:29
Definition: journal.h:40
Definition: serializer.h:79
Definition: sherlock.h:76
Definition: journal.h:50
virtual void resetPosition()
Definition: journal.h:100