Class FormCtlHidden

Introduction

Class for working with Hidden controls in a form.

EventArgsCallbackT

All EventArgsCallbackT callbacks include control_src as a keyword argument.

A callback can be in the format of:

def on_some_event(
    src: Any, event: EventArgs, control_src: FormCtlHidden, *args, **kwargs
) -> None:
    pass

or

def on_some_event(src: Any, event: EventArgs, *args, **kwargs) -> None:
    # can get control from kwargs
    ctl = cast(FormCtlHidden, kwargs['control_src'])

Class

class ooodev.form.controls.FormCtlHidden(ctl, lo_inst=None)[source]

Bases: LoInstPropsPartial, PropPartial, NamedPartial, PropertySetOptionPartial, PropertyAccessPartial, PropertyContainerPartial, FastPropertySetPartial, MultiPropertySetPartial, PersistObjectPartial, ServiceInfoPartial, TypeProviderPartial, PropertyChangeImplement, PropertiesChangeImplement, VetoableChangeImplement

com.sun.star.form.component.HiddenControl control

Parameters:
  • ctl (XComponent) –

  • lo_inst (LoInst | None) –

__init__(ctl, lo_inst=None)[source]

Constructor

Parameters:
  • ctl (XControl) – Control supporting com.sun.star.form.component.HiddenControl service.

  • lo_inst (LoInst, optional) – Lo Instance. Use when creating multiple documents. Defaults to None.

Return type:

None

Note

If the LoContext manager is use before this class is instantiated, then the Lo instance will be set using the current Lo instance. That the context manager has set. Generally speaking this means that there is no need to set lo_inst when instantiating this class.

See also

Class Forms.

add_event_properties_change(names, cb)

Add properties to listen for changes.

Parameters:
  • names (Iterable[str]) – One or more property names to listen for changes.

  • cb (EventArgsCallbackT) – Callback that is invoked when an event is triggered.

Raises:

ValueError – If names is empty.

Return type:

None

Note

The callback EventArgs.event_data will contain a tuple of com.sun.star.beans.PropertyChangeEvent objects.

Each time this method is called, the previous names are removed and the new names are added.

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_properties_change_listener(listener, *names)

adds an XPropertiesChangeListener to the specified property with the specified names.

The implementation can ignore the names of the properties and fire the event on all properties.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

Parameters:
  • listener (XPropertiesChangeListener) – The listener to be added.

  • names (str) – One or more names of the properties to listen to.

Return type:

None

add_property(name, attributes, value)

Adds a property to the container.

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

  • attributes (PropertyAttributeEnum) – The attributes of the property. Flags enum, this is a combination of com.sun.star.beans.PropertyAttribute.

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

Return type:

None

create_clone()[source]

Creates a clone of the object.

Returns:

The clone.

Return type:

FormCtlHidden

Note

The returned object will have the same Name as the original object and will not be inserted into the form.

enable_change_listener_notification(enable)

Turn on or off notifying change listeners on property value change.

This option is turned on by default.

Return type:

None

Parameters:

enable (bool) –

fire_event_properties_change(names)

Fires a sequence of PropertyChangeEvents

Parameters:

names (Iterable[str]) – Sequence of property names to fire event for.

Return type:

None

fire_properties_change_event(listener, *names)

Fires a sequence of PropertyChangeEvents to the specified listener.

Parameters:
  • listener (XPropertiesChangeListener) – The listener to be notified.

  • names (str) – One or more names of the properties to fire.

Return type:

None

get_fast_property_value(handle)

returns the value of the property with the specified name.

Parameters:

handle (int) – The implementation handle of the implementation for the property.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

Any

get_form_component_kind()[source]

Gets the kind of form component this control is

Return type:

FormComponentKind

get_implementation_id()

Obsolete unique identifier.

Originally returned a sequence of bytes which, when non-empty, was used as an ID to distinguish unambiguously between two sets of types, for example to realize hashing functionality when the object is introspected. Two objects that returned the same non-empty ID had to return the same set of types in getTypes(). (If a unique ID could not be provided, this method was always allowed to return an empty sequence, though).

Return type:

ByteSequence

get_implementation_name()

Provides the implementation name of the service implementation.

Return type:

str

get_name()

Returns the name of the object.

Return type:

str

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_property_set_info()

Gets the information of the properties which can be set at this object.

Return type:

XPropertySetInfo

get_property_values()

Gets of all property values within the object in a single call.

Returns:

The property values.

Return type:

tuple[PropertyValue, …]

get_service_name()

Returns the service name of the object.

Returns:

The service name.

Return type:

str

get_supported_service_names()

Provides the supported service names of the implementation, including also indirect service names.

Return type:

Tuple[str, ...]

get_types()

returns a sequence of all types (usually interface types) provided by the object.

Return type:

Tuple[Any, ...]

read(stream)

Reads the object from the given stream.

Parameters:

stream (XObjectInputStream) – The stream to read from.

Return type:

None

remove_event_properties_listener()

Remove Properties Listener

Return type:

None

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_properties_change_listener(listener)

removes an XPropertiesChangeListener from the listener list.

It is a noop if the listener is not registered.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

Return type:

None

Parameters:

listener (com.sun.star.beans.XPropertiesChangeListener) –

remove_property(name)

Removes a property from the container.

Parameters:

name (str) – The name of the property.

Return type:

None

set_fast_property_value(handle, value)

Sets the value to the property with the specified name.

Parameters:
  • handle (int) – The implementation handle of the implementation for the property.

  • value (Any) – The new value for the property.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.beans.PropertyVetoExceptionPropertyVetoException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

set_name(name)

Sets the name of the object.

Return type:

None

Parameters:

name (str) –

set_prop_values(**kwargs)

Set the property values.

Similar to set_property_values() but with key, value arguments instead of tuples.

Parameters:

kwargs (Any) – Property values.

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_property_values(values)

Sets of all property values within the object in a single call.

All properties which are not contained in the sequence values will be left unchanged.

Parameters:

values (tuple[PropertyValue, ...]) – The property values.

supports_all_services(*name)

Tests whether all the specified services are supported, i.e.

Parameters:

name (str) – One or more service name(s) to test such as com.sun.star.awt.MenuBar.

Raises:

ValueError – If no service name is provided.

Returns:

True if all the specified services are supported; Otherwise, False.

Return type:

bool

supports_service(*name)

Tests whether any of the specified service(s) are supported.

Parameters:

name (str) – One or more service name(s) to test such as com.sun.star.awt.MenuBar.

Returns:

True if any of the specified service(s) are supported; Otherwise, False.

Return type:

bool

write(stream)

Writes the object to the given stream.

Parameters:

stream (XObjectOutputStream) – The stream to write to.

Return type:

None

property component_type: int

Gets the form component type.

The return value is a com.sun.star.form.FormComponentType constant.

Returns:

Form component type

Return type:

int

New in version 0.14.1.

property events_listener_properties_change_implement: PropertiesChangeListener

Returns listener

Return type:

PropertiesChangeListener

property hidden_value: str

Gets the hidden value.

Returns:

Hidden value

Return type:

str

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property tag: str

Gets the tag.

Returns:

Tag

Return type:

str