ooodev.format.inner.direct.structs.shadow_struct module
- class ooodev.format.inner.direct.structs.shadow_struct.ShadowStruct(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]
Bases:
StructBase
Shadow struct
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__(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]
Constructor
- Parameters:
location (ShadowLocation, optional) – contains the location of the shadow. Default to
ShadowLocation.BOTTOM_RIGHT
.color (
Color
, optional) – contains the color value of the shadow. Defaults toStandardColor.GRAY
.transparent (bool, optional) – Shadow transparency. Defaults to False.
width (float, UnitT, optional) – contains the size of the shadow (in
mm
units) or Class UnitT. Defaults to1.76
.
- Raises:
ValueError – If
color
orwidth
are less than zero.- Return type:
None
- apply(obj: Any)[source]
- apply(obj: Any, keys: Dict[str, str])
- apply(obj, **kwargs)
Applies style to object
- Parameters:
obj (object) – Object that contains a
ShadowFormat
property.keys – (Dict[str, str], optional): key map for properties. Can be
prop
which defaults toShadowFormat
.
- Return type:
None
- copy()[source]
- copy(**kwargs)
- copy(**kwargs)
Gets a copy of instance as a new instance
- Return type:
TypeVar
(_TShadowStruct
, bound= ShadowStruct)- Parameters:
self (_TShadowStruct) –
- fmt_location(value)[source]
Gets a copy of instance with location set
- Parameters:
value (ShadowLocation) – Shadow location value
self (_TShadowStruct) –
- Returns:
Shadow with location set
- Return type:
- fmt_transparent(value)[source]
Gets a copy of instance with transparency set
- Parameters:
value (bool) – transparency value
self (_TShadowStruct) –
- Returns:
Shadow with transparency set
- Return type:
- fmt_width(value)[source]
Gets a copy of instance with width set
- Parameters:
value (float) – width value
self (_TShadowStruct) –
- Returns:
Shadow with width set
- Return type:
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO object
- Returns:
Instance from object
- Return type:
- classmethod from_uno_struct(shadow)[source]
- classmethod from_uno_struct(shadow, **kwargs)
- classmethod from_uno_struct(shadow, **kwargs)
Gets an instance
- Parameters:
shadow (ShadowFormat) – Shadow Format
- Returns:
Instance representing
shadow
.- Return type:
- get_attrs()[source]
Gets the attributes that are slated for change in the current instance
- Returns:
Tuple of attributes
- Return type:
Tuple(str, …)
- get_uno_struct()[source]
Gets UNO
ShadowFormat
from instance.- Returns:
ShadowFormat
instance- Return type:
ShadowFormat
- property empty: _TShadowStruct
Gets empty Shadow. When style is applied it remove any shadow.
- Return type:
TypeVar
(_TShadowStruct
, bound= ShadowStruct)
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_location: ShadowLocation
Gets the location of the shadow.
- Return type:
ShadowLocation
- property prop_transparent: bool
Gets transparent value
- Return type:
bool
- property property_name: str
Gets/Sets property name
This is the name of the property that the side should be applied to. Such as
LeftBorder
,RightBorder
etc.- Return type:
str