OK I got it. One of those things that I was over thinkning.
<?xml version='1.0' encoding='UTF-8'?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="CalcAddIns"
oor:package="org.openoffice.Office">
<node oor:name="com.github.amourspirit.extension.MyObj" oor:op="replace">
<node oor:name="AddInFunctions">
<node oor:name="func1" oor:op="replace">
<prop oor:name="DisplayName">
<value xml:lang="en">MyObj.func1</value>
</prop>
<prop oor:name="Description">
<value xml:lang="en">Function 1 example</value>
</prop>
<prop oor:name="Category">
<value>Add-in</value>
</prop>
<node oor:name="Parameters">
</node>
</node>
<node oor:name="func2" oor:op="replace">
<prop oor:name="DisplayName">
<value xml:lang="en">MyObj.func2</value>
</prop>
<prop oor:name="Description">
<value xml:lang="en">Function 2 example</value>
</prop>
<prop oor:name="Category">
<value>Add-in</value>
</prop>
<node oor:name="Parameters">
</node>
</node>
<node oor:name="func3" oor:op="replace">
<prop oor:name="DisplayName">
<value xml:lang="en">MyObj.func3</value>
</prop>
<prop oor:name="Description">
<value xml:lang="en">Function 3 example</value>
</prop>
<prop oor:name="Category">
<value>Add-in</value>
</prop>
<node oor:name="Parameters">
</node>
</node>
</node>
</node>
</node>
</oor:component-data>
IDL
#include <com/sun/star/uno/XInterface.idl>
module com { module github { module amourspirit { module extensions {
interface XMyObj
{
string func1( );
string func2( );
string func3( );
};
}; }; }; };
Python
from __future__ import annotations
import uno
import unohelper
from com.github.amourspirit.extensions import XMyObj # type: ignore
implementation_name = "com.github.amourspirit.extension.MyObj"
implementation_services = ("com.sun.star.sheet.AddIn",)
class MyObj(unohelper.Base, XMyObj):
def __init__(self, ctx):
self.ctx = ctx
def func1(self) -> str:
return "Func1"
def func2(self) -> str:
return "Func2"
def func3(self) -> str:
return "Func3"
def createInstance(ctx):
return MyObj(ctx)
g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(createInstance, implementation_name, implementation_services)