ooodev.format.inner.direct.structs.size_struct module

class ooodev.format.inner.direct.structs.size_struct.SizeStruct(width=0.0, height=0.0, all=None)[source]

Bases: StructBase

Size struct.

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together Border Table properties.

__init__(width=0.0, height=0.0, all=None)[source]

Constructor

Parameters:
  • width (float, UnitT, optional) – Specifies width crop in mm units or Class UnitT. Default 0.0.

  • height (float, UnitT, optional) – Specifies height crop in mm units or Class UnitT. Default 0.0.

  • all (float, UnitT, optional) – Specifies width and height in mm units or Class UnitT. If set all other parameters are ignored.

Return type:

None

apply(obj: Any)[source]
apply(obj, **kwargs)

Applies tab properties to obj

Parameters:

obj (object) – UNO object.

Return type:

None

fmt_all(value)[source]

Gets copy of instance with width and height set.

Parameters:
  • value (float, UnitT) – Specifies crop in mm units or Class UnitT.

  • self (_TSizeStruct) –

Returns:

Border Table

Return type:

SizeStruct

fmt_height(value)[source]

Gets a copy of instance with height set.

Parameters:
  • value (float, UnitT) – Specifies height in mm units or Class UnitT.

  • self (_TSizeStruct) –

Return type:

SizeStruct

fmt_width(value)[source]

Gets a copy of instance with width set.

Parameters:
  • value (float, UnitT) – Specifies width in mm units or Class UnitT.

  • self (_TSizeStruct) –

Return type:

SizeStruct

classmethod from_obj(obj)[source]
classmethod from_obj(obj, **kwargs)
classmethod from_obj(obj, **kwargs)

Gets instance from object

Parameters:

obj (object) – UNO object

Raises:

PropertyNotFoundError – If obj does not have required property

Returns:

SizeStruct instance that represents obj Size properties.

Return type:

SizeStruct

classmethod from_uno_struct(value)[source]
classmethod from_uno_struct(value, **kwargs)
classmethod from_uno_struct(value, **kwargs)

Converts a Size instance to a SizeStruct.

Parameters:

value (Size) – UNO Size.

Returns:

SizeStruct set with Size properties.

Return type:

SizeStruct

get_uno_struct()[source]

Gets UNO Size from instance.

Returns:

Size instance

Return type:

Size

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_height: UnitMM

Gets/Sets height value in mm units.

Return type:

UnitMM

property prop_width: UnitMM

Gets/Sets width value in mm units.

Return type:

UnitMM