1 #ifndef _GNM_PRINT_INFO_H_
2 # define _GNM_PRINT_INFO_H_
9 GType
gnm_print_comment_placement_get_type (void);
10 #define GNM_PRINT_COMMENT_PLACEMENT_TYPE (gnm_print_comment_placement_get_type ())
12 GType
gnm_print_errors_get_type (void);
13 #define GNM_PRINT_ERRORS_TYPE (gnm_print_errors_get_type ())
17 GtkUnit top
, bottom
, left
, right
, header
, footer
;
18 } GnmPrintDesiredDisplay
;
20 /* Header/Footer definition */
28 GNM_PRINT_COMMENTS_NONE
,
29 GNM_PRINT_COMMENTS_IN_PLACE
,
30 GNM_PRINT_COMMENTS_AT_END
31 } GnmPrintCommentPlacementType
;
34 GNM_PRINT_ERRORS_AS_DISPLAYED
,
35 GNM_PRINT_ERRORS_AS_BLANK
,
36 GNM_PRINT_ERRORS_AS_DASHES
,
37 GNM_PRINT_ERRORS_AS_NA
41 GNM_PAGE_BREAK_NONE
, /* Not actually a page break */
42 GNM_PAGE_BREAK_MANUAL
, /* hard page break */
43 GNM_PAGE_BREAK_AUTO
, /* soft (automatic) pagebreak */
44 GNM_PAGE_BREAK_DATA_SLICE
/* place holder ? */
46 GnmPageBreakType
gnm_page_break_type_from_str (char const *str
);
49 int pos
; /* break before this 0 based position */
50 GnmPageBreakType type
;
55 GArray
*details
; /* ordered array of GnmPageBreak */
58 struct GnmPrintInformation_
{
59 struct GnmPrintInfoScaling_
{
60 enum GnmPrintScaleType_
{
61 PRINT_SCALE_PERCENTAGE
,
65 /* We store separate x and y scales internally, for the
66 * 'fit-to' printing feature. (They are calculated at print-time)
67 * When the user is doing the simple scaling, both these values
70 struct _PrintScalePercent
{
75 struct _PrintScaleDim
{ /* zero == use as many as required */
80 double edge_to_below_header
;
81 double edge_to_above_footer
;
82 GnmPrintDesiredDisplay desired_display
;
83 char *repeat_top
, *repeat_left
;
84 unsigned int print_across_then_down
;
85 unsigned int center_vertically
:1;
86 unsigned int center_horizontally
:1;
87 unsigned int print_grid_lines
:1;
88 unsigned int print_titles
:1; /* col/row headers */
89 unsigned int print_black_and_white
:1;
90 unsigned int print_as_draft
:1;
92 /* Gnumeric specific */
93 unsigned int print_even_if_only_styles
:1;
94 unsigned int do_not_print
:1;
96 GnmPrintCommentPlacementType comment_placement
;
97 GnmPrintErrorsType error_display
;
99 struct _PrintInfoPageBreaks
{
100 GnmPageBreaks
*h
, /* between rows */
101 *v
; /* between columns */
103 GnmPrintHF
*header
, *footer
;
105 int start_page
; /* < 0 implies auto */
108 gchar
*printtofile_uri
;
109 PrintRange print_range
;
111 /* page_setup doubles as a flag whether the defaults are loaded */
112 GtkPageSetup
*page_setup
;
117 } GnmPrintHFRenderType
;
124 GODateConventions
const *date_conv
;
126 GnmCellPos top_repeating
;
127 } GnmPrintHFRenderInfo
;
129 GType
gnm_print_information_get_type (void);
130 GnmPrintInformation
*gnm_print_information_new (gboolean load_defaults
);
131 GnmPrintInformation
*gnm_print_info_load_defaults (GnmPrintInformation
*pi
);
132 GnmPrintInformation
*gnm_print_info_dup (GnmPrintInformation
const *pi
);
133 void gnm_print_info_free (GnmPrintInformation
*pi
);
134 void gnm_print_info_save (GnmPrintInformation
*pi
);
136 GtkPageSetup
*gnm_print_info_get_page_setup (GnmPrintInformation
*pi
); /* Does not return a ref! */
137 void gnm_print_info_set_page_setup (GnmPrintInformation
*pi
, GtkPageSetup
*page_setup
);
139 GType
gnm_print_hf_get_type (void);
140 GnmPrintHF
*gnm_print_hf_new (char const *left
,
143 void gnm_print_hf_free (GnmPrintHF
*print_hf
);
144 GnmPrintHF
*gnm_print_hf_copy (GnmPrintHF
const *source
);
145 GnmPrintHF
*gnm_print_hf_register (GnmPrintHF
*hf
);
146 gboolean
gnm_print_hf_same (GnmPrintHF
const *a
, GnmPrintHF
const *b
);
148 char *gnm_print_hf_format_render (char const *format
,
149 GnmPrintHFRenderInfo
*info
,
150 GnmPrintHFRenderType render_type
);
152 GType
gnm_print_hf_render_info_get_type (void);
153 GnmPrintHFRenderInfo
*gnm_print_hf_render_info_new (void);
154 void gnm_print_hf_render_info_destroy (GnmPrintHFRenderInfo
*hfi
);
157 GtkUnit
unit_name_to_unit (char const *name
);
158 char const *unit_to_unit_name (GtkUnit unit
);
160 void print_init (void);
161 void print_shutdown (void);
163 gboolean
page_setup_set_paper (GtkPageSetup
*page_setup
, char const *paper
);
164 char *page_setup_get_paper (GtkPageSetup
*page_setup
); /* caller frees result */
165 gboolean
print_info_set_paper (GnmPrintInformation
*pi
, char const *paper
);
166 char *print_info_get_paper (GnmPrintInformation
*pi
); /* caller frees result */
167 GtkPaperSize
*print_info_get_paper_size (GnmPrintInformation
*pi
);
169 void print_info_set_paper_orientation (GnmPrintInformation
*pi
,
170 GtkPageOrientation orientation
);
171 char const *print_info_get_paper_display_name (GnmPrintInformation
*pi
);
173 double print_info_get_paper_width (GnmPrintInformation
*pi
, GtkUnit unit
);
174 double print_info_get_paper_height (GnmPrintInformation
*pi
, GtkUnit unit
);
175 GtkPageOrientation
print_info_get_paper_orientation (GnmPrintInformation
*pi
);
176 void print_info_get_margins (GnmPrintInformation
*pi
,
177 double *top
, double *bottom
,
178 double *left
, double *right
,
179 double *edge_to_below_header
,
180 double *edge_to_above_footer
);
181 void print_info_set_margins (GnmPrintInformation
*pi
,
182 double header
, double footer
, double left
, double right
);
183 void print_info_set_margin_header (GnmPrintInformation
*pi
, double header
);
184 void print_info_set_margin_footer (GnmPrintInformation
*pi
, double footer
);
185 void print_info_set_margin_left (GnmPrintInformation
*pi
, double left
);
186 void print_info_set_margin_right (GnmPrintInformation
*pi
, double right
);
187 void print_info_set_edge_to_above_footer (GnmPrintInformation
*pi
,
189 void print_info_set_edge_to_below_header (GnmPrintInformation
*pi
,
191 void print_info_set_printtofile_uri (GnmPrintInformation
*pi
,
193 void print_info_set_printtofile_from_settings
194 (GnmPrintInformation
*pi
,
195 GtkPrintSettings
*settings
,
196 gchar
const *default_uri
);
197 void print_info_set_from_settings
198 (GnmPrintInformation
*pi
,
199 GtkPrintSettings
*settings
);
200 char const *print_info_get_printtofile_uri (GnmPrintInformation
*pi
);
201 PrintRange
print_info_get_printrange (GnmPrintInformation
*pi
);
202 void print_info_set_printrange (GnmPrintInformation
*pi
, PrintRange pr
);
204 void print_info_set_breaks (GnmPrintInformation
*pi
, GnmPageBreaks
*breaks
);
206 gboolean
print_info_has_manual_breaks (GnmPrintInformation
*pi
);
208 GType
gnm_page_breaks_get_type (void);
209 GnmPageBreaks
*gnm_page_breaks_new (gboolean is_vert
);
210 GnmPageBreaks
*gnm_page_breaks_dup (GnmPageBreaks
const *src
);
211 void gnm_page_breaks_free (GnmPageBreaks
*breaks
);
212 void gnm_page_breaks_clean (GnmPageBreaks
*breaks
);
213 gboolean
gnm_page_breaks_append_break (GnmPageBreaks
*breaks
,
215 GnmPageBreakType type
);
216 gboolean
gnm_page_breaks_set_break (GnmPageBreaks
*breaks
,
218 GnmPageBreakType type
);
219 GnmPageBreakType
gnm_page_breaks_get_break (GnmPageBreaks
*breaks
, int pos
);
220 int gnm_page_breaks_get_next_manual_break (GnmPageBreaks
*breaks
, int pos
);
221 int gnm_page_breaks_get_next_break (GnmPageBreaks
*breaks
, int pos
);
222 GnmPageBreaks
* gnm_page_breaks_dup_non_auto_breaks (GnmPageBreaks
const *src
);
224 gboolean
print_load_repeat_range (char const *str
, GnmRange
*r
, Sheet
const *sheet
);
229 extern GList
*gnm_print_hf_formats
;
233 #endif /* _GNM_PRINT_INFO_H_ */