1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* This file is part of the GtkHTML library. |
---|
3 | |
---|
4 | Copyright (C) 1997 Martin Jones (mjones@kde.org) |
---|
5 | Copyright (C) 1997 Torben Weis (weis@kde.org) |
---|
6 | Copyright (C) 1999, 2000 Helix Code, Inc. |
---|
7 | |
---|
8 | This library is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU Library General Public |
---|
10 | License as published by the Free Software Foundation; either |
---|
11 | version 2 of the License, or (at your option) any later version. |
---|
12 | |
---|
13 | This library is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | Library General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU Library General Public License |
---|
19 | along with this library; see the file COPYING.LIB. If not, write to |
---|
20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _HTMLCLUEFLOW_H_ |
---|
25 | #define _HTMLCLUEFLOW_H_ |
---|
26 | |
---|
27 | #include "htmltypes.h" |
---|
28 | #include "htmlclue.h" |
---|
29 | |
---|
30 | #define HTML_CLUEFLOW(x) ((HTMLClueFlow *)(x)) |
---|
31 | #define HTML_CLUEFLOW_CLASS(x) ((HTMLClueFlowClass *)(x)) |
---|
32 | #define HTML_IS_CLUEFLOW(x) (HTML_CHECK_TYPE ((x), HTML_TYPE_CLUEFLOW)) |
---|
33 | |
---|
34 | struct _HTMLClueFlow { |
---|
35 | HTMLClue clue; |
---|
36 | |
---|
37 | HTMLClearType clear; |
---|
38 | |
---|
39 | /* Paragraph style. */ |
---|
40 | HTMLClueFlowStyle style; |
---|
41 | |
---|
42 | /* Indentation level for blockquote and lists. */ |
---|
43 | GByteArray *levels; |
---|
44 | |
---|
45 | /* list item attributes - this will be ideally moved to list item type |
---|
46 | based on HTMLClueFlow once we have real types */ |
---|
47 | HTMLListType item_type; |
---|
48 | gint item_number; |
---|
49 | HTMLColor *item_color; |
---|
50 | }; |
---|
51 | |
---|
52 | struct _HTMLClueFlowClass { |
---|
53 | HTMLClueClass clue_class; |
---|
54 | |
---|
55 | GtkHTMLFontStyle (* get_default_font_style) (const HTMLClueFlow *self); |
---|
56 | }; |
---|
57 | |
---|
58 | |
---|
59 | extern HTMLClueFlowClass html_clueflow_class; |
---|
60 | |
---|
61 | |
---|
62 | void html_clueflow_type_init (void); |
---|
63 | void html_clueflow_class_init (HTMLClueFlowClass *klass, |
---|
64 | HTMLType type, |
---|
65 | guint object_size); |
---|
66 | void html_clueflow_init (HTMLClueFlow *flow, |
---|
67 | HTMLClueFlowClass *klass, |
---|
68 | HTMLClueFlowStyle style, |
---|
69 | GByteArray *levels, |
---|
70 | HTMLListType item_type, |
---|
71 | gint item_number, |
---|
72 | HTMLClearType clear); |
---|
73 | HTMLObject *html_clueflow_new (HTMLClueFlowStyle style, |
---|
74 | GByteArray *leves, |
---|
75 | HTMLListType item_type, |
---|
76 | gint item_number, |
---|
77 | HTMLClearType clear); |
---|
78 | HTMLObject *html_clueflow_new_from_flow (HTMLClueFlow *flow); |
---|
79 | GtkHTMLFontStyle html_clueflow_get_default_font_style (const HTMLClueFlow *self); |
---|
80 | HTMLClueFlow *html_clueflow_split (HTMLClueFlow *clue, |
---|
81 | HTMLObject *child); |
---|
82 | void html_clueflow_set_style (HTMLClueFlow *flow, |
---|
83 | HTMLEngine *engine, |
---|
84 | HTMLClueFlowStyle style); |
---|
85 | HTMLClueFlowStyle html_clueflow_get_style (HTMLClueFlow *flow); |
---|
86 | void html_clueflow_set_item_type (HTMLClueFlow *flow, |
---|
87 | HTMLEngine *engine, |
---|
88 | HTMLListType item_type); |
---|
89 | HTMLListType html_clueflow_get_item_type (HTMLClueFlow *flow); |
---|
90 | void html_clueflow_set_halignment (HTMLClueFlow *flow, |
---|
91 | HTMLEngine *engine, |
---|
92 | HTMLHAlignType alignment); |
---|
93 | HTMLHAlignType html_clueflow_get_halignment (HTMLClueFlow *flow); |
---|
94 | void html_clueflow_modify_indentation_by_delta (HTMLClueFlow *flow, |
---|
95 | HTMLEngine *engine, |
---|
96 | gint indentation, |
---|
97 | guint8 *indentation_levels); |
---|
98 | void html_clueflow_set_indentation (HTMLClueFlow *flow, |
---|
99 | HTMLEngine *engine, |
---|
100 | gint indentation, |
---|
101 | guint8 *indentation_levels); |
---|
102 | guint8 html_clueflow_get_indentation (HTMLClueFlow *flow); |
---|
103 | GByteArray * html_clueflow_dup_levels (HTMLClueFlow *flow); |
---|
104 | void html_clueflow_set_levels (HTMLClueFlow *flow, |
---|
105 | HTMLEngine *engine, |
---|
106 | GByteArray *levels); |
---|
107 | #if 0 |
---|
108 | void html_clueflow_set_properties (HTMLClueFlow *flow, |
---|
109 | HTMLEngine *engine, |
---|
110 | HTMLClueFlowStyle style, |
---|
111 | guint8 indentation, |
---|
112 | HTMLHAlignType alignment); |
---|
113 | void html_clueflow_get_properties (HTMLClueFlow *flow, |
---|
114 | HTMLClueFlowStyle *style_return, |
---|
115 | guint8 *indentation_return, |
---|
116 | HTMLHAlignType *alignment_return); |
---|
117 | #endif |
---|
118 | void html_clueflow_spell_check (HTMLClueFlow *flow, |
---|
119 | HTMLEngine *e, |
---|
120 | HTMLInterval *i); |
---|
121 | gboolean html_clueflow_is_empty (HTMLClueFlow *flow); |
---|
122 | gint html_clueflow_get_line_offset (HTMLClueFlow *flow, |
---|
123 | HTMLPainter *painter, |
---|
124 | HTMLObject *child); |
---|
125 | gboolean html_clueflow_tabs (HTMLClueFlow *flow, |
---|
126 | HTMLPainter *p); |
---|
127 | gboolean html_clueflow_style_equals (HTMLClueFlow *cf1, |
---|
128 | HTMLClueFlow *cf2); |
---|
129 | void html_clueflow_set_item_color (HTMLClueFlow *flow, |
---|
130 | HTMLColor *color); |
---|
131 | |
---|
132 | #define SPELL_CHECK(f, e) if (f && HTML_OBJECT_TYPE (f) == HTML_TYPE_CLUEFLOW) \ |
---|
133 | html_clueflow_spell_check (HTML_CLUEFLOW (f), e, NULL) |
---|
134 | |
---|
135 | #endif /* _HTMLCLUEFLOW_H_ */ |
---|