1 | /* "a -*- 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) 2002, Ximian Inc. |
---|
5 | |
---|
6 | This library is free software; you can redistribute it and/or |
---|
7 | modify it under the terms of the GNU Library General Public |
---|
8 | License as published by the Free Software Foundation; either |
---|
9 | version 2 of the License, or (at your option) any later version. |
---|
10 | |
---|
11 | This library is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | Library General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU Library General Public License |
---|
17 | along with this library; see the file COPYING.LIB. If not, write to |
---|
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | Boston, MA 02111-1307, USA. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef __HTML_STYLE_H__ |
---|
23 | #define __HTML_STYLE_H__ |
---|
24 | #include "gtkhtml-enums.h" |
---|
25 | #include "htmltypes.h" |
---|
26 | #include "htmlcolor.h" |
---|
27 | |
---|
28 | typedef enum { |
---|
29 | DISPLAY_NONE, |
---|
30 | DISPLAY_INLINE, |
---|
31 | DISPLAY_LIST_ITEM, |
---|
32 | DISPLAY_INLINE_BLOCK, |
---|
33 | DISPLAY_BLOCK, |
---|
34 | DISPLAY_MARKER, |
---|
35 | DISPLAY_RUN_IN, |
---|
36 | DISPLAY_COMPACT, |
---|
37 | DISPLAY_TABLE_ROW_GROUP, |
---|
38 | DISPLAY_TABLE_COLUMN, |
---|
39 | DISPLAY_TABLE_COLUMN_GROUP, |
---|
40 | DISPLAY_TABLE_HEADER_GROUP, |
---|
41 | DISPLAY_TABLE_FOOTER_GROUP, |
---|
42 | DISPLAY_TABLE_ROW, |
---|
43 | DISPLAY_TABLE_CELL, |
---|
44 | DISPLAY_TABLE_CAPTION, |
---|
45 | DISPLAY_INLINE_TABLE, |
---|
46 | DISPLAY_TABLE, |
---|
47 | DISPLAY_DOCUMENT |
---|
48 | } HTMLDisplayType; |
---|
49 | |
---|
50 | typedef enum { |
---|
51 | HTML_WHITE_SPACE_NORMAL, |
---|
52 | HTML_WHITE_SPACE_PRE, |
---|
53 | HTML_WHITE_SPACE_NOWRAP, |
---|
54 | HTML_WHITE_SPACE_PRE_WRAP, |
---|
55 | HTML_WHITE_SPACE_PRE_LINE, |
---|
56 | HTML_WHITE_SPACE_INHERIT |
---|
57 | } HTMLWhiteSpaceType; |
---|
58 | |
---|
59 | typedef enum { |
---|
60 | HTML_LENGTH_TYPE_PIXELS, |
---|
61 | HTML_LENGTH_TYPE_PERCENT, |
---|
62 | HTML_LENGTH_TYPE_FRACTION |
---|
63 | } HTMLLengthType; |
---|
64 | |
---|
65 | typedef struct _HTMLLength HTMLLength; |
---|
66 | struct _HTMLLength { |
---|
67 | gint val; |
---|
68 | HTMLLengthType type; |
---|
69 | }; |
---|
70 | |
---|
71 | typedef struct _HTMLStyle HTMLStyle; |
---|
72 | struct _HTMLStyle { |
---|
73 | HTMLColor *color; |
---|
74 | HTMLFontFace *face; |
---|
75 | GtkHTMLFontStyle settings; |
---|
76 | GtkHTMLFontStyle mask; |
---|
77 | |
---|
78 | /* Block Level */ |
---|
79 | HTMLHAlignType text_align; |
---|
80 | HTMLClearType clear; |
---|
81 | |
---|
82 | /* Cell Level */ |
---|
83 | HTMLVAlignType text_valign; |
---|
84 | |
---|
85 | /* box settings */ |
---|
86 | HTMLLength *width; |
---|
87 | HTMLLength *height; |
---|
88 | |
---|
89 | char *bg_image; |
---|
90 | HTMLColor *bg_color; |
---|
91 | HTMLDisplayType display; |
---|
92 | }; |
---|
93 | |
---|
94 | HTMLStyle *html_style_new (void); |
---|
95 | HTMLStyle *html_style_unset_decoration (HTMLStyle *style, GtkHTMLFontStyle decoration); |
---|
96 | HTMLStyle *html_style_set_decoration (HTMLStyle *style, GtkHTMLFontStyle decoration); |
---|
97 | HTMLStyle *html_style_set_font_size (HTMLStyle *style, GtkHTMLFontStyle decoration); |
---|
98 | HTMLStyle *html_style_set_size (HTMLStyle *style, GtkHTMLFontStyle size); |
---|
99 | HTMLStyle *html_style_set_display (HTMLStyle *style, HTMLDisplayType display); |
---|
100 | HTMLStyle *html_style_set_clear (HTMLStyle *style, HTMLClearType clear); |
---|
101 | HTMLStyle *html_style_add_text_align (HTMLStyle *style, HTMLHAlignType type); |
---|
102 | HTMLStyle *html_style_add_text_valign (HTMLStyle *style, HTMLVAlignType type); |
---|
103 | HTMLStyle *html_style_add_font_face (HTMLStyle *style, const HTMLFontFace *face); |
---|
104 | HTMLStyle *html_style_add_color (HTMLStyle *style, HTMLColor *face); |
---|
105 | HTMLStyle *html_style_add_attribute (HTMLStyle *style, const char *attr); |
---|
106 | HTMLStyle *html_style_add_background_image (HTMLStyle *style, const char *url); |
---|
107 | HTMLStyle *html_style_add_background_color (HTMLStyle *style, HTMLColor *color); |
---|
108 | HTMLStyle *html_style_add_width (HTMLStyle *style, char *width); |
---|
109 | HTMLStyle *html_style_add_height (HTMLStyle *style, char *height); |
---|
110 | void html_style_free (HTMLStyle *style); |
---|
111 | |
---|
112 | gboolean html_parse_color (const gchar *text, GdkColor *color); |
---|
113 | |
---|
114 | #endif /* __HTML_COLOR_H__ */ |
---|