/usr/include/libgoffice-0.10/goffice/utils/go-format.h is in libgoffice-0.10-dev 0.10.39-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* go-format.h :
*
* Copyright (C) 2003-2005 Jody Goldberg (jody@gnome.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#ifndef GO_FORMAT_H
#define GO_FORMAT_H
#include <goffice/goffice.h>
#include <gsf/gsf-libxml.h>
G_BEGIN_DECLS
#define GO_SUPERSCRIPT_SCALE PANGO_SCALE_SMALL
#define GO_SUBSCRIPT_SCALE PANGO_SCALE_SMALL
#define GO_SUPERSCRIPT_RISE 5000
#define GO_SUBSCRIPT_RISE -5000
/* Keep these sequential. */
typedef enum {
GO_FORMAT_UNKNOWN = -1,
GO_FORMAT_GENERAL = 0,
GO_FORMAT_NUMBER = 1,
GO_FORMAT_CURRENCY = 2,
GO_FORMAT_ACCOUNTING = 3,
GO_FORMAT_DATE = 4,
GO_FORMAT_TIME = 5,
GO_FORMAT_PERCENTAGE = 6,
GO_FORMAT_FRACTION = 7,
GO_FORMAT_SCIENTIFIC = 8,
GO_FORMAT_TEXT = 9,
GO_FORMAT_SPECIAL = 10,
/* <private> */
GO_FORMAT_MARKUP = 11 /* Internal use only */
} GOFormatFamily;
typedef enum {
GO_FORMAT_MAGIC_NONE = 0,
GO_FORMAT_MAGIC_LONG_DATE = 0xf800, /* Official */
GO_FORMAT_MAGIC_MEDIUM_DATE = 0xf8f1,
GO_FORMAT_MAGIC_SHORT_DATE = 0xf8f2,
GO_FORMAT_MAGIC_SHORT_DATETIME = 0xf8fa,
GO_FORMAT_MAGIC_LONG_TIME = 0xf400, /* Official */
GO_FORMAT_MAGIC_MEDIUM_TIME = 0xf4f1,
GO_FORMAT_MAGIC_SHORT_TIME = 0xf4f2
} GOFormatMagic;
typedef enum {
GO_FORMAT_NUMBER_OK = 0,
GO_FORMAT_NUMBER_INVALID_FORMAT,
GO_FORMAT_NUMBER_DATE_ERROR
} GOFormatNumberError;
typedef struct {
gchar const *symbol;
gchar const *description;
gboolean precedes;
gboolean has_space;
} GOFormatCurrency;
GType go_format_currency_get_type (void);
typedef struct {
GOFormatFamily family;
GOFormatMagic magic;
/* NUMBER, SCIENTIFIC, CURRENCY, ACCOUNTING, FRACTION, PERCENTAGE: */
int min_digits;
int num_decimals;
/* NUMBER, CURRENCY, ACCOUNTING, PERCENTAGE: */
gboolean thousands_sep;
/* NUMBER, CURRENCY, ACCOUNTING, PERCENTAGE: */
gboolean negative_red;
gboolean negative_paren;
/* CURRENCY, ACCOUNTING: */
GOFormatCurrency const *currency;
/* CURRENCY: */
gboolean force_quoted;
/* SCIENTIFIC: */
int exponent_step;
int exponent_digits;
gboolean exponent_sign_forced;
gboolean use_markup;
gboolean simplify_mantissa;
gboolean append_SI;
gchar *appended_SI_unit;
int scale;
/* FRACTION: */
gboolean automatic_denominator;
gboolean split_fraction;
gboolean pi_scale;
int numerator_min_digits;
int denominator_min_digits;
int denominator_max_digits;
int denominator;
/* <private> */
int expansion[30]; /* what is this for? */
unsigned ref_count;
} GOFormatDetails;
GType go_format_details_get_type (void);
/*************************************************************************/
gboolean go_format_allow_ee_markup (void);
gboolean go_format_allow_si (void);
gboolean go_format_allow_pi_slash (void);
/*************************************************************************/
typedef int (*GOFormatMeasure) (const GString *str, PangoLayout *layout);
int go_format_measure_zero (const GString *str, PangoLayout *layout);
int go_format_measure_pango (const GString *str, PangoLayout *layout);
int go_format_measure_strlen (const GString *str, PangoLayout *layout);
void go_render_general (PangoLayout *layout, GString *str,
GOFormatMeasure measure,
const GOFontMetrics *metrics,
double val,
int col_width,
gboolean unicode_minus,
guint numeral_shape,
guint custom_shape_flags);
#ifdef GOFFICE_WITH_LONG_DOUBLE
void go_render_generall (PangoLayout *layout, GString *str,
GOFormatMeasure measure,
const GOFontMetrics *metrics,
long double val,
int col_width,
gboolean unicode_minus,
guint numeral_shape,
guint custom_shape_flags);
#endif
/*************************************************************************/
GType go_format_get_type (void);
GOFormat *go_format_new_from_XL (char const *str);
GOFormat *go_format_new_markup (PangoAttrList *markup, gboolean add_ref);
/* these do not add a reference to the result */
GOFormat *go_format_general (void);
GOFormat *go_format_empty (void);
GOFormat *go_format_default_date (void);
GOFormat *go_format_default_time (void);
GOFormat *go_format_default_date_time (void);
GOFormat *go_format_default_percentage (void);
GOFormat *go_format_default_money (void);
GOFormat *go_format_default_accounting (void);
void go_format_generate_number_str (GString *dst,
int min_digits,
int num_decimals,
gboolean thousands_sep,
gboolean negative_red,
gboolean negative_paren,
const char *prefix,
const char *postfix);
GOFormatDetails *go_format_details_new (GOFormatFamily family);
void go_format_details_finalize (GOFormatDetails *details);
void go_format_details_free (GOFormatDetails *details);
void go_format_details_init (GOFormatDetails *details,
GOFormatFamily family);
void go_format_generate_str (GString *dst,
GOFormatDetails const *details);
char *go_format_str_localize (char const *str);
char *go_format_str_delocalize (char const *str);
const char* go_format_as_XL (GOFormat const *fmt);
GOFormat *go_format_ref (GOFormat const *fmt);
void go_format_unref (GOFormat const *fmt);
gboolean go_format_is_invalid (GOFormat const *fmt);
gboolean go_format_is_general (GOFormat const *fmt);
gboolean go_format_is_markup (GOFormat const *fmt);
gboolean go_format_is_text (GOFormat const *fmt);
gboolean go_format_is_var_width (GOFormat const *fmt);
int go_format_is_date (GOFormat const *fmt);
int go_format_is_time (GOFormat const *fmt);
int go_format_month_before_day (GOFormat const *fmt);
gboolean go_format_has_hour (GOFormat const *fmt);
gboolean go_format_has_minute (GOFormat const *fmt);
GOFormatMagic go_format_get_magic (GOFormat const *fmt);
GOFormat *go_format_new_magic (GOFormatMagic m);
const GOFormat *go_format_specialize (GOFormat const *fmt,
double val, char type,
gboolean *inhibit_minus);
#ifdef GOFFICE_WITH_LONG_DOUBLE
const GOFormat *go_format_specializel (GOFormat const *fmt,
long double val, char type,
gboolean *inhibit_minus);
#endif
GOFormatFamily go_format_get_family (GOFormat const *fmt);
void go_format_get_details (GOFormat const *fmt,
GOFormatDetails *dst,
gboolean *exact);
const PangoAttrList *go_format_get_markup (GOFormat const *fmt);
gboolean go_format_is_simple (GOFormat const *fmt);
GOFormatNumberError
go_format_value_gstring (PangoLayout *layout, GString *str,
const GOFormatMeasure measure,
const GOFontMetrics *metrics,
GOFormat const *fmt,
double val, char type, const char *sval,
GOColor *go_color,
int col_width,
GODateConventions const *date_conv,
gboolean unicode_minus);
char *go_format_value (GOFormat const *fmt, double val);
#ifdef GOFFICE_WITH_LONG_DOUBLE
GOFormatNumberError
go_format_value_gstringl (PangoLayout *layout, GString *str,
const GOFormatMeasure measure,
const GOFontMetrics *metrics,
GOFormat const *fmt,
long double val, char type, const char *sval,
GOColor *go_color,
int col_width,
GODateConventions const *date_conv,
gboolean unicode_minus);
char *go_format_valuel (GOFormat const *fmt, long double val);
#endif
gboolean go_format_eq (GOFormat const *a, GOFormat const *b);
GOFormat *go_format_inc_precision (GOFormat const *fmt);
GOFormat *go_format_dec_precision (GOFormat const *fmt);
GOFormat *go_format_toggle_1000sep (GOFormat const *fmt);
/******************* GOFormat ODF Support ********************************/
char *go_format_odf_style_map (GOFormat const *fmt, int cond_part);
gboolean go_format_output_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
int cond_part, char const *name,
gboolean with_extension);
void go_format_foreach (GHFunc func, gpointer user_data);
/*************************************************************************/
char const * const *_go_format_builtins(GOFormatFamily fam);
GOFormatCurrency const *_go_format_currencies (void);
GOFormatCurrency const *go_format_locale_currency (void);
/*************************************************************************/
GOColor go_format_palette_color_of_index (int i);
int go_format_palette_index_from_color (GOColor c);
char *go_format_palette_name_of_index (int i);
/*************************************************************************/
void _go_number_format_init (void);
void _go_number_format_shutdown (void);
void _go_currency_date_format_init (void);
void _go_currency_date_format_shutdown (void);
G_END_DECLS
#endif /* GO_FORMAT_H */
|