1 #ifndef GLYPHRUN_H
2 #define GLYPHRUN_H
3 
4 #include <QList>
5 
6 #include "scribusapi.h"
7 #include "sctextstruct.h"
8 
9 class SCRIBUS_API GlyphCluster
10 {
11 public:
12 	GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int visualIdx, const QString& str);
13 
14 	void append(GlyphLayout&);
15 
16 	const CharStyle& style()  const;
17 	bool hasFlag(LayoutFlags f) const ;
18 	void setFlag(LayoutFlags f);
19 	void clearFlag(LayoutFlags f);
20 
21 	QList<GlyphLayout>& glyphs();
22 	const QList<GlyphLayout>& glyphs() const;
23 	const InlineFrame& object() const;
24 
25 	int firstChar() const;
26 	int lastChar() const;
27 	int visualIndex() const;
28 
29 	double width() const;
30 
31 	double ascent() const;
32 	double descent() const;
33 
34 	double scaleH() const;
35 	double scaleV() const;
36 	void setScaleH(double);
37 	void setScaleV(double);
38 
39 	bool isEmpty() const;
40 	bool isControlGlyphs() const;
41 	bool isSpace() const;
42 	QVector<FPointArray> glyphClusterOutline() const;
43 	// get text out
44 	QString getText() const;
45 
46 	double extraWidth;
47 	double xoffset;
48 	double yoffset;
49 private:
50 	const CharStyle* m_style;
51 	LayoutFlags m_flags;
52 	QList<GlyphLayout> m_glyphs;
53 	InlineFrame m_object;
54 	int m_firstChar;
55 	int m_lastChar;
56 	int m_visualIndex;
57 	double m_scaleH;
58 	double m_scaleV;
59 	QString m_str;
60 };
61 
62 #endif // GLYPHRUN_H
63