1 #ifndef _GNM_FORMAT_H_ 2 # define _GNM_FORMAT_H_ 3 4 #include <gnumeric.h> 5 #include <goffice/goffice.h> 6 #include <pango/pango.h> 7 8 G_BEGIN_DECLS 9 10 char *format_value (GOFormat const *format, 11 GnmValue const *value, 12 int col_width, 13 GODateConventions const *date_conv); 14 15 GOFormatNumberError format_value_gstring (GString *str, 16 GOFormat const *format, 17 GnmValue const *value, 18 int col_width, 19 GODateConventions const *date_conv); 20 GOFormatNumberError format_value_layout (PangoLayout *layout, 21 GOFormat const *format, 22 GnmValue const *value, 23 int col_width, 24 GODateConventions const *date_conv); 25 26 GOFormatNumberError gnm_format_layout (PangoLayout *result, 27 GOFontMetrics *metrics, 28 GOFormat const *format, 29 GnmValue const *value, 30 int col_width, 31 GODateConventions const *date_conv, 32 gboolean unicode_minus); 33 34 GOFormat const * gnm_format_specialize (GOFormat const *fmt, 35 GnmValue const *value); 36 37 int gnm_format_is_date_for_value (GOFormat const *fmt, 38 GnmValue const *value); 39 int gnm_format_is_time_for_value (GOFormat const *fmt, 40 GnmValue const *value); 41 42 int gnm_format_month_before_day (GOFormat const *fmt, 43 GnmValue const *value); 44 45 char *gnm_format_frob_slashes (const char *s); 46 47 GOFormat *gnm_format_for_date_editing (GnmCell const *cell); 48 49 gboolean gnm_format_has_hour (GOFormat const *fmt, 50 GnmValue const *value); 51 52 typedef enum { 53 GNM_FORMAT_IMPORT_NULL_INVALID, 54 GNM_FORMAT_IMPORT_PATCHUP_INCOMPLETE 55 } GnmFormatImportFlags; 56 57 GOFormat *gnm_format_import (const char *fmt, 58 GnmFormatImportFlags flags); 59 60 /* 61 * http://www.unicode.org/charts/PDF/U0080.pdf 62 * http://www.unicode.org/charts/PDF/U2000.pdf 63 * http://www.unicode.org/charts/PDF/U20A0.pdf 64 * http://www.unicode.org/charts/PDF/U2200.pdf 65 */ 66 #define UNICODE_LOGICAL_NOT_C 0x00AC 67 #define UNICODE_ZERO_WIDTH_SPACE_C 0X200B 68 #define UNICODE_ZERO_WIDTH_SPACE_C_UTF8_LENGTH 3 69 #define UNICODE_EURO_SIGN_C 0x20AC 70 #define UNICODE_MINUS_SIGN_C 0x2212 71 #define UNICODE_DIVISION_SLASH_C 0x2215 72 #define UNICODE_LOGICAL_AND_C 0x2227 73 #define UNICODE_LOGICAL_OR_C 0x2228 74 #define UNICODE_NOT_EQUAL_TO_C 0x2260 75 #define UNICODE_LESS_THAN_OR_EQUAL_TO_C 0x2264 76 #define UNICODE_GREATER_THAN_OR_EQUAL_TO_C 0x2265 77 78 G_END_DECLS 79 80 #endif /* _GNM_FORMAT_H_ */ 81