OOO Development Tools

Book:

  • Python LibreOffice Programming

Help:

  • Help Documentation

Guides:

  • Guides

Misc:

  • Events
  • Version History
  • Credits and Acknowledgements

DEVELOPER API:

  • ooodev
    • adapter
    • calc
    • config
    • conn
    • dialog
    • draw
    • events
    • exceptions
    • form
    • format
    • formatters
    • Globals
    • gui
    • io
    • listeners
    • loader
    • macro
    • meta
    • office
    • proto
    • theme
    • units
    • uno_helper
    • utils
      • builder
      • cache
      • context
      • comp
      • data_type
      • dispatch
      • factory
      • helper
      • inst
      • partial
      • kind
      • reflection
      • string
      • Module color
      • Class DateUtil
      • Class Dialogs
      • Module enum_helper
      • Class FileIO
      • Class Forms
      • Module gallery
        • Gallery
        • GalleryObj
      • Module gen_util
      • Class GUI
      • Class ImagesLo
      • Class Info
      • Class Lo
      • Module lo_util
      • Module paths
      • Class Props
      • Class Result
      • Class Selection
      • Class Session
      • Class SysInfo
      • Class TableHelper
      • Module type_var
      • Class UnoEnum
      • Class ViewState
      • XML
    • wrapper
    • write

DEVELOPING ODEV:

  • Dev Docs
OOO Development Tools
  • ooodev
  • utils
  • Module gallery
  • Edit on GitHub

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:

GalleryObj

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 as private: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

static report_galleries()[source]

Displays a list of galleries in the console

Return type:

None

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 from find_gallery_obj() in place of XGalleryItem instance. This is due to a bug in LO 7.4.

Parameters:

itm (XGalleryItem) –

__init__(itm)[source]
Parameters:

itm (com.sun.star.gallery.XGalleryItem) –

Return type:

None

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

Previous Next

© Copyright 2022-2024, :Barry-Thomas-Paul: Moss. Revision 308a4980.

Built with Sphinx using a theme provided by Read the Docs.