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"
10 #include <2geom/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 flowroot in into a \<text\> tree, keeping all the formatting and positioning,
24 but losing the automatic wrapping ability. */
25 Inkscape::XML::Node *getAsText();
27 SPItem *get_frame(SPItem *after);
29 bool has_internal_frame();
31 //semiprivate: (need to be accessed by the C-style functions still)
32 Inkscape::Text::Layout layout;
34 /** discards the NRArena objects representing this text. */
35 void _clearFlow(NRArenaGroup* in_arena);
37 double par_indent;
39 private:
40 /** Recursively walks the xml tree adding tags and their contents. */
41 void _buildLayoutInput(SPObject *root, Shape const *exclusion_shape, std::list<Shape> *shapes, SPObject **pending_line_break_object);
43 /** calculates the union of all the \<flowregionexclude\> children
44 of this flowroot. */
45 Shape* _buildExclusionShape() const;
47 };
49 struct SPFlowtextClass {
50 SPItemClass parent_class;
51 };
53 GType sp_flowtext_get_type (void);
55 SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p1, Geom::Point p2);
57 #endif
59 /*
60 Local Variables:
61 mode:c++
62 c-file-style:"stroustrup"
63 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64 indent-tabs-mode:nil
65 fill-column:99
66 End:
67 */
68 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :