LibreOffice Module pyuno (master) 1
Namespaces | Classes | Functions | Variables
uno Namespace Reference

Namespaces

namespace  util
 

Classes

class  _ConstantGroup
 
class  Any
 
class  Bool
 
class  BoundAttribute
 
class  ByteSequence
 
class  Char
 
class  Enum
 
class  ExceptionAttribute
 
class  OnewayAttribute
 
class  ParameterizedTypeAttribute
 
class  PolymorphicType
 
class  Type
 
class  TypeArgumentsAttribute
 
class  TypeParametersAttribute
 

Functions

def getComponentContext ()
 
def getCurrentContext ()
 
def setCurrentContext (newContext)
 
def getConstantByName (constant)
 
def getTypeByName (typeName)
 
def createUnoStruct (typeName, *args, **kwargs)
 
def getClass (typeName)
 
def isInterface (obj)
 
def generateUuid ()
 
def systemPathToFileUrl (systemPath)
 
def fileUrlToSystemPath (url)
 
def absolutize (path, relativeUrl)
 
def invoke (object, methodname, argTuple)
 
def _uno_import (name, *optargs, **kwargs)
 
def _impl_getConstantGroupByName (module, group)
 
def _uno_struct__init__ (self, *args, **kwargs)
 
def _uno_struct__getattr__ (self, name)
 
def _uno_struct__setattr__ (self, name, value)
 
def _uno_struct__repr__ (self)
 
def _uno_struct__str__ (self)
 
def _uno_struct__ne__ (self, other)
 
def _uno_struct__eq__ (self, that)
 
def _uno_extract_printable_stacktrace (trace)
 

Variables

 _component_context = pyuno.getComponentContext()
 
 _builtin_import = __import__
 

Function Documentation

◆ _impl_getConstantGroupByName()

def uno._impl_getConstantGroupByName (   module,
  group 
)
private
Gets UNOIDL constant group by name.

Definition at line 457 of file uno.py.

Referenced by _uno_import().

◆ _uno_extract_printable_stacktrace()

def uno._uno_extract_printable_stacktrace (   trace)
private
Extracts a printable stacktrace.

Referenced from pyuno shared lib and pythonscript.py.

Definition at line 545 of file uno.py.

◆ _uno_import()

def uno._uno_import (   name,
optargs,
**  kwargs 
)
private
Overrides built-in import to allow directly importing LibreOffice classes.

Definition at line 342 of file uno.py.

References _builtin_import, _impl_getConstantGroupByName(), pyuno.getClass(), and getConstantByName().

◆ _uno_struct__eq__()

def uno._uno_struct__eq__ (   self,
  that 
)
private
Compares two UNO structs.

Referenced from the pyuno shared library.

Definition at line 533 of file uno.py.

◆ _uno_struct__getattr__()

def uno._uno_struct__getattr__ (   self,
  name 
)
private
Gets attribute from UNO struct.

Referenced from the pyuno shared library.

Definition at line 498 of file uno.py.

◆ _uno_struct__init__()

def uno._uno_struct__init__ (   self,
args,
**  kwargs 
)
private
Initializes a UNO struct.

Referenced from the pyuno shared library.

This function can be called with either an already constructed UNO struct, which it
will then just reference without copying, or with arguments to create a new UNO struct.

Definition at line 475 of file uno.py.

References pyuno.getClass().

◆ _uno_struct__ne__()

def uno._uno_struct__ne__ (   self,
  other 
)
private

Definition at line 530 of file uno.py.

◆ _uno_struct__repr__()

def uno._uno_struct__repr__ (   self)
private
Converts a UNO struct to a printable string.

Referenced from the pyuno shared library.

Definition at line 516 of file uno.py.

◆ _uno_struct__setattr__()

def uno._uno_struct__setattr__ (   self,
  name,
  value 
)
private
Sets attribute on UNO struct.

Referenced from the pyuno shared library.

Definition at line 507 of file uno.py.

◆ _uno_struct__str__()

def uno._uno_struct__str__ (   self)
private
Converts a UNO struct to a string.

Definition at line 525 of file uno.py.

◆ absolutize()

def uno.absolutize (   path,
  relativeUrl 
)
Returns an absolute file url from the given urls.

Definition at line 136 of file uno.py.

◆ createUnoStruct()

def uno.createUnoStruct (   typeName,
args,
**  kwargs 
)
Creates a UNO struct or exception given by typeName.

Can be called with:

1) No additional argument.
   In this case, you get a default constructed UNO structure.
   (e.g. `createUnoStruct("com.sun.star.uno.Exception")`)
2) Exactly one additional argument that is an instance of typeName.
   In this case, a copy constructed instance of typeName is returned
   (e.g. `createUnoStruct("com.sun.star.uno.Exception" , e)`)
3) As many additional arguments as the number of elements within typeName
   (e.g. `createUnoStruct("com.sun.star.uno.Exception", "foo error" , self)`).
4) Keyword arguments to give values for each element of the struct by name.
5) A mix of 3) and 4), such that each struct element is given a value exactly once,
   either by a positional argument or by a keyword argument.

The additional and/or keyword arguments must match the type of each struct element,
otherwise an exception is thrown.

Definition at line 76 of file uno.py.

References createUnoStruct(), and getClass().

Referenced by createUnoStruct().

◆ fileUrlToSystemPath()

def uno.fileUrlToSystemPath (   url)
Returns a system path.

This path is determined by the system that the Python interpreter is running on.

Definition at line 127 of file uno.py.

◆ generateUuid()

def uno.generateUuid ( )
Returns a 16 byte sequence containing a newly generated uuid or guid.

For more information, see rtl/uuid.h.

Definition at line 112 of file uno.py.

◆ getClass()

def uno.getClass (   typeName)
Returns the class of a concrete UNO exception, struct, or interface.

Definition at line 100 of file uno.py.

References pyuno.getClass().

Referenced by createUnoStruct().

◆ getComponentContext()

def uno.getComponentContext ( )
Returns the UNO component context used to initialize the Python runtime.

Definition at line 32 of file uno.py.

Referenced by unohelper.inspect().

◆ getConstantByName()

def uno.getConstantByName (   constant)
Looks up the value of an IDL constant by giving its explicit name.

Definition at line 61 of file uno.py.

Referenced by _uno_import().

◆ getCurrentContext()

def uno.getCurrentContext ( )
Returns the current context.

See http://udk.openoffice.org/common/man/concept/uno_contexts.html#current_context
for an explanation on the current context concept.

Definition at line 38 of file uno.py.

◆ getTypeByName()

def uno.getTypeByName (   typeName)
Returns a `uno.Type` instance of the type given by typeName.

If the type does not exist, a `com.sun.star.uno.RuntimeException` is raised.

Definition at line 67 of file uno.py.

Referenced by uno.ByteSequence.__hash__(), and unohelper._unohelper_getHandle().

◆ invoke()

def uno.invoke (   object,
  methodname,
  argTuple 
)
Use this function to pass exactly typed Anys to the callee (using uno.Any).

Definition at line 330 of file uno.py.

Referenced by uno.ByteSequence.__hash__().

◆ isInterface()

def uno.isInterface (   obj)
Returns True, when obj is a class of a UNO interface.

Definition at line 106 of file uno.py.

Referenced by unohelper._unohelper_getHandle(), and pyuno.createClass().

◆ setCurrentContext()

def uno.setCurrentContext (   newContext)
Sets newContext as new UNO context.

The newContext must implement the XCurrentContext interface. The
implementation should handle the desired properties and delegate
unknown properties to the old context. Ensure that the old one
is reset when you leave your stack, see
http://udk.openoffice.org/common/man/concept/uno_contexts.html#current_context

Definition at line 48 of file uno.py.

◆ systemPathToFileUrl()

def uno.systemPathToFileUrl (   systemPath)
Returns a file URL for the given system path.

Definition at line 121 of file uno.py.

Variable Documentation

◆ _builtin_import

uno._builtin_import = __import__
private

Definition at line 339 of file uno.py.

Referenced by _uno_import().

◆ _component_context

uno._component_context = pyuno.getComponentContext()
private

Definition at line 29 of file uno.py.