Module gallery
- class ooodev.utils.gallery.Gallery[source]
- classmethod find_gallery_obj(gallery_name: ooodev.utils.kind.gallery_kind.GalleryKind, name: str) ooodev.utils.gallery.GalleryObj [source]
- classmethod find_gallery_obj(gallery_name: str, name: str) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: ooodev.utils.kind.gallery_kind.GalleryKind, name: str, search_match: ooodev.utils.kind.search_match_kind.SearchMatchKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: str, name: str, search_match: ooodev.utils.kind.search_match_kind.SearchMatchKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: ooodev.utils.kind.gallery_kind.GalleryKind, name: str, *, search_kind: ooodev.utils.kind.gallery_search_by_kind.SearchByKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: str, name: str, *, search_kind: ooodev.utils.kind.gallery_search_by_kind.SearchByKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: str, name: str, search_match: ooodev.utils.kind.search_match_kind.SearchMatchKind, search_kind: ooodev.utils.kind.gallery_search_by_kind.SearchByKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name: ooodev.utils.kind.gallery_kind.GalleryKind, name: str, search_match: ooodev.utils.kind.search_match_kind.SearchMatchKind, search_kind: ooodev.utils.kind.gallery_search_by_kind.SearchByKind) ooodev.utils.gallery.GalleryObj
- classmethod find_gallery_obj(gallery_name, name, search_match=SearchMatchKind.PARTIAL_IGNORE_CASE, search_kind=SearchByKind.TITLE)
Finds a Gallery Item
- Parameters:
gallery_name (GalleryKind | str) – Kind of gallery to search in.
name (str) – Name of item to look for. Could be a partial or full name of a title or a path. Determined by
search_kind
.search_match (SearchMatchKind, optional) – Search match option. Defaults to
SearchMatchKind.PARTIAL_IGNORE_CASE
.search_kind (SearchByKind, optional) – Determines what part of Gallery Item to search. Defaults to
SearchByKind.TITLE
.
- Raises:
GalleryNotFoundError – If Gallery Item is not found.
GalleryError – If any other error occurs.
- Returns:
Gallery Item
- Return type:
- static get_absolute_url(url)[source]
Get absolute url Some url’s may have relative paths in them.
- Parameters:
url (str) – url
- Returns:
absolute url
- Return type:
str
Note
If a
url
is not a file path such asprivate:gallery/svdraw/dd2051
then it is returned verbatim.
- static get_gallery(name: ooodev.utils.kind.gallery_kind.GalleryKind) com.sun.star.gallery.XGalleryTheme [source]
- static get_gallery(name: str) com.sun.star.gallery.XGalleryTheme
- static get_gallery(name)
Gets Gallery Theme
- Parameters:
name (GalleryKind | str) – Kind of gallery to get.
- Raises:
GalleryError – If unable to get gallery theme.
- Returns:
Gallery Theme
- Return type:
XGalleryTheme
- classmethod get_gallery_graphic(item)[source]
Gets graphic form item
- Parameters:
item (XGalleryItem | GalleryObj) – Gallery Item
- Raises:
GalleryError – If any other error occurs.
- Returns:
Graphic object
- Return type:
XGraphic
- static get_gallery_names()[source]
Gets a list of Gallery Names
- Returns:
Gallery names list
- Return type:
List[str]
- static get_gallery_path(item)[source]
Gets gallery path
- Parameters:
item (XGalleryItem | GalleryObj) – Gallery Item
- Raises:
GalleryError – If error occurs
- Returns:
Gallery path.
- Return type:
Path
- static get_item_type(item)[source]
Get item type
- Parameters:
item (XGalleryItem | GalleryObj) – item
- Raises:
GalleryError – If error occurs.
- Returns:
Item type as enum.
- Return type:
GalleryItemTypeEnum
- static get_item_type_str(item_type)[source]
Gets string representation of
GalleryItemTypeEnum
- Parameters:
item_type (GalleryItemTypeEnum) – item
- Returns:
string representation
- Return type:
str
- classmethod report_gallery_item(item)[source]
Displays gallery information in the console.
- Parameters:
item (XGalleryItem | GalleryObj) – Gallery Item
- Return type:
None
- classmethod report_gallery_items(gallery_name)[source]
Displays Gallery Items information in console for a Gallery.
- Parameters:
gallery_name (GalleryKind | str) – Gallery kind
- Return type:
None
- class ooodev.utils.gallery.GalleryObj(itm)[source]
Represents Most properties of
XGalleryItem
. An instance of this class is returned fromfind_gallery_obj()
in place ofXGalleryItem
instance. This is due to a bug inLO 7.4
.- Parameters:
itm (XGalleryItem) –
- property Drawing: Any
- Return type:
Any
- property GalleryItemType: int
- Return type:
int
- property Graphic: com.sun.star.graphic.XGraphic
- Return type:
XGraphic
- property ImplementationId: ByteSequence
- Return type:
ByteSequence
- property ImplementationName: str
- Return type:
str
- property PropertySetInfo: com.sun.star.beans.XPropertySetInfo
- Return type:
XPropertySetInfo
- property PropertyToDefault: Any
- Return type:
Any
- property Thumbnail: Any
- Return type:
Any
- property Title: str
- Return type:
str
- property URL: str
- Return type:
str