Class RowStyler
- class ooodev.write.style.direct.table.row_styler.RowStyler(owner, component)[source]
Bases:
WriteDocPropPartial,WriteTablePropPartial,EventsPartial,LoInstPropsPartial,FillColorPartial,WriteTableFillImgPartial,TheDictionaryPartialRow Styler class.
Class set various Row properties.
Events are raises when a style is being applied and when a style has been applied. The
WriteNamedEvent.TABLE_STYLE_APPLYINGevent is raised before a style is applied. TheWriteNamedEvent.TABLE_STYLE_APPLIEDevent is raised after a style has been applied. The event data is a dictionary that contains the following:cancel_apply: If set toTruethe style will not be applied. This is only used in theTABLE_STYLE_APPLYINGevent.this_component: The component that the style is being applied to. This is the normally same component passed to the constructor.styler_object: The style that is being applied. This isNonewhenTABLE_STYLE_APPLYINGis raised. Is the style that was applied whenTABLE_STYLE_APPLIEDis raised.
Other style specific data is also in the dictionary such as the parameter values used to apply the style.
The
event_args.event_sourceis the instance of theRowStylerclass.- Parameters:
owner (WriteTable) –
component (Any) –
- __init__(owner, component)[source]
Constructor.
- Parameters:
owner (WriteTable) – Write Table instance.
component (Any) – component instance.
- Return type:
None
- add_event_observers(*args)
Adds observers that gets their
triggermethod called when this classtriggermethod is called.- Parameters:
args (EventObserver) – One or more observers to add.
- Return type:
None
Note
Observers are removed automatically when they are out of scope.
- remove_event_observer(observer)
Removes an observer
- Parameters:
observer (EventObserver) – One or more observers to add.
- Returns:
Trueif observer has been removed; Otherwise,False.- Return type:
bool
- style_area_color(color=-1)
Style Area Color.
- Parameters:
color (
Color, optional) – FillColor Color. Defaults toStandardColor.AUTO_COLOR.- Raises:
CancelEventError – If the event
before_style_area_coloris cancelled and not handled.- Returns:
FillColor instance or
Noneif cancelled.- Return type:
FillColorT | None
- style_area_color_get()
Gets the Area Color Style.
- Raises:
CancelEventError – If the event
before_style_area_color_getis cancelled and not handled.- Returns:
Area color style or
Noneif cancelled.- Return type:
FillColorT | None
- style_area_image(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False)
Style Area Color.
- Parameters:
bitmap (XBitmap, optional) – Bitmap instance. If
nameis not already in the Bitmap Table then this property is required.name (str, optional) – Specifies the name of the image. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.
mode (ImgStyleKind, optional) – Specifies the image style, tiled, stretched etc. Default
ImgStyleKind.TILED.size (SizePercent, SizeMM, optional) – Size in percent (
0 - 100) or size inmmunits.position (RectanglePoint) – Tiling position of Image.
pos_offset (Offset, optional) – Tiling position offset.
tile_offset (OffsetColumn, OffsetRow, optional) – The tiling offset.
auto_name (bool, optional) – Specifies if
nameis ensured to be unique. Defaults toFalse.
- Raises:
CancelEventError – If the event
before_style_area_imgis cancelled and not handled.- Returns:
Fill Image instance or
Noneif cancelled.- Return type:
FillImgT | None
Hint
RectanglePointcan be imported fromooo.dyn.drawing.rectangle_pointImgStyleKindcan be imported fromooodev.format.inner.direct.write.fill.area.imgSizePercentcan be imported fromooodev.format.inner.common.format_types.size_percentSizeMMcan be imported fromooodev.utils.data_type.size_mmOffsetColumncan be imported fromooodev.format.inner.common.format_types.offset_columnOffsetRowcan be imported fromooodev.format.inner.common.format_types.offset_rowOffsetcan be imported fromooodev.utils.data_type.offset
- style_area_image_from_preset(preset)
Style Area Gradient from Preset.
- Parameters:
preset (PresetImageKind) – Preset Image Kind.
- Returns:
Chart Fill Image instance.
- Return type:
Hint
PresetImageKindcan be imported fromooodev.format.inner.preset.preset_image
- subscribe_event(event_name, callback)
Add an event listener to current instance.
- Parameters:
event_name (str) – Event Name.
callback (EventCallback) – Callback of the event listener.
- Return type:
None
- trigger_event(event_name, event_args)
Trigger an event on current instance.
- Parameters:
event_name (str) – Event Name.
event_args (EventArgsT) – Event Args.
- Return type:
None
- unsubscribe_event(event_name, callback)
Remove an event listener from current instance.
- Parameters:
event_name (str) – Event Name.
callback (EventCallback) – Callback of the event listener.
- Return type:
None
- property event_observer: EventObserver
Gets/Sets The Event Observer for this instance.
- Return type:
- property extra_data: TheDict
Extra Data Key Value Pair Dictionary.
Properties can be assigned properties and access like a dictionary and with dot notation.
Note
This is a dictionary object that can be used to store key value pairs. Generally speaking this data is not part of the object’s main data structure and is not saved with the object (document).
This property is used to store data that is not part of the object’s main data structure and can be used however the developer sees fit.
- Return type:
- property office_doc: OfficeDocumentT
Office Document.
- Return type:
- property write_table: WriteTable[Any]
Write Document.
- Return type:
WriteTable[Any]