Class GraphicObjectShape

class ooodev.draw.shapes.GraphicObjectShape(owner, component, lo_inst=None)[source]

Bases: ShapeBase, GraphicObjectShapeComp, Generic[_T], ShapePartialProps, PropertyChangeImplement, VetoableChangeImplement, DrawShapePartial, QiPartial, PropPartial, StylePartial

__init__(owner, component, lo_inst=None)[source]

Constructor.

Parameters:
  • lo_inst (LoInst, optional) – Lo instance.

  • owner (_T) –

  • component (XShape) –

Return type:

None

add_event_observers(*args)

Adds observers that gets their trigger method called when this class trigger method 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.

add_event_property_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_property_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_text(msg, font_size=0, **props)

Add text to a shape

Parameters:
  • msg (str) – Text to add

  • font_size (int, optional) – Font size.

  • props (Any, optional) – Any extra properties that will be applied to cursor (font) such as CharUnderline=1

Raises:

ShapeError – If error occurs.

Return type:

None

apply_styles(*styles, **kwargs)

Applies style to component.

Parameters:
  • obj. (styles expandable list of styles object such as Font to apply to) –

  • kwargs (Any, optional) – Expandable list of key value pairs.

  • styles (StyleT) –

Return type:

None

clone()[source]

Clones the shape.

Return type:

GraphicObjectShape[TypeVar(_T, bound= ComponentT)]

create_text_cursor()

Creates a new text cursor.

Returns:

The new text cursor.

Return type:

XTextCursor

create_text_cursor_by_range(text_position)

The initial position is set to text_position.

Parameters:

text_position (XTextRange) – The initial position of the new text cursor.

Returns:

The new text cursor.

Return type:

XTextCursor

export_shape_jpg(fnm, resolution=96)

Exports shape as jpg image.

Parameters:
  • fnm (PathOrStr, optional) – Image file name.

  • resolution (int, optional) – Resolution in dpi. Defaults to 96.

Events:
Return type:

None

Note

On exporting event is Class CancelEventArgsExport. On exported event is Class EventArgsExport. Args event_data is a ExportJpgT dictionary.

If fnm is not specified, the image file name is created based on the document name and page number and written to the same folder as the document.

export_shape_png(fnm, resolution=96)

Exports shape as png image.

Parameters:
  • fnm (PathOrStr, optional) – Image file name.

  • resolution (int, optional) – Resolution in dpi. Defaults to 96.

Events:
Return type:

None

Note

On exporting event is Class CancelEventArgsExport. On exported event is Class EventArgsExport. Args event_data is a ExportPngT dictionary.

If fnm is not specified, the image file name is created based on the document name and page number and written to the same folder as the document.

When page is exported as png, such as an impress slide, any images on the will not be exported if filter translucent=True. For this reason, the default value for translucent is False.

get_end()

Returns a text range which contains only the end of this text range.

Return type:

TextRangeComp

get_glue_points()

Gets Glue Points.

Raises:

DrawError – If error occurs.

Returns:

Glue Points.

Return type:

Tuple[GluePoint2, …]

Note

If a glue point can not be accessed then it is ignored.

get_lo_inst()
Return type:

LoInst

get_owner()
Return type:

TypeVar(_T, bound= ComponentT)

get_position()

Gets the position of the shape in 100th mm units.

Returns:

The position of the shape.

Return type:

Point

get_position_mm()

Gets position in mm units

Raises:

PointError – If error occurs.

Returns:

Position as Point in mm units

Return type:

Point

get_property(name, default=<object object>)

Get property value

Parameters:
  • name (str) – Property Name.

  • default (Any, optional) – Return value if property value is None.

Returns:

Property value or default.

Return type:

Any

get_rotation()

Gets the rotation of a shape

Parameters:

shape (XShape) – Shape

Raises:

ShapeError – If error occurs.

Returns:

Rotation angle.

Return type:

Angle

get_services()

Gets service names for the instance.

Returns:

service names

Return type:

List[str]

get_shape_text()

Gets the text from inside a shape.

Raises:

DrawError – If error occurs getting shape text.

Returns:

Shape text

Return type:

str

get_shape_text_cursor()

Gets a cursor object for this text.

Returns:

Cursor.

Return type:

ShapeTextCursor

get_shape_type()[source]

Returns the shape type of com.sun.star.drawing.GraphicObjectShape.

Return type:

str

get_size()

Gets the size of the shape in 100th mm units.

Returns:

The size of the shape.

Return type:

Size

get_size_mm()

Gets Size in mm units.

Raises:

SizeError – If error occurs.

Returns:

Size in mm units

Return type:

Size

get_start()

Returns a text range which contains only the start of this text range.

Return type:

TextRangeComp

get_string()

Returns the string of this text range.

Return type:

str

get_text()

Gets the text of the range.

Returns:

The text of the range.

Return type:

XText

get_text_properties()

Gets the properties associated with the text area inside the shape.

Raises:

PropertySetError – If error occurs.

Returns:

Property Set

Return type:

XPropertySet

get_transformation()

Gets a transformation matrix which seems to represent a clockwise rotation.

Homogeneous matrix has three homogeneous lines

Raises:

ShapeError – If error occurs.

Returns:

Matrix

Return type:

HomogenMatrix3

get_zorder()

Gets the z-order of a shape

Raises:

DrawError – If unable to get z-order.

Returns:

Z-Order

Return type:

int

insert_control_character(rng, control_character, absorb)

Inserts a control character (like a paragraph break or a hard space) into the text.

Parameters:
  • rng (XTextRange) – The position of the new control character.

  • control_character (ControlCharacterEnum) – The control character to be inserted.

  • absorb (bool) – If TRUE the text range will contain the new inserted control character, otherwise the range (and it’s text) will remain unchanged.

Raises:

IllegalArgumentExceptioncom.sun.star.lang.IllegalArgumentException

Return type:

None

insert_string(rng, text, absorb)

Inserts a string of characters into the text.

The string may contain the following white spaces:

If the parameter bAbsorb() was TRUE the text range will contain the new inserted string, otherwise the range (and it’s text) will remain unchanged.

Return type:

None

Parameters:
  • rng (XTextRange) –

  • text (str) –

  • absorb (bool) –

insert_text_content(rng, content, absorb)

Inserts a content, such as a text table, text frame or text field.

Parameters:
  • rng (XTextRange) – The position at which the content is inserted.

  • content (XTextContent) – The content to be inserted.

  • absorb (bool) – Specifies whether the text spanned by xRange will be replaced. If True then the content of range will be replaced by content, otherwise content will be inserted at the end of xRange.

Return type:

None

is_group()

Gets if a shape is a Group Shape

Returns:

True if shape is a group; Otherwise; False.

Return type:

bool

is_image()

Gets if a shape is an image (GraphicObjectShape).

Returns:

True if shape is image; Otherwise, False.

Return type:

bool

move_to_bottom()

Moves the shape to the bottom of the z-order

Raises:
Return type:

None

move_to_top()

Moves the shape to the top of the z-order

Raises:
Return type:

None

qi(atype, raise_err=False)

Generic method that get an interface instance from an object.

Parameters:
  • atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface

  • raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False

Raises:

MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None

Returns:

instance of interface if supported; Otherwise, None

Return type:

T | None

Note

When raise_err=True return value will never be None.

remove_event_observer(observer)

Removes an observer

Parameters:

observer (EventObserver) – One or more observers to add.

Returns:

True if observer has been removed; Otherwise, False.

Return type:

bool

remove_event_property_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_property_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_text_content(content)

Removes a text content.

Parameters:

content (XTextContent) – the content that is to be removed.

Return type:

None

set_angle(angle)

Set the line style for a shape

Parameters:

angle (Angle | int) – Angle to set.

Raises:

ShapeError – If error occurs.

Return type:

None

set_bitmap_color(name)

Set bitmap color of a shape.

Parameters:

name (DrawingBitmapKind, str) – Bitmap Name

Raises:
  • NameError – If name is not recognized.

  • ShapeError – If any other error occurs.

Return type:

None

Note

Getting the bitmap color name can be a bit challenging. DrawingBitmapKind contains name displayed in the Bitmap color menu of Draw.

The Easiest way to get the colors is to open Draw and see what bitmap color names are available on your system.

set_bitmap_file_color(fnm)

Set bitmap color from file.

Parameters:

fnm (PathOrStr) – path to file.

Raises:

ShapeError – If error occurs.

Return type:

None

set_dashed_line(is_dashed)

Set a dashed line

Parameters:

is_dashed (bool) – Determines if line is to be dashed or solid.

Raises:

ShapeError – If error occurs.

Return type:

None

set_gradient_color(*args, **kwargs)

Set the gradient color of the shape.

Parameters:
Raises:
  • NameError – If name is not recognized.

  • ShapeError – If any other error occurs.

Returns:

Gradient instance that just had properties set.

Return type:

Gradient

Note

When using Gradient Name.

Getting the gradient color name can be a bit challenging. DrawingGradientKind contains name displayed in the Gradient color menu of Draw.

The Easiest way to get the colors is to open Draw and see what gradient color names are available on your system.

set_gradient_properties(grad)

Sets shapes gradient properties.

Parameters:

grad (Gradient) – Gradient properties to set.

Return type:

None

set_hatch_color(name)

Set hatching color of a shape.

Parameters:

name (DrawingHatchingKind, str) – Hatching Name.

Raises:
  • NameError – If name is not recognized.

  • ShapeError – If any other error occurs.

Return type:

None

Note

Getting the hatching color name can be a bit challenging. DrawingHatchingKind contains name displayed in the Hatching color menu of Draw.

The Easiest way to get the colors is to open Draw and see what gradient color names are available on your system.

set_image(fnm)

Sets the image of a shape.

Parameters:

fnm (PathOrStr) – Path to image.

Raises:

ShapeError – If error occurs.

Return type:

None

set_image_graphic(graphic)

Sets the image of a shape.

Parameters:

graphic (XGraphic) – Graphic.

Raises:

ShapeError – If error occurs.

Return type:

None

set_line_style(style)

Set the line style for a shape.

Parameters:

style (LineStyle) – Line Style.

Raises:

ShapeError – If error occurs.

Return type:

None

set_position(*args, **kwargs)

Sets Position of shape.

Parameters:
  • pt (point) – Point that contains x and y positions in mm units.

  • x (int, UnitT) – X position in mm units or UnitT.

  • y (int, UnitT) – Y Position in mm units or UnitT.

Raises:

ShapeError – If error occurs.

Return type:

None

set_property(**kwargs)

Set property value

Parameters:

**kwargs (Any) – Variable length Key value pairs used to set properties.

Return type:

None

set_props(**props)

Sets properties on a shape.

Parameters:

props (Any) – Key value pairs of property name and property value

Raises:
Return type:

None

Example

set_props(Loop=True, MediaURL=FileIO.fnm_to_url(fnm))
set_rotation(angle)

Set the rotation of a shape.

Parameters:

angle (Angle | int) – Angle or int. An angle value from 0 to 359.

Raises:

ShapeError – If error occurs.

Return type:

None

set_size(*args, **kwargs)

Sets set_size of shape.

Parameters:
  • sz (Size) – Size that contains width and height positions in mm units.

  • width (int, UnitT) – Width position in mm units or UnitT.

  • height (int, UnitT) – Height position in mm units or UnitT.

Raises:

ShapeError – If error occurs.

Return type:

None

set_string(string)

Sets the string of this text range.

The whole string of characters of this piece of text is replaced. All styles are removed when applying this method.

Return type:

None

Parameters:

string (str) –

set_style(graphic_styles, style_name)

Set the graphic style for a shape.

Parameters:
  • graphic_styles (XNameContainer) – Graphic styles.

  • style_name (GraphicStyleKind | str) – Graphic Style Name.

Raises:

DrawError – If error occurs.

Return type:

None

set_transparency(level)

Sets the transparency level for the shape. Higher level means more transparent.

Parameters:

level (Intensity, int) – Transparency value. Represents a intensity value from 0 to 100.

Raises:

ShapeError – If error occurs.

Return type:

None

set_visible(is_visible)

Set the line style for a shape.

Parameters:

is_visible (bool) – Set is shape is visible or not.

Raises:

ShapeError – If error occurs.

Return type:

None

set_zorder(order)

Sets the z-order of a shape.

Parameters:

order (int) – Z-Order.

Raises:

DrawError – If unable to set z-order.

Return type:

None

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

subscribe_event_shape_jpg_exported(callback)

Add an event listener to current instance that is triggered on export complete.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

subscribe_event_shape_jpg_exporting(callback)

Add an event listener to current instance that is triggered on exporting.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

subscribe_event_shape_png_exported(callback)

Add an event listener to current instance that is triggered on export complete.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportPngT]], None]) – Callback of the event listener.

Return type:

None

subscribe_event_shape_png_exporting(callback)

Add an event listener to current instance that is triggered on exporting.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportPngT]], None]) – Callback of the event listener.

Return type:

None

support_service(*service)

Gets if instance supports a service.

Parameters:

*service (str) – Variable length argument list of UNO namespace strings such as com.sun.star.configuration.GroupAccess

Returns:

True if instance supports any passed in service; Otherwise, False

Return type:

bool

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

unsubscribe_event_shape_jpg_exported(callback)

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

unsubscribe_event_shape_jpg_exporting(callback)

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

unsubscribe_event_shape_png_exported(callback)

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportPngT]], None]) – Callback of the event listener.

Return type:

None

unsubscribe_event_shape_png_exporting(callback)

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportPngT]], None]) – Callback of the event listener.

Return type:

None

property border_distance: UnitMM100 | None

Gets/Sets the distance from the border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property bottom_border: BorderLine2StructComp | None

Gets/Sets the bottom border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property bottom_border_distance: UnitMM100 | None

Gets/Sets the distance from the bottom border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property break_type: BreakType | None

Gets/Sets the type of break that is applied at the beginning of the table.

optional

Returns:

Returns BreakType or None if not supported.

Return type:

BreakType | None

Hint

  • BreakType can be imported from ooo.dyn.style.break_type

property char_auto_kerning: bool | None

Gets/Sets - This optional property determines whether the kerning tables from the current font are used.

Automatic kerning applies a spacing in between certain pairs of characters to make the text look better.

Optional

Return type:

bool | None

property char_back_color: Color | None

Get/Sets - This optional property contains the text background color.

Optional

Returns:

Color or None if not supported.

Return type:

Color | None

property char_back_transparent: bool | None

Gets/Sets if the text background color is set to transparent.

Optional

Return type:

bool | None

property char_border_distance: UnitMM100 | None

Gets/Sets the distance from the border to the object.

When setting the value, it can be either a float or an instance of UnitT.

Optional

Return type:

UnitMM100 | None

property char_bottom_border: BorderLine2StructComp | None

This property contains the bottom border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_bottom_border_distance: UnitMM100 | None

This property contains the distance from the bottom border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_case_map: int | None

Gets/Sets - This optional property contains the value of the case-mapping of the text for formatting and displaying.

optional

Return type:

int | None

property char_color: Color

This property contains the value of the text color.

Returns:

Color

Return type:

Color

property char_color_theme: int | None

Gets/Sets - If available, keeps the color theme index, so that the character can be re-colored easily based on a theme.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_color_tint_or_shade: int | None

Gets/Sets the tint or shade of the character color.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_combine_is_on: bool | None

Gets/Sets - This optional property determines whether text is formatted in two lines.

It is linked to the properties char_combine_prefix and char_combine_suffix.

optional

Return type:

bool | None

property char_combine_prefix: str | None

Gets/Sets - This optional property contains the prefix (usually parenthesis) before text that is formatted in two lines.

It is linked to the properties char_combine_is_on and char_combine_suffix.

optional

Return type:

str | None

property char_combine_suffix: str | None

Gets/Sets - This optional property contains the suffix (usually parenthesis) after text that is formatted in two lines.

It is linked to the properties CharCombineIsOn and CharCombinePrefix.

optional

Return type:

str | None

property char_contoured: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a contour effect.

optional

Return type:

bool | None

property char_crossed_out: bool | None

Gets/Sets - This property is True if the characters are crossed out.

optional

Return type:

bool | None

property char_emphasis: int | None

Gets/Sets - This optional property contains the font emphasis value.

optional

Return type:

int | None

property char_escapement: int | None

Gets/Sets the percentage by which to raise/lower superscript/subscript characters.

Negative values denote subscripts and positive values superscripts.

optional

Return type:

int | None

property char_escapement_height: int | None

Gets/Sets - This is the relative height used for subscript or superscript characters in units of percent.

The value 100 denotes the original height of the characters.

optional

Return type:

int | None

property char_flash: bool | None

Gets/Sets - If this optional property is True, then the characters are flashing.

optional

Return type:

bool | None

property char_font_char_set: int

Gets/Sets - This property contains the text encoding of the font.

Return type:

int

property char_font_family: int

Get/Sets the font family.

Return type:

int

property char_font_name: str

Gets/Sets the name of the font style.

It may contain more than one name separated by comma.

Return type:

str

property char_font_pitch: int

Gets/Sets the font pitch.

Return type:

int

property char_font_style_name: str

Gets/Sets the name of the font style.

This property may be empty.

Return type:

str

property char_font_type: int | None

Gets/Sets - This optional property specifies the fundamental technology of the font.

optional

Return type:

int | None

property char_height: UnitPT

Gets/Sets - This value contains the height of the characters in point.

When setting the value can be a float (in points) or a UnitT instance.

Return type:

UnitPT

property char_hidden: bool | None

Gets/Sets - If this optional property is True, then the characters are invisible.

optional

Return type:

bool | None

property char_highlight: Color | None

Gets/Sets the color of the highlight.

optional

Returns:

Color

Return type:

Color

property char_interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of character properties, used as a string-any map for interim interop purposes.

This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

Optional

Return type:

Tuple[PropertyValue, …] | None

property char_keep_together: bool | None

Gets/Sets - This optional property marks a range of characters to prevent it from being broken into two lines.

A line break is applied before the range of characters if the layout makes a break necessary within the range.

optional

Return type:

bool | None

property char_kerning: int | None

Gets/Sets - This optional property contains the value of the kerning of the characters.

optional

Return type:

int | None

property char_left_border: BorderLine2StructComp | None

Gets/Sets - This property contains the left border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_left_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the left border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_locale: Locale

Gets/Sets - This property contains the value of the locale.

Return type:

Locale

property char_no_hyphenation: bool | None

Gets/Sets - This optional property determines if the word can be hyphenated at the character.

optional

Return type:

bool | None

property char_no_line_break: bool | None

Gets/Sets - This optional property marks a range of characters to ignore a line break in this area.

A line break is applied behind the range of characters if the layout makes a break necessary within the range. That means that the text may go through the border.

optional

Return type:

bool | None

property char_posture: FontSlant

Gets/Sets - This property contains the value of the posture of the document.

Returns:

Returns FontSlant

Return type:

FontSlant

Hint

  • FontSlant can be imported from ooo.dyn.awt.font_slant

property char_relief: int | None

Gets/Sets - This optional property contains the relief style of the characters.

optional

Return type:

int | None

property char_right_border: BorderLine2StructComp | None

Gets/Sets - This property contains the right border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_right_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the right border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_rotation: Angle10 | None

Gets/Sets - This optional property determines the rotation of a character in tenths of a degree.

Depending on the implementation only certain values may be allowed.

optional

Returns:

Returns Angle10, 1/10th degrees, or None if not supported.

Return type:

Angle10

Hint

  • Angle10 can be imported from ooodev.units

property char_rotation_is_fit_to_line: bool | None

Gets/Sets - This optional property determines whether the text formatting tries to fit rotated text into the surrounded line height.

optional

Return type:

bool | None

property char_scale_width: int | None

Gets/Sets - This optional property determines the percentage value for scaling the width of characters.

The value refers to the original width which is denoted by 100, and it has to be greater than 0.

optional

Return type:

int | None

property char_shading_value: int | None

Gets/Sets - This optional property contains the text shading value.

optional

Return type:

int | None

property char_shadow_format: ShadowFormatStructComp | None

Gets/Sets the type, color, and width of the shadow.

When setting the value can be an instance of ShadowFormatStructComp or ShadowFormat.

optional

Returns:

Shadow Format or None if not supported.

Return type:

ShadowFormatStructComp

Hint

  • ShadowFormat can be imported from ooo.dyn.table.shadow_format

property char_shadowed: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a shadow effect.

optional

Return type:

bool | None

property char_strikeout: FontStrikeoutEnum | None

Gets/Sets - This property determines the type of the strike out of the character.

optional

Returns:

Returns FontStrikeoutEnum or None if not supported.

Return type:

FontStrikeoutEnum | None

Hint

  • FontStrikeoutEnum can be imported from ooo.dyn.awt.font_strikeout

property char_style_name: str | None

Gets/Sets - This optional property specifies the name of the style of the font.

optional

Return type:

str | None

property char_style_names: Tuple[str, ...] | None

Gets/Sets - This optional property specifies the names of the all styles applied to the font.

It is not guaranteed that the order in the sequence reflects the order of the evaluation of the character style attributes.

Optional

Return type:

Tuple[str, …] | None

property char_top_border: BorderLine2StructComp | None

Gets/Sets - This property contains the top border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_top_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the top border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_transparence: int | None

Gets/Sets - This is the transparency of the character text.

The value 100 means entirely transparent, while 0 means not transparent at all.

optional

Return type:

int | None

property char_underline: FontUnderlineEnum

This property contains the value for the character underline.

Return type:

FontUnderlineEnum

property char_underline_color: Color

Gets/Sets the color of the underline for the characters.

Returns:

Color

Return type:

Color

property char_underline_has_color: bool

Gets/Sets if the property char_underline_color is used for an underline.

Return type:

bool

property char_weight: float

Gets/Sets the value of the font weight.

Example

from com.sun.star.awt import FontWeight

my_char_properties.char_weight = FontWeight.BOLD
Return type:

float

property char_word_mode: bool | None

Gets/Sets - If this property is True, the underline and strike-through properties are not applied to white spaces.

optional

Return type:

bool | None

property component: XShape

Gets the component.

Return type:

XShape

property continuing_previous_sub_tree: bool | None

Gets that a child node of a parent node that is not counted is continuing the numbering of parent’s previous node’s sub tree.

optional

Return type:

bool | None

property drop_cap_char_style_name: str | None

Gets/Sets the character style name for drop caps.

optional

Return type:

str | None

property drop_cap_format: DropCapFormatStructComp | None

Gets/Sets whether the first characters of the paragraph are displayed in capital letters and how they are formatted.

optional

Returns:

Drop cap format or None if not supported.

Return type:

DropCapFormatStructComp

Hint

  • DropCapFormat can be imported from ooo.dyn.style.drop_cap_format

property drop_cap_whole_word: bool | None

Gets/Sets if the property DropCapFormat is applied to the whole first word.

optional

Return type:

bool | None

property event_observer: EventObserver

Gets/Sets The Event Observer for this instance.

Return type:

EventObserver

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:

TheDict

Gets/Sets - This optional property contains the name of the hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the name of the target for a hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the URL of a hyperlink.

optional

Return type:

str | None

Gets/Sets, this property lets you get and set a hyperlink for this shape.

optional

Return type:

str | None

property interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of shape properties, used as a string-any map for interim interop purposes. This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

optional

Return type:

Tuple[PropertyValue, …] | None

property layer_id: int | None

Gets/Sets the ID of the Layer to which this Shape is attached.

optional

Return type:

int | None

property layer_name: str | None

Gets/Sets the name of the Layer to which this Shape is attached.

optional

Return type:

str | None

property left_border: BorderLine2StructComp | None

Gets/Sets the left border of the object.

optional

Return type:

BorderLine2StructComp | None

property left_border_distance: UnitMM100 | None

Gets/Sets the distance from the left border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property list_id: str | None

Gets/Sets the id of the list to which the paragraph belongs.

optional

Return type:

str | None

property list_label_string: str | None

Gets reading the generated numbering list label.

optional

Return type:

str | None

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property move_protect: bool | None

Gets/Sets, With this set to True, this Shape cannot be moved interactively in the user interface.

optional

Return type:

bool | None

property name: str | None

Gets/Sets the name of this Shape.

Return type:

str | None

property navigation_order: int | None

Gets/Sets, this property stores the navigation order of this shape. If this value is negative, the navigation order for this shapes page is equal to the z-order.

optional

Return type:

int | None

property numbering_is_number: bool | None

Gets/Sets.

Returns False if the paragraph is part of a numbering, but has no numbering label.

A paragraph is part of a numbering, if a style for a numbering is set - see numbering_style_name. If the paragraph is not part of a numbering the property is void.

optional

Return type:

bool | None

property numbering_level: int | None

Gets/Sets the numbering level of the paragraph.

optional

Return type:

int | None

property numbering_rules: IndexReplaceComp | None

Gets/Sets the numbering rules applied to this paragraph.

When setting the value, it can be either an instance of XIndexReplace or IndexReplaceComp.

optional

Return type:

IndexReplaceComp | None

property numbering_start_value: int | None

Gets/Sets the start value for numbering if a new numbering starts at this paragraph.

optional

Return type:

int | None

property numbering_style_name: str | None

Gets/Sets the name of the style for the numbering.

The name must be one of the names which are available via XStyleFamiliesSupplier.

optional

Return type:

str | None

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property outline_level: int | None

Gets/Sets the outline level to which the paragraph belongs

Value 0 indicates that the paragraph belongs to the body text.

Values [1..10] indicates that the paragraph belongs to the corresponding outline level.

optional

Return type:

int | None

property owner: _T

Component Owner

Return type:

TypeVar(_T, bound= ComponentT)

property page_desc_name: str | None

If this property is set, it creates a page break before the paragraph it belongs to and assigns the value as the name of the new page style sheet to use.

optional

Return type:

str | None

property page_number_offset: int | None

Gets/Sets if a page break property is set at a paragraph, this property contains the new value for the page number.

optional

Return type:

int | None

property page_style_name: str | None

Gets the name of the current page style.

optional

Return type:

str | None

property para_adjust: ParagraphAdjust

Gets/Sets the adjustment of a paragraph.

Returns:

Paragraph adjustment.

Return type:

ParagraphAdjust

Hint

  • ParagraphAdjust can be imported from ooo.dyn.style.paragraph_adjust

property para_back_color: Color | None

Gets/Sets the paragraph background color.

optional

Returns:

Color or None if not supported.

Return type:

Color | None

property para_back_graphic: XGraphic | None

Gets/Sets the graphic for the background of a paragraph.

optional

Return type:

XGraphic | None

property para_back_graphic_filter: str | None

Gets/Sets the name of the graphic filter for the background graphic of a paragraph.

optional

Return type:

str | None

property para_back_graphic_location: GraphicLocation | None

Gets/Sets the value for the position of a background graphic.

optional

Returns:

Returns GraphicLocation or None if not supported.

Return type:

GraphicLocation | None

Hint

  • GraphicLocation can be imported from ooo.dyn.style.graphic_location

property para_back_graphic_url: str | None

Gets/Sets the value of a link for the background graphic of a paragraph.

Note the new behavior since it this was deprecated: This property can only be set and only external URLs are supported (no more vnd.sun.star.GraphicObject scheme). When an URL is set, then it will load the graphic and set the ParaBackGraphic property.

optional

Return type:

str | None

property para_back_transparent: bool | None

Gets/Sets if the paragraph background color is set to transparent.

This value is True if the paragraph background color is set to transparent.

optional

Return type:

bool | None

property para_bottom_margin: UnitMM100

Gets/Sets the bottom margin of the paragraph in 100th mm.

The distance between two paragraphs is specified by:

The greater one is chosen.

This property accepts int and UnitT types when setting.

Return type:

UnitMM100

property para_context_margin: bool | None

Gets/Sets if contextual spacing is used.

If True, the top and bottom margins of the paragraph should not be applied when the previous and next paragraphs have the same style.

optional

Return type:

bool | None

property para_expand_single_word: bool | None

Gets/Sets if single words are stretched.

It is only valid if para_adjust and para_last_line_adjust are also valid.

optional

Return type:

bool | None

property para_first_line_indent: int | None

Gets/Sets the indent for the first line.

optional

Return type:

int | None

property para_hyphenation_max_hyphens: int | None

Gets/Sets the maximum number of consecutive hyphens.

optional

Return type:

int | None

property para_hyphenation_max_leading_chars: int | None

Gets/Sets the minimum number of characters to remain before the hyphen character (when hyphenation is applied).

Note

Confusingly it is named Max but specifies a minimum.

optional

Return type:

int | None

property para_hyphenation_max_trailing_chars: int | None

Gets/Sets the minimum number of characters to remain after the hyphen character (when hyphenation is applied).

optional

Note

Confusingly it is named Max but specifies a minimum.

Return type:

int | None

property para_hyphenation_min_word_length: int | None

Gets/Sets the minimum word length in characters, when hyphenation is applied.

since

LibreOffice 7.4

optional

Return type:

int | None

property para_hyphenation_no_caps: bool | None

Specifies whether words written in CAPS will be hyphenated.

Setting to true will disable hyphenation of words written in CAPS for this paragraph.

optional

Return type:

bool | None

property para_hyphenation_no_last_word: bool | None

Specifies whether last word of paragraph will be hyphenated.

Setting to true will disable hyphenation of last word for this paragraph.

since

LibreOffice 7.4

optional

Return type:

bool | None

property para_hyphenation_zone: int | None

Gets/Sets the hyphenation zone, i.e. allowed extra white space in the line before applying hyphenation.

since

LibreOffice 7.4

optional

Return type:

int | None

property para_interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of paragraph properties, used as a string-any map for interim interop purposes.

This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

optional:

Return type:

Tuple[PropertyValue, …] | None

property para_is_auto_first_line_indent: bool | None

Gets/Sets if the first line should be indented automatically.

optional

Return type:

bool | None

property para_is_connect_border: bool | None

Gets/Sets if borders set at a paragraph are merged with the next paragraph.

Borders are only merged if they are identical.

optional

Return type:

bool | None

property para_is_hyphenation: bool

Gets/Sets if automatic hyphenation is applied.

Return type:

bool

property para_is_numbering_restart: bool | None

Gets/Sets if the numbering rules restart, counting at the current paragraph.

optional

Return type:

bool | None

property para_keep_together: bool | None

Gets/Sets if page or column breaks between this and the following paragraph are prevented.

Setting this property to True prevents page or column breaks between this and the following paragraph.

This feature is useful for preventing title paragraphs to be the last line on a page or column.

optional

Return type:

bool | None

property para_last_line_adjust: int

Gets/Sets the adjustment of the last line.

It is only valid if para_adjust is set to block.

Return type:

int

property para_left_margin: UnitMM100

Gets/Sets the left margin of the paragraph in 1/100th mm` units.

This property accepts int and UnitT types when setting.

Return type:

UnitMM100

property para_line_number_count: bool | None

Gets/Sets if the paragraph is included in the line numbering.

optional

Return type:

bool | None

property para_line_number_start_value: int | None

Gets/Sets the start value for the line numbering.

optional

Return type:

int | None

property para_line_spacing: LineSpacingStructComp | None

Gets/Sets the type of the line spacing of a paragraph.

Setting value can be done with a LineSpacing or LineSpacingStructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

LineSpacingStructComp | None

Hint

  • LineSpacing can be imported from ooo.dyn.style.line_spacing

property para_orphans: int | None

Gets/Sets the minimum number of lines of the paragraph that have to be at bottom of a page if the paragraph is spread over more than one page.

optional

Return type:

int | None

property para_register_mode_active: bool | None

Gets/Sets if the register mode is applied to a paragraph.

Note

Register mode is only used if the register mode property of the page style is switched on.

optional

Return type:

bool | None

property para_right_margin: UnitMM100

Gets/Sets the right margin of the paragraph in 100th mm units.

This property accepts float and UnitT types when setting.

Return type:

UnitMM100

property para_shadow_format: ShadowFormat | None

Gets/Sets the type, color, and size of the shadow.

optional

Return type:

ShadowFormat | None

property para_split: bool | None

Gets/Sets - Setting this property to False prevents the paragraph from getting split into two pages or columns.

optional

Return type:

bool | None

property para_style_name: str | None

Gets/Sets the name of the current paragraph style.

optional

Return type:

str | None

property para_tab_stops: Tuple[TabStop, ...] | None

Gets/Sets the positions and kinds of the tab stops within this paragraph.

optional:

Return type:

Tuple[TabStop, …] | None

property para_top_margin: UnitMM100

determines the top margin of the paragraph in 100th mm units.

The distance between two paragraphs is specified by:

The greater one is chosen.

This property accepts float and UnitT types when setting.

Return type:

UnitMM100

property para_user_defined_attributes: NameContainerComp | None

Gets/Sets - this property stores xml attributes.

They will be saved to and restored from automatic styles inside xml files.

Can be set with XNameContainer or NameContainerComp.

optional

Return type:

NameContainerComp | None

property para_vert_alignment: ParagraphVertAlignEnum | None

Gets/Set the vertical alignment of a paragraph.

When setting the value, it can be either an integer or an instance of ParagraphVertAlignEnum.

optional

Return type:

ParagraphVertAlignEnum | None

property para_widows: int | None

Gets/Sets the minimum number of lines of the paragraph that have to be at top of a page if the paragraph is spread over more than one page.

optional

Return type:

int | None

property position: PointStructGenericComp[UnitMM]

Gets/Sets the position of the shape in UnitMM Values.

When setting this value, it can be set with a com.sun.star.awt.Position instance or a PointStructGenericComp instance.

The Position can be set by just setting a Position property.

Returns:

Position in UnitMM Values.

Return type:

PointStructGenericComp[UnitMM]

Note

This is the position as reported by the shape. This is not the same as the position of the shape on the page. The position of the shape on the page includes is from the page margins.

For instance if the page has a margin of 10mm and the shape is at position (15, 15) then the position of the shape in the Draw Dialog box is (5, 5) where as this position property will report (15, 15).

Example

Can be set by just setting a Position property using int or UnitMM.

shape.position.x = 1000 # 10 mm
shape.position.y = UnitMM(20) # 20 mm

Can also be set using any UnitT object.

shape.position.x = UnitCM(1.2)
shape.position.y = UnitMM(40)

Can also be set using a com.sun.star.awt.Position struct.

shape.position = Position(1000, 2000) # in 1/100mm
property printable: bool | None

Gets/Sets, If this is False, the Shape is not visible on printer outputs.

optional

Return type:

bool | None

property relative_height: int | None

Gets/Sets the relative height of the object.

It is only valid if it is greater than zero.

optional

Return type:

int | None

property relative_height_relation: int | None

Gets/Sets the relation of the relative height of the object.

It is only valid if RelativeHeight is greater than zero.

optional

Return type:

int | None

property relative_width: int | None

Gets/Sets the relative width of the object.

It is only valid if it is greater than zero.

optional

Return type:

int | None

property relative_width_relation: int | None

Gets/Sets the relation of the relative width of the object.

It is only valid if RelativeWidth is greater than zero.

optional

Return type:

int | None

property right_border: BorderLine2StructComp | None

Gets/Sets the right border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property right_border_distance: UnitMM100 | None

Gets/Sets the distance from the right border to the object.

When setting the value, it can be either an float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property rotate_angle: Angle100

This is the angle for rotation of this Shape.

The shape is rotated counter-clockwise around the center of the bounding box.

This property contains an error, the rotation angle is mathematically inverted when You take into account that the Y-Axis of the coordinate system is pointing down. Please use the Transformation property of the service Shape instead.

When is setting this property, the value can be an int (in 1/100th of a degree) or an AngleT.

Returns:

The angle for rotation of this Shape.

Return type:

Angle100

Hint

Angle100 can be imported from ooodev.units

property ruby_adjust: int | None

Gets/Sets - This optional property determines the adjustment of the ruby .

optional

Return type:

int | None

property ruby_char_style_name: str | None

Gets/Sets - This optional property contains the name of the character style that is applied to RubyText.

optional

Return type:

str | None

property ruby_is_above: bool | None

Gets/Sets - This optional property determines whether the ruby text is printed above/left or below/right of the text.

This property is replaced by RubyPosition.

optional

Return type:

bool | None

property ruby_position: RubyPositionEnum | None

Gets/Sets - This optional property determines the position of the ruby .

optional

Returns:

Returns RubyPositionEnum or None if not supported.

Return type:

RubyPositionEnum | None

Hint

  • RubyPositionEnum can be imported from ooo.dyn.text.ruby_position

property ruby_text: str | None

Gets/Sets - This optional property contains the text that is set as ruby.

optional

Return type:

str | None

property shadow: bool

Gets/Sets - enables/disables the shadow of a Shape.

The other shadow properties are only applied if this is set to TRUE.

Return type:

bool

property shadow_blur: UnitMM100 | None

This defines the degree of blur of the shadow in points.

When setting value can be an int or UnitT.

optional

Returns:

UnitMM100 or None if property is not available.

Return type:

UnitMM100 | None

property shadow_color: Color

This is the color of the shadow of this Shape.

Returns:

Color

Return type:

Color

property shadow_transparence: Intensity

This defines the degree of transparence of the shadow in percent.

Returns:

Intensity

Return type:

Intensity

property shadow_x_distance: UnitMM100

This is the horizontal distance of the left edge of the Shape to the shadow.

When setting value can be an int or UnitT.

Returns:

UnitMM100

Return type:

UnitMM100

property shadow_y_distance: UnitMM100

This is the vertical distance of the top edge of the Shape to the shadow.

When setting value can be an int or UnitT.

Returns:

UnitMM100

Return type:

UnitMM100

property shape_type: str

Gets the shape type.

Return type:

str

property shape_user_defined_attributes: XNameContainer | None

Gets/Sets, this property stores xml attributes.

They will be saved to and restored from automatic styles inside xml files.

optional

Return type:

XNameContainer | None

property shear_angle: Angle100 | None

This is the amount of shearing for this Shape.

The shape is sheared counter-clockwise around the center of the bounding box

When is setting this property, the value can be an int (in 1/100th of a degree) or an AngleT.

optional

Returns:

The angle for rotation of this Shape Or None if not supported.

Return type:

Angle100 | None

Hint

Angle100 can be imported from ooodev.units

property size: SizeStructGenericComp[UnitMM]

Gets/Sets the size of the shape in UnitMM Values.

When setting this value, it can be set with a com.sun.star.awt.Size instance or a SizeStructGenericComp instance.

The Size can be set by just setting a Size property.

Returns:

Size in UnitMM Values.

Return type:

SizeStructGenericComp[UnitMM]

Example

Can be set by just setting a Size property using int or UnitMM.

shape.size.width = 1000 # 10 mm
shape.size.height = UnitMM(20) # 20 mm

Can also be set using any UnitT object.

shape.size.width = UnitCM(1.2)
shape.size.height = UnitMM(40)

Can also be set using a com.sun.star.awt.Size struct.

shape.size = Size(1000, 2000) # in 1/100mm
property size_protect: bool | None

Gets/Sets, With this set to True, this Shape may not be sized interactively in the user interface.

optional

Return type:

bool | None

property style: StyleComp | None

Gets/Sets, this property lets you get and set a style for this shape.

When setting property can be a StyleComp or XStyle.

optional

Return type:

StyleComp | None

property text_user_defined_attributes: NameContainerComp | None

Gets/Sets - This property stores XML attributes.

They will be saved to and restored from automatic styles inside XML files.

When setting the value, it can be a NameContainerComp or a XNameContainer instance.

optional

Return type:

NameContainerComp | None

property top_border: BorderLine2StructComp | None

Gets/Sets the top border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property top_border_distance: UnitMM100 | None

Gets/Sets the distance from the top border to the object.

When setting the value, it can be either an float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property transformation: HomogenMatrix3StructComp | None

Gets/Sets, this property lets you get and set the transformation matrix for this shape.

The transformation is a 3x3 homogeneous matrix and can contain translation, rotation, shearing and scaling.

When setting property can be a HomogenMatrix3 or HomogenMatrix3StructComp.

optional

Returns:

The transformation matrix for this shape or None if property not supported.

Return type:

HomogenMatrix3StructComp | None

Hint

  • HomogenMatrix3 can be imported from ooo.dyn.drawing.homogen_matrix3

property unvisited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for unvisited hyperlinks.

optional

Return type:

str | None

property visible: bool | None

Gets/Sets, If this is False, the Shape is not visible on screen outputs.

Please note that the Shape may still be visible when printed, see Printable.

optional

Return type:

bool | None

property visited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for visited hyperlinks.

optional

Return type:

str | None

property z_order: int | None

Gets/Sets the Zorder of this Shape.

optional

Return type:

int | None