GOffice.Format¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GOffice.Format¶
-
- classmethod default_accounting()¶
- Returns:
the default accounting format
- Return type:
- classmethod default_date()¶
- Returns:
the default date format
- Return type:
- classmethod default_date_time()¶
- Returns:
the default date-and-time format
- Return type:
- classmethod default_money()¶
- Returns:
the default monetary format
- Return type:
- classmethod default_percentage()¶
- Returns:
the default percentage format
- Return type:
- classmethod default_time()¶
- Returns:
the default time format
- Return type:
- classmethod empty()¶
- Returns:
the empty format
- Return type:
- classmethod foreach(func, *user_data)¶
- Parameters:
func (
GLib.HFunc
) – function to execute for each known format
Executes func for each registered
GOffice.Format
- classmethod general()¶
- Returns:
the general format
- Return type:
- classmethod generate_number_str(dst, min_digits, num_decimals, thousands_sep, negative_red, negative_paren, prefix, postfix)¶
- Parameters:
dst (
GLib.String
) –GLib.String
to append format string to.min_digits (
int
) – minimum number of digits before decimal separator.num_decimals (
int
) – number of decimalsthousands_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 formatpostfix (
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.
- classmethod generate_str(dst, details)¶
- Parameters:
dst (
GLib.String
) –details (
GOffice.FormatDetails
) –
- classmethod locale_currency()¶
- Returns:
The
GOffice.FormatCurrency
matches the current locale.- Return type:
- classmethod measure_pango(str, layout)¶
- Parameters:
str (
GLib.String
) –layout (
Pango.Layout
) –
- Return type:
- classmethod measure_strlen(str, layout)¶
- Parameters:
str (
GLib.String
) –layout (
Pango.Layout
) –
- Return type:
- classmethod measure_zero(str, layout)¶
- Parameters:
str (
GLib.String
) –layout (
Pango.Layout
) –
- Return type:
- classmethod new_from_XL(str)¶
- Parameters:
str (
str
) – XL descriptor in UTF-8 encoding.- Returns:
A
GOffice.Format
matching str.- Return type:
- classmethod new_magic(m)¶
- Parameters:
m (
GOffice.FormatMagic
) –- Return type:
- 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
False
absorb the reference to markup, otherwise add a reference.
- 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:
- classmethod palette_index_from_color(c)¶
- classmethod str_delocalize(str)¶
- Parameters:
str (
str
) – A *valid* localized format string- Returns:
a non-local format string, or
None
if the format was not valid.- Return type:
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
None
if the format was not valid.- Return type:
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.font
attribute.str (
GLib.String
) – aGLib.String
to store (not append!) the resulting string in.measure (
GOffice.FormatMeasure
) – Function to measure width of string/layout.metrics (
GOffice.FontMetrics
) – Font metrics corresponding to measure.fmt (
GOffice.Format
) –GOffice.Format
val (
float
) – floating-pointGOffice.value
. Must be finite.type (
int
) – a format charactersval (
str
) – a string to append to str after valgo_color (
int
) – a color to rendercol_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.value
into layout in such a way that the layouting width does not needlessly exceed col_width. Optionally use unicode minus instead of hyphen.
- dec_precision()¶
- Returns:
New format, or
None
if the format would not change.- Return type:
Decreases the displayed precision for self by one digit.
- eq(b)¶
- Parameters:
b (
GOffice.Format
) –- Return type:
- get_details()¶
- Returns:
- dst:
- exact:
whether dst describes self exactly.
- Return type:
(dst:
GOffice.FormatDetails
, exact:bool
)
- get_family()¶
- Return type:
- get_magic()¶
- Returns:
a non-zero magic code for certain formats, such as system date.
- Return type:
- get_markup()¶
- Return type:
- has_day()¶
- has_hour()¶
- has_minute()¶
- has_month()¶
- has_year()¶
- inc_precision()¶
- Returns:
New format, or
None
if the format would not change.- Return type:
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:
- is_general()¶
- 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:
- 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:
- ref()¶
- Returns:
gf
- Return type:
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
True
if the format dictates that a minus should be inhibited when rendering negative values.
- Return type:
(
GOffice.Format
, inhibit_minus:bool
)
- toggle_1000sep()¶
- Return type:
- unref()¶
Removes a reference to self, freeing when it goes to zero.