ooodev.format.writer.direct.para.text_flow package

Module contents

class ooodev.format.writer.direct.para.text_flow.Breaks(*, type=None, style=None, num=None)[source]

Bases: StyleBase

Paragraph Breaks

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

New in version 0.9.0.

__init__(*, type=None, style=None, num=None)[source]

Constructor

Parameters:
  • type (BreakType, optional) – Break type.

  • style (str, optional) – Style to apply to break.

  • num (int, optional) – Page number to apply to break.

Return type:

None

Note

If argument type is None then all other argument are ignored

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

Applies break properties to obj

Parameters:

obj (object) – UNO object that supports com.sun.star.style.ParagraphProperties service.

Return type:

None

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:

NotSupportedError – If obj is not supported.

Returns:

Breaks instance that represents obj break properties.

Return type:

Breaks

property default: _TBreaks

Gets Breaks default.

Return type:

TypeVar(_TBreaks, bound= Breaks)

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_num: int | None

Gets Page number to apply to break

Return type:

int | None

property prop_style: str | None

Gets Break Style

Return type:

str | None

property prop_type: BreakType | None

Gets break type

Return type:

BreakType | None

class ooodev.format.writer.direct.para.text_flow.FlowOptions(*, orphans=None, widows=None, keep=None, no_split=None)[source]

Bases: StyleBase

Paragraph Text Flow Options

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__(*, orphans=None, widows=None, keep=None, no_split=None)[source]

Constructor

Parameters:
  • orphans (int, optional) – Number of Orphan Control Lines.

  • widows (int, optional) – Number Widow Control Lines.

  • keep (bool, optional) – Keep with next paragraph.

  • no_split (bool, optional) – Do not split paragraph.

Return type:

None

Note

When orphans or Windows argument is present then the no_split has no effect.

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

Applies writing mode to obj

Parameters:

obj (object) – UNO object that supports com.sun.star.style.ParagraphProperties service.

Return type:

None

fmt_keep(value)[source]

Gets a copy of instance with keep set or removed

Parameters:
  • value (bool | None) – keep value.

  • self (_TFlowOptions) –

Returns:

FlowOptions instance

Return type:

FlowOptions

fmt_no_split(value)[source]

Gets a copy of instance with no split set or removed

Parameters:
  • value (bool | None) – no split value.

  • self (_TFlowOptions) –

Returns:

FlowOptions instance

Return type:

FlowOptions

fmt_orphans(value)[source]

Gets a copy of instance with orphans set or removed

Parameters:
  • value (float | None) – orphans value.

  • self (_TFlowOptions) –

Returns:

FlowOptions instance

Return type:

FlowOptions

fmt_widows(value)[source]

Gets a copy of instance with widows set or removed

Parameters:
  • value (float | None) – widows value (in mm units).

  • self (_TFlowOptions) –

Returns:

FlowOptions instance

Return type:

FlowOptions

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:

NotSupportedError – If obj is not supported.

Returns:

FlowOptions instance that represents obj writing mode.

Return type:

WritingMode

on_property_setting(source, event_args)[source]

Subscribe to property setting events

Parameters:
  • event_args (KeyValueCancelArgs) – Event Args

  • source (Any) –

property default: _TFlowOptions

Gets FlowOptions default.

Return type:

TypeVar(_TFlowOptions, bound= FlowOptions)

property keep: _TFlowOptions

Gets copy of instance with keep set

Return type:

TypeVar(_TFlowOptions, bound= FlowOptions)

property no_split: _TFlowOptions

Gets copy of instance with no split set

Return type:

TypeVar(_TFlowOptions, bound= FlowOptions)

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_keep: bool | None

Gets/Sets Keep with next paragraph.

Return type:

bool | None

property prop_no_split: bool | None

Gets/Sets Do not split paragraph

Return type:

bool | None

property prop_orphans: int | None

Gets/Sets Number of Orphan Control Lines.

Return type:

int | None

property prop_widows: int | None

Gets/Sets Number Widow Control Lines.

Return type:

int | None

class ooodev.format.writer.direct.para.text_flow.Hyphenation(*, auto=None, no_caps=None, start_chars=None, end_chars=None, max=None)[source]

Bases: StyleBase

Paragraph Hyphenation

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__(*, auto=None, no_caps=None, start_chars=None, end_chars=None, max=None)[source]

Constructor

Parameters:
  • auto (bool, optional) – Hyphenate automatically.

  • no_caps (bool, optional) – Don’t hyphenate word in caps.

  • start_chars (int, optional) – Characters at line begin.

  • end_chars (int, optional) – characters at line end.

  • max (int, optional) – Maximum consecutive hyphenated lines.

Return type:

None

Note

If argument auto is False then all other argument have no effect.

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

Applies hyphenation properties to obj

Parameters:

obj (object) – UNO object that supports com.sun.star.style.ParagraphProperties service.

Return type:

None

fmt_auto(value)[source]

Gets copy of instance with auto set or removed

Parameters:
  • value (bool | None) – auto value

  • self (_THyphenation) –

Returns:

Hyphenation instance

Return type:

Hyphenation

fmt_end_chars(value)[source]

Gets copy of instance with end chars set or removed

Parameters:
  • value (bool | None) – end chars value

  • self (_THyphenation) –

Returns:

Hyphenation instance

Return type:

Hyphenation

fmt_max_chars(value)[source]

Gets copy of instance with max set or removed

Parameters:
  • value (bool | None) – max value

  • self (_THyphenation) –

Returns:

Hyphenation instance

Return type:

Hyphenation

fmt_no_caps(value)[source]

Gets copy of instance with no caps set or removed

Parameters:
  • value (bool | None) – no caps value

  • self (_THyphenation) –

Returns:

Hyphenation instance

Return type:

Hyphenation

fmt_start_chars(value)[source]

Gets copy of instance with start chars set or removed

Parameters:
  • value (bool | None) – start chars value

  • self (_THyphenation) –

Returns:

Hyphenation instance

Return type:

Hyphenation

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:

NotSupportedError – If obj is not supported.

Returns:

Hyphenation instance that represents obj hyphenation properties.

Return type:

Hyphenation

property auto: _THyphenation

Gets instance with Hyphenate automatically set to True.

Return type:

TypeVar(_THyphenation, bound= Hyphenation)

property default: _THyphenation

Gets Hyphenation default. Static Property.

Return type:

TypeVar(_THyphenation, bound= Hyphenation)

property no_caps: _THyphenation

Gets instance with no caps set to True.

Return type:

TypeVar(_THyphenation, bound= Hyphenation)

property prop_auto: bool | None

Gets/Sets Hyphenate automatically.

Return type:

bool | None

property prop_end_chars: int | None

Gets/Sets number of characters at line end.

Return type:

int | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_max: int | None

Gets/Sets maximum consecutive hyphenated lines.

Return type:

int | None

property prop_no_caps: bool | None

Gets/Sets if hyphenate word in caps.

Return type:

bool | None

property prop_start_chars: int | None

Gets/Sets number of characters at line begin.

Return type:

int | None