1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* This file is part of the KDE libraries
3  *  Copyright (C) 1997 Martin Jones (mjones@kde.org)
4  *            (C) 1997 Torben Weis (weis@kde.org)
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., 51 Franklin Street, Fifth Floor,
19  *  Boston, MA 02110-1301, USA.
20 */
21 #ifndef HTMLCLUE_H
22 #define HTMLCLUE_H
23 
24 #include "htmlobject.h"
25 
26 #define HTML_CLUE(x) ((HTMLClue *)(x))
27 #define HTML_CLUE_CLASS(x) ((HTMLClueClass *)(x))
28 
29 struct _HTMLClue {
30 	HTMLObject object;
31 
32 	HTMLObject *head;
33 	HTMLObject *tail;
34 	HTMLObject *curr;
35 
36 	HTMLVAlignType valign;
37 	HTMLHAlignType halign;
38 };
39 
40 struct _HTMLClueClass {
41 	HTMLObjectClass object_class;
42 
43 	gint (*get_left_clear) (HTMLClue *clue, gint y);
44 	gint (*get_right_clear) (HTMLClue *clue, gint y);
45 	void (*find_free_area) (HTMLClue *clue, HTMLPainter *painter,
46 				gint y, gint width, gint height, gint indent, gint *y_pos, gint *lmargin, gint *rmargin);
47 	void (*append_right_aligned) (HTMLClue *clue, HTMLPainter *painter,
48 				      HTMLClue *aclue, gint *lmargin, gint *rmargin, gint indent);
49 	void (*append_left_aligned) (HTMLClue *clue, HTMLPainter *painter,
50 				     HTMLClue *aclue, gint *lmargin, gint *rmargin, gint indent);
51 	gboolean (*appended) (HTMLClue *clue, HTMLClue *aclue);
52 };
53 
54 
55 extern HTMLClueClass html_clue_class;
56 
57 
58 void      html_clue_type_init             (void);
59 void      html_clue_class_init            (HTMLClueClass *klass,
60 					   HTMLType       type,
61 					   guint          object_size);
62 void      html_clue_init                  (HTMLClue      *clue,
63 					   HTMLClueClass *klass);
64 gint      html_clue_get_left_clear        (HTMLClue      *clue,
65 					   gint           y);
66 gint      html_clue_get_right_clear       (HTMLClue      *clue,
67 					   gint           y);
68 void      html_clue_find_free_area        (HTMLClue      *clue,
69 					   HTMLPainter   *painter,
70 					   gint           y,
71 					   gint           width,
72 					   gint           height,
73 					   gint           indent,
74 					   gint          *y_pos,
75 					   gint          *lmargin,
76 					   gint          *rmargin);
77 void      html_clue_append_right_aligned  (HTMLClue      *clue,
78 					   HTMLPainter   *painter,
79 					   HTMLClue      *aclue,
80 					   gint          *lmargin,
81 					   gint          *rmargin,
82 					   gint           indent);
83 void      html_clue_append_left_aligned   (HTMLClue      *clue,
84 					   HTMLPainter   *painter,
85 					   HTMLClue      *aclue,
86 					   gint          *lmargin,
87 					   gint          *rmargin,
88 					   gint           indent);
89 gboolean  html_clue_appended              (HTMLClue      *clue,
90 					   HTMLClue      *aclue);
91 void      html_clue_append_after          (HTMLClue      *clue,
92 					   HTMLObject    *o,
93 					   HTMLObject    *where);
94 void      html_clue_append                (HTMLClue      *clue,
95 					   HTMLObject    *o);
96 void      html_clue_prepend               (HTMLClue      *clue,
97 					   HTMLObject    *o);
98 void      html_clue_remove                (HTMLClue      *clue,
99 					   HTMLObject    *o);
100 void      html_clue_remove_text_slaves    (HTMLClue      *clue);
101 gboolean  html_clue_is_empty              (HTMLClue      *clue);
102 
103 #endif /* HTMLCLUE_H */
104