1 #ifndef __SP_ITEM_FLOWTEXT_H__
2 #define __SP_ITEM_FLOWTEXT_H__
4 /*
5 */
7 #include "sp-item.h"
9 #include "display/nr-arena-forward.h"
11 #include "libnrtype/Layout-TNG.h"
13 #define SP_TYPE_FLOWTEXT (sp_flowtext_get_type ())
14 #define SP_FLOWTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_FLOWTEXT, SPFlowtext))
15 #define SP_FLOWTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_FLOWTEXT, SPFlowtextClass))
16 #define SP_IS_FLOWTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_FLOWTEXT))
17 #define SP_IS_FLOWTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_FLOWTEXT))
19 struct SPFlowtext : public SPItem {
20 /** Completely recalculates the layout. */
21 void rebuildLayout();
23 /** Converts the current selection (which must be a flowroot) into
24 a \<text\> tree, keeping all the formatting and positioning, but losing
25 the automatic wrapping ability. */
26 static void convert_to_text();
28 SPItem *get_frame(SPItem *after);
30 bool has_internal_frame();
32 //semiprivate: (need to be accessed by the C-style functions still)
33 Inkscape::Text::Layout layout;
35 /** discards the NRArena objects representing this text. */
36 void _clearFlow(NRArenaGroup* in_arena);
38 double par_indent;
40 private:
41 /** Recursively walks the xml tree adding tags and their contents. */
42 void _buildLayoutInput(SPObject *root, Shape const *exclusion_shape, std::list<Shape> *shapes, SPObject **pending_line_break_object);
44 /** calculates the union of all the \<flowregionexclude\> children
45 of this flowroot. */
46 Shape* _buildExclusionShape() const;
48 };
50 struct SPFlowtextClass {
51 SPItemClass parent_class;
52 };
54 GType sp_flowtext_get_type (void);
56 SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, NR::Point p1, NR::Point p2);
58 #endif