summaryrefslogtreecommitdiffstats
path: root/src/sp-flowdiv.h
blob: 2f06cb312a1f1b396be7db1aad89aa9a3016886a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#ifndef __SP_ITEM_FLOWDIV_H__
#define __SP_ITEM_FLOWDIV_H__

/*
 */

#include "sp-object.h"
#include "sp-item.h"

#define SP_TYPE_FLOWDIV            (sp_flowdiv_get_type ())
#define SP_FLOWDIV(obj) ((SPFlowdiv*)obj)
#define SP_IS_FLOWDIV(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowdiv)))

#define SP_TYPE_FLOWTSPAN            (sp_flowtspan_get_type ())
#define SP_FLOWTSPAN(obj) ((SPFlowtspan*)obj)
#define SP_IS_FLOWTSPAN(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowtspan)))

#define SP_TYPE_FLOWPARA            (sp_flowpara_get_type ())
#define SP_FLOWPARA(obj) ((SPFlowpara*)obj)
#define SP_IS_FLOWPARA(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowpara)))

#define SP_TYPE_FLOWLINE            (sp_flowline_get_type ())
#define SP_FLOWLINE(obj) ((SPFlowline*)obj)
#define SP_IS_FLOWLINE(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowline)))

#define SP_TYPE_FLOWREGIONBREAK            (sp_flowregionbreak_get_type ())
#define SP_FLOWREGIONBREAK(obj) ((SPFlowregionbreak*)obj)
#define SP_IS_FLOWREGIONBREAK(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowregionbreak)))

class CFlowdiv;
class CFlowtspan;
class CFlowpara;
class CFlowline;
class CFlowregionbreak;

// these 3 are derivatives of SPItem to get the automatic style handling
class SPFlowdiv : public SPItem {
public:
	CFlowdiv* cflowdiv;
};

class SPFlowtspan : public SPItem {
public:
	CFlowtspan* cflowtspan;
};

class SPFlowpara : public SPItem {
public:
	CFlowpara* cflowpara;
};

// these do not need any style
class SPFlowline : public SPObject {
public:
	CFlowline* cflowline;
};

class SPFlowregionbreak : public SPObject {
public:
	CFlowregionbreak* cflowregionbreak;
};

struct SPFlowdivClass {
	SPItemClass parent_class;
};

struct SPFlowtspanClass {
	SPItemClass parent_class;
};

struct SPFlowparaClass {
	SPItemClass parent_class;
};

struct SPFlowlineClass {
	SPObjectClass parent_class;
};

struct SPFlowregionbreakClass {
	SPObjectClass parent_class;
};


class CFlowdiv : public CItem {
public:
	CFlowdiv(SPFlowdiv* flowdiv);
	virtual ~CFlowdiv();

	virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
	virtual void release();
	virtual void update(SPCtx* ctx, guint flags);
	virtual void modified(unsigned int flags);

	virtual void set(unsigned int key, gchar const* value);
	virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);

protected:
	SPFlowdiv* spflowdiv;
};

class CFlowtspan : public CItem {
public:
	CFlowtspan(SPFlowtspan* flowtspan);
	virtual ~CFlowtspan();

	virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
	virtual void release();
	virtual void update(SPCtx* ctx, guint flags);
	virtual void modified(unsigned int flags);

	virtual void set(unsigned int key, gchar const* value);
	virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);

protected:
	SPFlowtspan* spflowtspan;
};

class CFlowpara : public CItem {
public:
	CFlowpara(SPFlowpara* flowpara);
	virtual ~CFlowpara();

	virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
	virtual void release();
	virtual void update(SPCtx* ctx, guint flags);
	virtual void modified(unsigned int flags);

	virtual void set(unsigned int key, gchar const* value);
	virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);

protected:
	SPFlowpara* spflowpara;
};

class CFlowline : public CObject {
public:
	CFlowline(SPFlowline* flowline);
	virtual ~CFlowline();

	virtual void release();
	virtual void modified(unsigned int flags);

	virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);

protected:
	SPFlowline* spflowline;
};

class CFlowregionbreak : public CObject {
public:
	CFlowregionbreak(SPFlowregionbreak* flowregionbreak);
	virtual ~CFlowregionbreak();

	virtual void release();
	virtual void modified(unsigned int flags);

	virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);

protected:
	SPFlowregionbreak* spflowregionbreak;
};


GType sp_flowdiv_get_type (void);
GType sp_flowtspan_get_type (void);
GType sp_flowpara_get_type (void);
GType sp_flowline_get_type (void);
GType sp_flowregionbreak_get_type (void);

#endif