1/*
2 * Copyright 2001-2008, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 * DarkWyrm <bpmagic@columbus.rr.com>
7 * Axel Dörfler, axeld@pinc-software.de
8 */
9#ifndef FONT_FAMILY_H_
10#define FONT_FAMILY_H_
11
12
13#include <ObjectList.h>
14#include <String.h>
15
16#include "FontStyle.h"
17
18
19/*!
20 \class FontFamily FontFamily.h
21 \brief Class representing a collection of similar styles
22
23 FontFamily objects bring together many styles of the same face, such as
24 Arial Roman, Arial Italic, Arial Bold, etc.
25*/
26class FontFamily {
27public:
28 FontFamily(const char* name, uint16 id);
29 virtual ~FontFamily();
30
31 const char* Name() const;
32
33 bool AddStyle(FontStyle* style);
34 bool RemoveStyle(FontStyle* style);
35
36 FontStyle* GetStyle(const char* style) const;
37 FontStyle* GetStyleMatchingFace(uint16 face) const;
38 FontStyle* GetStyleByID(uint16 face) const;
39
40 uint16 ID() const
41 { return fID; }
42 uint32 Flags();
43
44 bool HasStyle(const char* style) const;
45 int32 CountStyles() const;
46 FontStyle* StyleAt(int32 index) const;
47
48private:
49 FontStyle* _FindStyle(const char* name) const;
50
51 BString fName;
52 BObjectList<FontStyle> fStyles;
53 uint16 fID;
54 uint16 fNextID;
55 uint32 fFlags;
56};
57
58#endif // FONT_FAMILY_H_