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 TEXTCONTEXT_H 9 #define TEXTCONTEXT_H 10 11 #include "scribusapi.h" 12 #include "itextcontext.h" 13 #include "style.h" 14 #include "styles/charstyle.h" 15 #include "styles/paragraphstyle.h" 16 17 class ExpansionPoint; 18 class InlineFrame; 19 class PageItem; 20 class ScribusDoc; 21 22 class SCRIBUS_API TextContext : public ITextContext { 23 PageItem* m_frame; 24 25 public: TextContext(PageItem * frame)26 TextContext(PageItem* frame) : m_frame(frame) {} 27 28 virtual const ScribusDoc* getDoc() const; getFrame()29 virtual const PageItem* getFrame() const { return m_frame; } 30 31 //virtual double height() const // return getFrame()->height(); } 32 //virtual double width() const {} // return getFrame()->width(); } 33 34 virtual /* const */ PageItem* object(const InlineFrame& frame) const; 35 36 virtual QRectF getVisualBoundingBox(const InlineFrame& frame) const; 37 virtual const CharStyle& charStyle() const; 38 virtual const ParagraphStyle& paragraphStyle() const; 39 virtual QString expand(const ExpansionPoint& expansion); 40 virtual const TypoPrefs& typographicPrefs() const; 41 }; 42 43 44 #endif // TEXTCONTEXT_H 45