Update Spanish translation
[gnumeric.git] / src / format-template.h
blob3ceff6bfc92436073cd3e731a5a37b0befb38006
1 #ifndef _GNM_FORMAT_TEMPLATE_H_
2 # define _GNM_FORMAT_TEMPLATE_H_
4 #include <gnumeric.h>
6 G_BEGIN_DECLS
8 /*
9 * FORMAT TEMPLATE RULES
11 * Authors :
12 * Almer S. Tigelaar <almer1@dds.nl>
13 * Jody Goldberg <jody@gnome.org>
15 * ----------------------------------------------------------------------------
16 * Placement :
17 * offset :
18 * 1. These can only be positive and indicate the number of
19 * columns from the side (see gravity)
20 * offset_gravity :
21 * 1. This is the side to count offset from,
22 * gravity (for rows : +1=top, -1=bottom; for cols : +1=left, -1=right).
24 * Dimensions :
25 * size :
26 * 1. The number of cols/rows from the offset, if this is <=0 than this is
27 * relative to the 'far side' otherwise it is relative to the offset.
29 * Frequency :
30 * direction :
31 * 1. The direction to repeat in, this can be either horizontal
32 * or vertical.
33 * repeat :
34 * 1. When repeat >= 0, we will repeat
35 * repeat times, if it is something else (preferably -1) we
36 * simply repeat _indefinitely_ in vertical or horizontal directions.
37 * skip :
38 * 1. When skip is 0 or smaller than 0 we don't skip
39 * any rows or cols in between applications.
40 * edge :
41 * 1. Can be 0 or greater. Specifies the number of rows to at least
42 * not but a repetetive style calculated from the far side.
43 * ----------------
45 typedef struct {
46 int offset; /* Offset (top/left) */
47 int offset_gravity; /* Gravity +1 means relative to top/left, -1 relative to bottom/right */
48 int size; /* Dimensions (These form the bottom right coordinates) */
49 } GnmFTColRowInfo;
51 /* WARNING : do not change these or persistence will break */
52 typedef enum {
53 FREQ_DIRECTION_NONE,
54 FREQ_DIRECTION_HORIZONTAL,
55 FREQ_DIRECTION_VERTICAL
56 } GnmFTFreqDirection;
58 /* A collection of categories of the same name from different paths */
59 typedef struct {
60 GList *categories;
62 /* translatable via gettext in the std message domain */
63 char *name;
64 char *description;
65 } GnmFTCategoryGroup;
67 typedef struct {
68 char *directory;
69 gboolean is_writable;
71 /* translatable via gettext in the std message domain */
72 char *name;
73 char *description;
74 } GnmFTCategory;
76 struct GnmFT_ {
77 GnmFTCategory *category;
78 GSList *members; /* the actual TemplateMembers */
79 char *filename;
80 char *author;
81 /* translatable via gettext in the std message domain */
82 char *name;
83 char *description;
85 /* what to enable */
86 gboolean number;
87 gboolean border;
88 gboolean font;
89 gboolean patterns;
90 gboolean alignment;
92 struct _FormatEdges {
93 gboolean left;
94 gboolean right;
95 gboolean top;
96 gboolean bottom;
97 } edges;
99 /* <private> */
100 /* pre-calculate styles */
101 GHashTable *table;
102 gboolean invalidate_hash;
104 GnmRange dimension;
107 typedef struct {
108 GnmFTColRowInfo row; /* Row info */
109 GnmFTColRowInfo col; /* Col info */
111 /* Frequency (How many times to repeat) and in which
112 * direction and when to stop.
114 GnmFTFreqDirection direction;
115 int repeat;
116 int skip;
117 int edge;
119 GnmStyle *mstyle; /* Style to apply */
120 } GnmFTMember;
123 * Functions for GnmFT
125 GType gnm_ft_get_type (void);
126 void gnm_ft_free (GnmFT *ft);
127 GnmFT *gnm_ft_clone (GnmFT const *ft);
128 GnmFT *gnm_ft_new_from_file (char const *filename,
129 GOCmdContext *context);
131 gint gnm_ft_compare_name (gconstpointer a, gconstpointer b);
133 GnmStyle *gnm_ft_get_style (GnmFT *ft, int row, int col);
134 void gnm_ft_apply_to_sheet_regions (GnmFT *ft, Sheet *sheet, GSList *regions);
135 gboolean gnm_ft_check_valid (GnmFT *ft, GSList *regions,
136 GOCmdContext *cc);
138 G_END_DECLS
140 #endif /* _GNM_FORMAT_TEMPLATE_H_ */