Class StyleT

protocol ooodev.proto.style_obj.StyleT[source]

Protocol Class for Styles

Classes that implement this protocol must have the following methods / attributes:

apply(obj)[source]

Applies style

Return type:

None

Parameters:

obj (Any) –

backup(obj)[source]

Backs up Attributes that are to be changed by apply.

If used method should be called before apply.

Parameters:

obj (object) – Object to backup properties from.

Return type:

None

get_attrs()[source]

Gets the attributes that are slated for change in the current instance

Returns:

Tuple of Attributes

Return type:

Tuple(str, …)

get_props()[source]

Gets Properties

Return type:

Tuple[PropertyValue, ...]

restore(obj, clear=False)[source]

Restores obj properties from backed up setting if any exist.

Restore can only be effective if backup() has be run before calling this method.

Parameters:
  • obj (object) – Object to restore properties on.

  • clear (bool) – Determines if backup is cleared after restore. Default False

Return type:

None

See also

backup()

set_update_obj(obj)[source]

Sets the update object for the style instance.

Parameters:

obj (Any) – Object used to apply style to when update is called.

Return type:

None

support_service(*service)[source]

Gets if service is supported.

Parameters:

service (str) – expandable list of service names of UNO services such as com.sun.star.text.TextFrame.

Returns:

True if service is supported; Otherwise, False.

Return type:

bool

property prop_format_kind: Any

Gets the kind of style

Return type:

Any

property prop_has_attribs: Any

Gets If instance has any attributes set.

Return type:

Any

property prop_has_backup: Any

Gets If instance has backup data set.

Return type:

Any