1 /*
2  For general Scribus (>=1.3.2) copyright and licensing information please refer
3  to the COPYING file provided with the program. Following this notice may exist
4  a copyright and/or license notice that predates the release of Scribus 1.3.2
5  for which a new license (GPL+exception) is in place.
6  */
7 
8 #ifndef ITEXTCONTEXT_H
9 #define ITEXTCONTEXT_H
10 
11 #include <QRectF>
12 #include <QString>
13 
14 #include "scribusapi.h"
15 
16 class CharStyle;
17 class ParagraphStyle;
18 struct TypoPrefs;
19 class InlineFrame;
20 class ExpansionPoint;
21 class PageItem;
22 class ScribusDoc;
23 
24 /**
25  * This class collects all information that may be used during text layout:
26  *  - the containing frame's dimensions
27  *  - interpretation of inline objects
28  *  - how to expand expansionpoints like pagenr and marks
29  *  - style settings specific to the document or the containing frame (tyopgraphy, baseline grid, text margins, ...)
30  */
31 class SCRIBUS_API ITextContext {
32 
33 public:
34 	virtual const ScribusDoc* getDoc() const = 0;
35 	virtual const PageItem* getFrame() const = 0;
36 	virtual double height() const = 0;
37 	virtual double width() const = 0;
38 	virtual /* const */ PageItem* object(const InlineFrame& frame) const = 0;
39 	virtual QRectF getVisualBoundingBox(const InlineFrame& frame) const = 0;
40 	virtual const CharStyle& charStyle() const = 0;
41 	virtual const ParagraphStyle& paragraphStyle() const = 0;
42 	virtual QString expand(const ExpansionPoint& expansion) = 0;
43 	virtual const TypoPrefs& typographicPrefs() const = 0;
44 };
45 
46 
47 #endif // ITEXTCONTEXT_H
48