Difference between revisions of "Documentation/DevGuide/Spreadsheets/Spreadsheet Add-Ins"
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
(Added Java syntax highlight) |
||
Line 14: | Line 14: | ||
The functions that the add-in component exports to the spreadsheet application have to be defined in a new interface. The function names in the interface, together with the component's service name, are used internally to identify an add-in function. For a list of the supported types for function arguments and return values, see the <idl>com.sun.star.sheet.AddIn</idl> service description. An example interface that defines two functions is similar to the following code: | The functions that the add-in component exports to the spreadsheet application have to be defined in a new interface. The function names in the interface, together with the component's service name, are used internally to identify an add-in function. For a list of the supported types for function arguments and return values, see the <idl>com.sun.star.sheet.AddIn</idl> service description. An example interface that defines two functions is similar to the following code: | ||
<!--[SOURCE:Spreadsheet/XExampleAddIn.idl]--> | <!--[SOURCE:Spreadsheet/XExampleAddIn.idl]--> | ||
− | + | <source lang="cpp"> | |
#include <com/sun/star/uno/XInterface.idl> | #include <com/sun/star/uno/XInterface.idl> | ||
#include <com/sun/star/sheet/XVolatileResult.idl> | #include <com/sun/star/sheet/XVolatileResult.idl> | ||
Line 29: | Line 29: | ||
}; | }; | ||
− | }; }; }; }; }; | + | }; }; }; }; }; </source> |
In addition to this interface, the add-in has to implement the interfaces from the <idl>com.sun.star.sheet.AddIn</idl> service and the usual interfaces every component has to support. | In addition to this interface, the add-in has to implement the interfaces from the <idl>com.sun.star.sheet.AddIn</idl> service and the usual interfaces every component has to support. |
Revision as of 06:01, 13 January 2013
An add-in component is used to add new functions to the spreadsheet application that can be used in cell formulas, such as the built-in functions. A spreadsheet add-in is a UNO component. The chapter Writing UNO Components describes how to write and deploy a UNO component.
The functions that the add-in component exports to the spreadsheet application have to be defined in a new interface. The function names in the interface, together with the component's service name, are used internally to identify an add-in function. For a list of the supported types for function arguments and return values, see the com.sun.star.sheet.AddIn service description. An example interface that defines two functions is similar to the following code:
#include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/sheet/XVolatileResult.idl> module com { module sun { module star { module sheet { module addin { interface XExampleAddIn : com::sun::star::uno::XInterface { /// Sample function that just increments a value. long getIncremented( [in] long nValue ); /// Sample function that returns a volatile result. com::sun::star::sheet::XVolatileResult getCounter( [in] string aName ); }; }; }; }; }; };
In addition to this interface, the add-in has to implement the interfaces from the com.sun.star.sheet.AddIn service and the usual interfaces every component has to support.
Content on this page is licensed under the Public Documentation License (PDL). |