XInterface
, which uses the same mechanism as COM to access it (queryInterface
) which allows the interface to be extendedservice
keywordtypelib_TypeClass_VOID
void
typelib_TypeClass_BOOLEAN
sal_Bool
typelib_TypeClass_BYTE
sal_Int8
typelib_TypeClass_SHORT
sal_InT16
typelib_TypeClass_BYTE
sal_uInt16
typelib_TypeClass_LONG
sal_uInt32
typelib_TypeClass_UNSIGNED_LONG
sal_Int32
typelib_TypeClass_HYPER
sal_Int64
typelib_TypeClass_UNSIGNED_HYPER
sal_uInt64
typelib_TypeClass_FLOAT
float
typelib_TypeClass_DOUBLE
double
typelib_TypeClass_CHAR
sal_Unicode
rtl::OUString
class and the enumeration in the type library is typelib_TypeClass_STRING
.com.sun.star.table.CellVertJustify
is defined as com::sun::star::table::CellVertJustify.TOP
.rtl_uString
s to the enumerator names, and an array of integers to define the enumerator name indices. The following is a basic unit test that creates and then releases an enumerator:typelib_CompoundTypeDescription
struct in the C type library. Whilst the struct is meant to be opaque, it is still interesting to see how it has been implemented by the LibreOffice developers:typelib_TypeDescription
called aBase
., which describes the actual struct type (which will be the base type other types can inherit from). UNO structs support single-inheritence, and this points to the parent struct, which is pBaseTypeDescription
. If this is a nullptr, then it means that the struct is the root class in the heirachy.ppTypeRefs
, and names of each member, ppMemberNames
. To get to each member, you need to know the memory offset of each member so an offset table, pMemberOffsets
, is used.ParameterizedStruct<T, B>
.The plain struct is defined by typelib_CompoundTypeDescription
and parameterized structs are defined by typelib_StructTypeDescription
.Type
class, which wraps a typelib_TypeDescriptionReference
pointer. To construct a new Type, you pass it a TypeClass
enum (translates to typelib_TypeClass
) and a type description string; alternatively you can pass a typelib_TypeDescriptionReference
pointer. To create a type, you just call on the Type
constructor.<OBI>[:purpose]*
. Some examples are:java:unsafe
for a Java based environment that is thread-unsafeuno
for an environment that implements the binary UNO ABI and which is thread-safegcc3:debug
for an environment that implements the GCC3 C++ OBI and that is thread unsafeuno_getMapping()
function. The mapping is stored in a structure, which has a pointer to an acquire, release and map function. It works as follows:uno_Mapping
pointer, and three input parameters to the environment to map from, the environment to map to and the name of the environment purpose. The first task of the function is to ensure that the mapping is released, and it is then cleared.unordered_map
of mapping names to mapping entries, and an unordered_map
of uno_Mappings
to mapping entries. You can also register callbacks to find mappings. There is also a list of external bridging libraries that have already been loaded, kept so that they are not loaded a second time. This is all defined in the structure MappingsData
, and is lazy loaded via the getMappingsData()
function.Mapping
instance to a uno_Mapping
struct:installTypeDescriptionManager()
:XHeirarchicalNameAccess
object.XInterface
. It provides lifetime control by reference counting and the possibility of querying for other interfaces of the same logical object. Deriving from XInterface, an object needs to implement the acquire()
and release()
functions - for object lifetime - and the queryInterface()
function.queryInterface()
- this allows a UNO type to be safely casted, even across process boundaries. To find out if an implementation supports a given interface, it passes queryInterface()
the Type object it wishes to check. If the implementation supports the interface, then it returns a reference to the interface being queries, otherwise if not then it returns a void type.static_type
is defined to return the Type
of the object. This is necessary, because I use the helper queryInterface()
function in cppuhelper:static_type()
function to compare it against the type being tested, and if this matches then it returns the implementation as an Any
object. If it does not match, then it returns a void Any
object.