vfs: check userland buffers before reading them.
[haiku.git] / src / servers / app / font / FontFamily.h
blobbb72641977e3974457ff93f8edcaebdf1d3d92de
1 /*
2 * Copyright 2001-2008, Haiku.
3 * Distributed under the terms of the MIT License.
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_
13 #include <ObjectList.h>
14 #include <String.h>
16 #include "FontStyle.h"
19 /*!
20 \class FontFamily FontFamily.h
21 \brief Class representing a collection of similar styles
23 FontFamily objects bring together many styles of the same face, such as
24 Arial Roman, Arial Italic, Arial Bold, etc.
26 class FontFamily {
27 public:
28 FontFamily(const char* name, uint16 id);
29 virtual ~FontFamily();
31 const char* Name() const;
33 bool AddStyle(FontStyle* style);
34 bool RemoveStyle(FontStyle* style);
36 FontStyle* GetStyle(const char* style) const;
37 FontStyle* GetStyleMatchingFace(uint16 face) const;
38 FontStyle* GetStyleByID(uint16 face) const;
40 uint16 ID() const
41 { return fID; }
42 uint32 Flags();
44 bool HasStyle(const char* style) const;
45 int32 CountStyles() const;
46 FontStyle* StyleAt(int32 index) const;
48 private:
49 FontStyle* _FindStyle(const char* name) const;
51 BString fName;
52 BObjectList<FontStyle> fStyles;
53 uint16 fID;
54 uint16 fNextID;
55 uint32 fFlags;
58 #endif // FONT_FAMILY_H_