Class ModelImage

class ooodev.dialog.dl_control.model.model_image.ModelImage(model)[source]

Bases: ModelPropPartial, UnoControlImageControlModelPartial, UnoControlDialogElementPartial

Parameters:

model (UnoControlModel) –

__init__(model)[source]

Constructor

Parameters:
  • component (UnoControlModel) – UNO Component that implements com.sun.star.awt.UnoControlModel service.

  • model (com.sun.star.awt.UnoControlModel) –

Return type:

None

add_event_listener(listener)

Adds an event listener to the component.

Parameters:

listener (XEventListener) – The event listener to be added.

Return type:

None

add_property_change_listener(name, listener)

Adds a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

add_vetoable_change_listener(name, listener)

Adds a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

create_clone()

Creates a clone of the object.

Returns:

The clone.

Return type:

XCloneable

dispose()

Disposes the component.

Return type:

None

get_property_set_info()

Returns the property set info.

Returns:

The property set info.

Return type:

XPropertySetInfo

get_property_value(name)

Returns the value of a property.

Parameters:

name (str) – The name of the property.

Returns:

The value of the property.

Return type:

Any

remove_event_listener(listener)

Removes an event listener from the component.

Parameters:

listener (XEventListener) – The event listener to be removed.

Return type:

None

remove_property_change_listener(name, listener)

Removes a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

remove_vetoable_change_listener(name, listener)

Removes a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

set_property_value(name, value)

Sets the value of a property.

Parameters:
  • name (str) – The name of the property.

  • value (Any) – The value of the property.

Return type:

None

property background_color: Color

Gets/Set the background color of the control.

Returns:

Color

Return type:

Color

property border: BorderKind

Gets/Sets the border style of the control.

Note

Value can be set with BorderKind or int.

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

Return type:

BorderKind

property border_color: Color | None

Gets/Sets the color of the border, if present

Not every border style (see Border) may support coloring. For instance, usually a border with 3D effect will ignore the border_color setting.

optional

Returns:

Color or None if not set.

Return type:

Color | None

property context_writing_mode: int

Get or set the context_writing_mode property.

Return type:

int

property enable_visible: bool

Get or set the enable_visible property.

Return type:

bool

property enabled: bool

Gets/Sets whether the control is enabled or disabled.

Return type:

bool

property graphic: XGraphic | None

specifies a graphic to be displayed at the button

If this property is present, it interacts with the image_url in the following way:

  • If image_url is set, graphic will be reset to an object as loaded from the given image URL, or None if image_url does not point to a valid image file.

  • If graphic is set, image_url will be reset to an empty string.

optional

Return type:

XGraphic | None

property height: UnitAppFontHeight

Gets/Sets the height of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Height of the control.

Return type:

UnitAppFontHeight

property help_text: str

Get/Sets the help text of the control.

Return type:

str

property help_url: str

Gets/Sets the help URL of the control.

Return type:

str

property image_url: str

Gets/Sets a URL to an image to use for the button.

Return type:

str

property model: com.sun.star.awt.UnoControlModel

Uno Control Model

Return type:

UnoControlModel

property name: str

Gets/Sets the name of the control.

Return type:

str

property picture: str

Gets/Sets the picture for the control

When setting the value it can be a string or a Path object. If a string is passed it can be a URL or a path to a file. Value such as file:///path/to/image.png and /path/to/image.png are valid. Relative paths are supported.

Returns:

The picture URL in the format of file:///path/to/image.png or empty string if no picture is set.

Return type:

str

property printable: bool

Gets/Sets that the control will be printed with the document.

Return type:

bool

property scale_image: bool

Gets/Sets if the image is automatically scaled to the size of the control.

Return type:

bool

property scale_mode: ImageScaleModeEnum | None

defines how to scale the image

If this property is present, it supersedes the ScaleImage property.

The value of this property is one of the ImageScaleMode constants.

optional

Note

Value can be set with ImageScaleModeEnum or int.

Hint

  • ImageScaleModeEnum can be imported from ooo.dyn.awt.image_scale_mode

Return type:

ImageScaleModeEnum | None

property step: int

Gets/Sets the step of the control.

Return type:

int

property tab_index: int

Gets/Sets the tab index of the control.

Return type:

int

property tabstop: bool | None

Gets/Sets that the control can be reached with the TAB key.

optional

Return type:

bool | None

property tag: str

Gets/Sets the tag of the control.

Return type:

str

property width: UnitAppFontWidth

Gets/Sets the width of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Width of the control.

Return type:

UnitAppFontWidth

property x: UnitAppFontX

Gets/Sets the horizontal position of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Horizontal position of the control.

Return type:

UnitAppFontX

property y: UnitAppFontY

Gets/Sets the vertical position of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Vertical position of the control.

Return type:

UnitAppFontY