ScummVM API documentation
text_translation.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 HOLLYWOOD_TEXT_TRANSLATION_H
23#define HOLLYWOOD_TEXT_TRANSLATION_H
24
25#include "common/array.h"
26#include "common/hash-str.h"
27#include "common/path.h"
28#include "common/ptr.h"
29#include "common/ustr.h"
30
31namespace Common {
32class Archive;
33class TranslationManager;
34}
35
36namespace Hollywood {
37
38class ImageTranslationArchive;
39
41public:
42 struct Language {
43 Common::String code;
44 Common::String name;
45 };
46
49
50 bool load(const Common::Path &fileName, const Common::Path &originalArchive);
51 bool setLanguage(const Common::String &language);
52 const Common::String &language() const { return _language; }
53 const Common::Array<Language> &languages() const { return _languages; }
54 void applyRows(const Common::String &section, Common::Array<byte> &rows,
55 uint rowSize, uint firstRow, uint firstRecord) const;
56 const char *interfaceText(const Common::String &key, const char *fallback) const;
57
58private:
59 const Common::String *findText(const Common::String &key) const;
60 bool decodeText(const Common::U32String &value, Common::String &text) const;
61
62#ifdef USE_TRANSLATION
66#endif
67 Common::String _language;
68 Common::Array<Language> _languages;
69 mutable Common::StringMap _text;
70 bool _loaded;
71};
72
73} // End of namespace Hollywood
74
75#endif // HOLLYWOOD_TEXT_TRANSLATION_H
Definition: array.h:52
Definition: path.h:52
Definition: str.h:59
Definition: ustr.h:57
Definition: text_translation.h:40
Definition: algorithm.h:29
Definition: text_translation.h:42