GOffice.Format¶
Fields¶
None
Methods¶
| class | allow_ee_markup() | 
| class | allow_pi_slash() | 
| class | allow_si() | 
| class | default_accounting() | 
| class | default_date() | 
| class | default_date_time() | 
| class | default_money() | 
| class | default_percentage() | 
| class | default_time() | 
| class | empty() | 
| class | foreach(func, *user_data) | 
| class | general() | 
| class | generate_number_str(dst, min_digits, num_decimals, thousands_sep, negative_red, negative_paren, prefix, postfix) | 
| class | generate_str(dst, details) | 
| class | locale_currency() | 
| class | measure_pango(str, layout) | 
| class | measure_strlen(str, layout) | 
| class | measure_zero(str, layout) | 
| class | new_from_XL(str) | 
| class | new_magic(m) | 
| class | new_markup(markup, add_ref) | 
| class | output_to_odf(xout, fmt, cond_part, name, with_extension) | 
| class | palette_color_of_index(i) | 
| class | palette_index_from_color(c) | 
| class | palette_name_of_index(i) | 
| class | str_delocalize(str) | 
| class | str_localize(str) | 
| class | value_gstring(layout, str, measure, metrics, fmt, val, type, sval, go_color, col_width, date_conv, unicode_minus) | 
| as_XL() | |
| dec_precision() | |
| eq(b) | |
| get_details() | |
| get_family() | |
| get_magic() | |
| get_markup() | |
| has_day() | |
| has_hour() | |
| has_minute() | |
| has_month() | |
| has_year() | |
| inc_precision() | |
| is_date() | |
| is_general() | |
| is_invalid() | |
| is_markup() | |
| is_simple() | |
| is_text() | |
| is_time() | |
| is_var_width() | |
| month_before_day() | |
| odf_style_map(cond_part) | |
| ref() | |
| sel_format_classification() | |
| specialize(val, type) | |
| toggle_1000sep() | |
| unref() | |
| value(val) | 
Details¶
- 
class GOffice.Format¶
- 
- 
classmethod default_accounting()¶
- Returns: - the default accounting format - Return type: - GOffice.Format
 - 
classmethod default_date()¶
- Returns: - the default date format - Return type: - GOffice.Format
 - 
classmethod default_date_time()¶
- Returns: - the default date-and-time format - Return type: - GOffice.Format
 - 
classmethod default_money()¶
- Returns: - the default monetary format - Return type: - GOffice.Format
 - 
classmethod default_percentage()¶
- Returns: - the default percentage format - Return type: - GOffice.Format
 - 
classmethod default_time()¶
- Returns: - the default time format - Return type: - GOffice.Format
 - 
classmethod empty()¶
- Returns: - the empty format - Return type: - GOffice.Format
 - 
classmethod foreach(func, *user_data)¶
- Parameters: - func (GLib.HFunc) – function to execute for each known format
- user_data (objectorNone) – user data for func
 - Executes func for each registered - GOffice.Format
- func (
 - 
classmethod general()¶
- Returns: - the general format - Return type: - GOffice.Format
 - 
classmethod generate_number_str(dst, min_digits, num_decimals, thousands_sep, negative_red, negative_paren, prefix, postfix)¶
- Parameters: - dst (GLib.String) –GLib.Stringto append format string to.
- min_digits (int) – minimum number of digits before decimal separator.
- num_decimals (int) – number of decimals
- thousands_sep (bool) – if true, use a thousands separator.
- negative_red (bool) – if true, make negative values red.
- negative_paren (bool) – if true, enclose negative values in parentheses.
- prefix (str) – optional string to place before number part of the format
- postfix (str) – optional string to place after number part of the format
 - Generates a format string for a number format with the given parameters and appends it to dst. 
- dst (
 - 
classmethod generate_str(dst, details)¶
- Parameters: - dst (GLib.String) –
- details (GOffice.FormatDetails) –
 
- dst (
 - 
classmethod locale_currency()¶
- Returns: - The - GOffice.FormatCurrencymatches the current locale.- Return type: - GOffice.FormatCurrency
 - 
classmethod measure_pango(str, layout)¶
- Parameters: - str (GLib.String) –
- layout (Pango.Layout) –
 - Return type: 
- str (
 - 
classmethod measure_strlen(str, layout)¶
- Parameters: - str (GLib.String) –
- layout (Pango.Layout) –
 - Return type: 
- str (
 - 
classmethod measure_zero(str, layout)¶
- Parameters: - str (GLib.String) –
- layout (Pango.Layout) –
 - Return type: 
- str (
 - 
classmethod new_from_XL(str)¶
- Parameters: - str ( - str) – XL descriptor in UTF-8 encoding.- Returns: - Looks up and potentially creates a - GOffice.Formatfrom the supplied string in XL format.- Return type: - GOffice.Format
 - 
classmethod new_magic(m)¶
- Parameters: - m ( - GOffice.FormatMagic) –- Return type: - GOffice.Format
 - 
classmethod new_markup(markup, add_ref)¶
- Parameters: - markup (Pango.AttrList) –Pango.AttrList
- add_ref (bool) – boolean
 - Returns: - A new format. - Return type: - If add_ref is - Falseabsorb the reference to markup, otherwise add a reference.
- markup (
 - 
classmethod output_to_odf(xout, fmt, cond_part, name, with_extension)¶
- Parameters: - xout (Gsf.XMLOut) –
- fmt (GOffice.Format) –
- cond_part (int) –
- name (str) –
- with_extension (bool) –
 - Return type: 
- xout (
 - 
classmethod palette_index_from_color(c)¶
- Parameters: - c ( - int) – color- Returns: - the index of the color closest to the argument color in some sense. - Return type: - int
 - 
classmethod str_delocalize(str)¶
- Parameters: - str ( - str) – A *valid* localized format string- Returns: - a non-local format string, or - Noneif the format was not valid.- Return type: - str- De-localizes the given format string, i.e., changes locale’s decimal separators to dots and performs other such transformations. 
 - 
classmethod str_localize(str)¶
- Parameters: - str ( - str) – A *valid* format string- Returns: - a localized format string, or - Noneif the format was not valid.- Return type: - str- Localizes the given format string, i.e., changes decimal dots to the locale’s notion of that and performs other such transformations. 
 - 
classmethod value_gstring(layout, str, measure, metrics, fmt, val, type, sval, go_color, col_width, date_conv, unicode_minus)¶
- Parameters: - layout (Pango.Layout) – OptionalPango.Layout, probably preseeded withGOffice.fontattribute.
- str (GLib.String) – aGLib.Stringto store (not append!) the resulting string in.
- measure (GOffice.FormatMeasure) – Function to measure width of string/layout.
- metrics (GOffice.FontMetrics) – Font metrics corresponding to mesaure.
- fmt (GOffice.Format) –GOffice.Format
- val (float) – floating-pointGOffice.value. Must be finite.
- type (int) – a format character
- sval (str) – a string to append to str after val
- go_color (int) – a color to rende
- col_width (int) – intended max width of layout in pango units. -1 means no restriction.
- date_conv (GOffice.DateConventions) –GOffice.DateConventions
- unicode_minus (bool) – Use unicode minuses, not hyphens.
 - Returns: - Return type: - Render a floating-point - GOffice.valueinto layout in such a way that the layouting width does not needlessly exceed col_width. Optionally use unicode minus instead of hyphen.
- layout (
 - 
dec_precision()¶
- Returns: - Noneif the new format would not change things- Return type: - GOffice.Format- Decreases the displayed precision for self by one digit. 
 - 
eq(b)¶
- Parameters: - b ( - GOffice.Format) –- Return type: - bool
 - 
get_details()¶
- Returns: - dst: - GOffice.FormatDetails- exact: - whether dst describes self exactly. - Return type: - (dst: - GOffice.FormatDetails, exact:- bool)
 - 
get_family()¶
- Return type: - GOffice.FormatFamily
 - 
get_magic()¶
- Returns: - a non-zero magic code for certain formats, such as system date. - Return type: - GOffice.FormatMagic
 - 
get_markup()¶
- Return type: - Pango.AttrList
 - 
has_day()¶
- Returns: - Trueif format is a number format with a day-of-month specifier- Falseotherwise.- Return type: - bool
 - 
has_hour()¶
- Returns: - Trueif format is a number format with an hour specifier- Falseotherwise.- Return type: - bool
 - 
has_minute()¶
- Returns: - Trueif format is a number format with a minute specifier- Falseotherwise.- Return type: - bool
 - 
has_month()¶
- Returns: - Trueif format is a number format with a year specifier- Falseotherwise.- Return type: - bool
 - 
has_year()¶
- Returns: - Trueif format is a number format with a year specifier- Falseotherwise.- Return type: - bool
 - 
inc_precision()¶
- Returns: - Noneif the new format would not change things- Return type: - GOffice.Format- Increases the displayed precision for self by one digit. 
 - 
is_date()¶
- Returns: - +2 if the format is a date format with time +1 if the format is any other date format. 0 if the format is not a date format. -1 if the format is inconsistent. - Return type: - int
 - 
is_general()¶
- Returns: - Trueif the format is “General”, possibly with condition, color, and/or locale. (“xGeneral” is thus not considered to be General for the purpose of this function.) Returns- Falseotherwise.- Return type: - bool
 - 
is_time()¶
- Returns: - +2 if the format is a time format with elapsed hour/minute/second +1 if the format is any other time format 0 if the format is not a time format -1 if the format is inconsistent. - Return type: - int
 - 
month_before_day()¶
- Returns: - 0, if format is a date format with day and month in that order 1, if format is a date format with month and day in that order, unless 2, if format is a date with year before month before day -1, otherwise. - Return type: - int
 - 
ref()¶
- Returns: - gf - Return type: - GOffice.Format- Adds a reference to a - GOffice.Format.
 - 
specialize(val, type)¶
- Parameters: - Returns: - self format, presumably a conditional format, specialized to value of type. - inhibit_minus: - set to - Trueif the format dictates that a minus should be inhibited when rendering negative values.- Return type: - ( - GOffice.Format, inhibit_minus:- bool)
 - 
toggle_1000sep()¶
- Return type: - GOffice.Format
 - 
unref()¶
- Removes a reference to self, freeing when it goes to zero. 
 
- 
classmethod