ooodev.format.inner.direct.structs.tab_stop_struct module
- class ooodev.format.inner.direct.structs.tab_stop_struct.FillCharKind(value)[source]
Bases:
Enum
Tab Fill Char
- DASH = '-'
- DECIMAL = '.'
- NONE = ' '
- UNDER_SCORE = '_'
- class ooodev.format.inner.direct.structs.tab_stop_struct.TabStopStruct(*, position=0.0, align=TabAlign.LEFT, decimal_char='.', fill_char=FillCharKind.NONE)[source]
Bases:
StructBase
Paragraph Tab
Any properties starting with
prop_
set or get current instance values.All methods starting with
fmt_
can be used to chain together properties.New in version 0.9.0.
- __init__(*, position=0.0, align=TabAlign.LEFT, decimal_char='.', fill_char=FillCharKind.NONE)[source]
Constructor
- Parameters:
position (float, UnitT, optional) – Specifies the position of the tabulator in relation to the left border (in
mm
units) or Class UnitT. Defaults to0.0
align (TabAlign, optional) – Specifies the alignment of the text range before the tabulator. Defaults to
TabAlign.LEFT
decimal_char (str, optional) – Specifies which delimiter is used for the decimal. Argument is expected to be a single character string. This argument is only used when
align
is set toTabAlign.DECIMAL
.fill_char (FillCharKind, str, optional) – specifies the character that is used to fill up the space between the text in the text range and the tabulators. If string value then argument is expected to be a single character string. Defaults to
FillCharKind.NONE
- Return type:
None
Note
If argument
type
isNone
then all other argument are ignored
- apply(obj: Any)[source]
- apply(obj: Any, keys: Dict[str, str])
- apply(obj, **kwargs)
Applies tab properties to
obj
If a Tab instance with the same position is existing it is updated; Otherwise, a new Tab is added.
- Parameters:
obj (object) – UNO object that supports
com.sun.star.style.ParagraphProperties
service.keys (Dict[str, str], optional) – Property key, value items that map properties.
- Events:
- Return type:
None
- fmt_align(value)[source]
Gets a copy of instance with align set.
- Parameters:
value (float) – Align value.
self (_TTabStopStruct) –
- Returns:
Tab instance
- Return type:
Tab
- fmt_decimal_char(value)[source]
Gets a copy of instance with decimal char set.
- Parameters:
value (float) – Decimal char value.
self (_TTabStopStruct) –
- Returns:
Tab instance
- Return type:
Tab
- fmt_fill_char(value)[source]
Gets a copy of instance with fill char set.
- Parameters:
value (float) – Fill char value.
self (_TTabStopStruct) –
- Returns:
Tab instance
- Return type:
Tab
- fmt_position(value)[source]
Gets a copy of instance with position set.
- Parameters:
value (float, UnitT) – Position value (in
mm
units) or Class UnitT.self (_TTabStopStruct) –
- Returns:
Tab instance
- Return type:
Tab
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, index=0, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO object
index (int, optional) – Index of tab stop. Default
0
.
- Raises:
PropertyNotFoundError – If
obj
does not have required property- Returns:
Tab
instance that representsobj
Tab properties.- Return type:
Tab
- classmethod from_uno_struct(ts)[source]
- classmethod from_uno_struct(ts, **kwargs)
- classmethod from_uno_struct(ts, **kwargs)
Converts a Tab Stop instance to a Tab
- Parameters:
ts (TabStop) – Tab stop
- Returns:
Tab set with Tab Stop properties
- Return type:
Tab
- get_attrs()[source]
Gets the attributes that are slated for change in the current instance
- Returns:
Tuple of attributes
- Return type:
Tuple(str, …)
- get_uno_struct()[source]
Gets UNO
TabStop
from instance.- Returns:
TabStop
instance- Return type:
TabStop
- property prop_align: TabAlign
Gets/Sets the alignment of the text range before the tabulator
- Return type:
TabAlign
- property prop_decimal_char: str
Gets/Sets which delimiter is used for the decimal.
- Return type:
str
- property prop_fill_char: str
Gets/Sets which delimiter is used for the decimal.
- Return type:
str
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type: