]> git.sur5r.net Git - glabels/blob - glabels2/src/template.h
Initial revision
[glabels] / glabels2 / src / template.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  template.h:  template module header file
5  *
6  *  Copyright (C) 2001-2002  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program 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
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22
23 #ifndef __TEMPLATE_H__
24 #define __TEMPLATE_H__
25
26 #include <libgnome/libgnome.h>
27 #include <libxml/tree.h>
28 #include <libxml/parser.h>
29
30 typedef enum {
31         GL_TEMPLATE_STYLE_RECT,
32         GL_TEMPLATE_STYLE_ROUND,
33         GL_TEMPLATE_STYLE_CD,
34 } glTemplateStyle;
35
36 typedef struct {
37         GList *name;
38         gchar *description;
39         gchar *page_size;
40         glTemplateStyle style;
41
42         /* Suggested margin */
43         gdouble label_margin;
44
45         /* Simple and rounded rectangles. */
46         gdouble label_width, label_height, label_round;
47
48         /* CD/DVD labels */
49         gdouble label_radius, label_hole;
50
51         /* Layout */
52         gint nx, ny;
53         gdouble x0, y0, dx, dy;
54 } glTemplate;
55
56 extern void       gl_template_init                (void);
57
58 extern GList      *gl_template_get_page_size_list (void);
59 extern void       gl_template_free_page_size_list (GList **sizes);
60
61 extern GList      *gl_template_get_name_list      (const gchar *page_size);
62 extern void       gl_template_free_name_list      (GList **names);
63
64 extern glTemplate *gl_template_from_name          (const gchar * name);
65
66 extern glTemplate *gl_template_dup                (const glTemplate *orig);
67 extern void       gl_template_free                (glTemplate **template);
68
69 extern glTemplate *gl_template_xml_parse_sheet    (xmlNodePtr sheet_node);
70
71 extern void       gl_template_xml_add_sheet       (glTemplate * template,
72                                                    xmlNodePtr root,
73                                                    xmlNsPtr ns);
74 #endif