mirror of
https://github.com/LibreOffice/loeclipse.git
synced 2025-07-23 00:24:26 +00:00

This passive registration registers all UNO services that are present in a component's Java or Python implementation. This fixes issue #156. To be considered as a UNO service a Java Class must have: - An ctor with `com.sun.star.uno.XComponentContext` as unique parameter. - A **static final** field `m_serviceNames` of type `String[]` (ie: an array of String) and having as values the name of the UNO service. This field can be private, protected or public, it doesn't matter. For a Python class to be considered a UNO service it must: - Exist a global variable `g_ImplementationHelper` declared as follows: `g_ImplementationHelper = unohelper.ImplementationHelper()`. - Exist a global variable `g_ImplementationName` declared as follows: `g_ImplementationName = 'com.sun.star.MyServiceName'`. - Exist a global variable `g_ServiceNames` declared as follows: `g_ServiceNames = ('com.sun.star.task.JobExecutor', )`. - Although this is not controlled, it will also be necessary for it to have the following code: ``` g_ImplementationHelper.addImplementation(YourPythonClass, # UNO object class g_ImplementationName, # Implementation name g_ServiceNames) # List of implemented services ```