Difference between revisions of "Documentation/DevGuide/Spreadsheets/Spreadsheet Add-Ins"
(Category:Calc Category:Add-In for DPL in Calc/Add-In) |
m |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
|NextPage=Documentation/DevGuide/Spreadsheets/Function Descriptions | |NextPage=Documentation/DevGuide/Spreadsheets/Function Descriptions | ||
}} | }} | ||
− | {{DISPLAYTITLE:Spreadsheet Add-Ins}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Spreadsheet Add-Ins}} | ||
<!--<idltopic>com.sun.star.sheet.AddIn</idltopic>--> | <!--<idltopic>com.sun.star.sheet.AddIn</idltopic>--> | ||
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 [[Documentation/DevGuide/WritingUNO/Writing UNO Components|Writing UNO Components]] describes how to write and deploy a UNO component. | 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 [[Documentation/DevGuide/WritingUNO/Writing UNO Components|Writing UNO Components]] describes how to write and deploy a UNO component. | ||
Line 13: | 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]--> | ||
− | + | <syntaxhighlight 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 28: | Line 29: | ||
}; | }; | ||
− | }; }; }; }; }; | + | }; }; }; }; }; </syntaxhighlight> |
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. | ||
{{PDL1}} | {{PDL1}} | ||
− | [[Category: Spreadsheet Documents]] | + | |
+ | [[Category:Documentation/Developer's Guide/Spreadsheet Documents]] | ||
[[Category:Calc]] | [[Category:Calc]] | ||
[[Category:Add-In]] | [[Category:Add-In]] |
Latest revision as of 13:52, 20 December 2020
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). |