ScummVM API documentation
qd_font_info.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 QDENGINE_QDCORE_QD_FONT_INFO_H
23 #define QDENGINE_QDCORE_QD_FONT_INFO_H
24 
25 #include "qdengine/parser/xml_fwd.h"
26 #include "qdengine/parser/xml_tag.h"
27 #include "qdengine/parser/xml_tag_buffer.h"
28 #include "qdengine/parser/qdscr_parser.h"
29 #include "qdengine/system/graphics/gr_font.h"
30 #include "qdengine/qdcore/qd_named_object.h"
31 #include "qdengine/qdcore/qd_object_list_container.h"
32 
33 namespace QDEngine {
34 
36 class qdFontInfo : public qdNamedObject {
37 public:
38  qdFontInfo() : _type(0), _font(NULL) {}
39  explicit qdFontInfo(int tp) : _type(tp), _font(NULL) {}
40  // Копирующий конструктор
41  qdFontInfo(const qdFontInfo &fi);
42  ~qdFontInfo();
43 
44  int named_object_type() const {
45  return QD_NAMED_OBJECT_FONT_INFO;
46  }
47 
48  bool operator == (const qdFontInfo &fi) const {
49  return (fi.type() == _type) && (fi._font_file_name == _font_file_name);
50  }
51  bool operator == (int t) const {
52  return (t == _type);
53  }
54  qdFontInfo &operator = (const qdFontInfo &fi);
55 
56  int type() const {
57  return _type;
58  }
59  void set_type(int tp) {
60  _type = tp;
61  }
62 
63  void set_font_file_name(const Common::Path fname) {
64  _font_file_name = fname;
65  }
66  const Common::Path font_file_name() const {
67  return _font_file_name;
68  }
69 
70  const grFont *font() const {
71  return _font;
72  }
73 
74  bool load_script(const xml::tag *p);
75  bool save_script(Common::WriteStream &fh, int indent = 0) const;
76 
79  bool load_font();
80 
81 private:
82 
84  int _type;
86  Common::Path _font_file_name;
88  grFont *_font;
89 };
90 
92 
93 
94 } // namespace QDEngine
95 
96 #endif // QDENGINE_QDCORE_QD_FONT_INFO_H
Definition: stream.h:77
Поименованный объект.
Definition: qd_named_object.h:70
Definition: list.h:39
Definition: path.h:52
XML тег.
Definition: xml_tag.h:33
Базовый класс для игровых ресурсов.
Definition: console.h:28
Шрифт
Definition: qd_font_info.h:36
int named_object_type() const
Возвращает тип объекта.
Definition: qd_font_info.h:44
Definition: gr_font.h:34