xref: /trunk/main/offapi/com/sun/star/sheet/AddIn.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_sheet_AddIn_idl__
29#define __com_sun_star_sheet_AddIn_idl__
30
31#ifndef __com_sun_star_lang_XServiceName_idl__
32#include <com/sun/star/lang/XServiceName.idl>
33#endif
34
35#ifndef __com_sun_star_sheet_XAddIn_idl__
36#include <com/sun/star/sheet/XAddIn.idl>
37#endif
38
39#ifndef __com_sun_star_sheet_XCompatibilityNames_idl__
40#include <com/sun/star/sheet/XCompatibilityNames.idl>
41#endif
42
43//=============================================================================
44
45module com {  module sun {  module star {  module sheet {
46
47//=============================================================================
48
49/** is the base for AddIn services that supply functions which can be called
50	by other components.
51
52	<p>Any AddIn implementation must implement a service describing its
53	specific set of functions.
54	That service must contain the <type>AddIn</type> service, and the
55	functions that are implemented, in one or more interfaces.
56	The <type scope="com::sun::star::lang">XServiceName</type> interface
57	must describe that service, and the <type>XAddIn</type> interface
58	must describe the individual functions.</p>
59
60	<p>Each AddIn function can take parameters of the following types:</p>
61
62	<dl>
63	<dt><atom>long</atom></dt>
64	<dd>for integer values.</dd>
65
66	<dt><atom>double</atom></dt>
67	<dd>for floating point values.</dd>
68
69	<dt><atom>string</atom></dt>
70	<dd>for text strings.</dd>
71
72	<dt><atom>long[][]</atom></dt>
73	<dd>for (two-dimensional) arrays of integer values.</dd>
74
75	<dt><atom>double[][]</atom></dt>
76	<dd>for (two-dimensional) arrays of floating point values.</dd>
77
78	<dt><atom>string[][]</atom></dt>
79	<dd>for (two-dimensional) arrays of text strings.</dd>
80
81	<dt><atom>any[][]</atom></dt>
82	<dd>for (two-dimensional) arrays of mixed contents. Each <atom>any</atom>
83	will contain a <atom>double</atom> or a <atom>string</atom>, depending on
84	the data.</dd>
85
86	<dt><atom>any</atom></dt>
87	<dd>Depending on the data, a <atom>double</atom>, a <atom>string</atom>,
88	or an <atom>any[][]</atom> will be passed. If no argument is specified in
89	the function call, <void/> will be passed. This allows for optional
90	parameters.</dd>
91
92	<dt><type scope="com::sun::star::table">XCellRange</type></dt>
93	<dd>for a <type scope="com::sun::star::table">XCellRange</type> interface
94	to the source data.</dd>
95
96	<dt><type scope="com::sun::star::beans">XPropertySet</type></dt>
97	<dd>for a <type scope="com::sun::star::beans">XPropertySet</type>
98	interface to the <type>SpreadsheetDocument</type> making the function
99	call. Only one parameter of this type is allowed in each function. It
100	can be used to query document settings like
101	<member>SpreadsheetDocumentSettings::NullDate</member>.</dd>
102
103	<dt><atom>any[]</atom></dt>
104	<dd>for varying parameters. Only the last parameter of a function may
105	have this type. It will be filled with the remaining arguments of the
106	function call that were not used for the previous parameters. Each
107	element of the sequence will be filled as in the case of <atom>any</atom>
108	above.</dd>
109	</dl>
110
111	<p>Each AddIn function must have one of the following return types:</p>
112
113	<ul>
114	<li><atom>long</atom></li>
115	<li><atom>double</atom></li>
116	<li><atom>string</atom></li>
117	<li><atom>long[][]</atom></li>
118	<li><atom>double[][]</atom></li>
119	<li><atom>string[][]</atom></li>
120	<li><atom>any[][]</atom></li>
121	<li><type>XVolatileResult</type></li>
122	<li><atom>any</atom></li>
123	</ul>
124
125	<p>The sequences must contain arrays as described above for the
126	parameter types.
127	An <type>XVolatileResult</type> return value must contain an object
128	implementing the <type>VolatileResult</type> service, that contains
129	a volatile result. Subsequent calls with the same parameters must
130	return the same object.
131	An <atom>any</atom> return value can contain any of the other types.</p>
132 */
133published service AddIn
134{
135	// ------------------------------------------------------------------------
136
137	/** contains a method that returns the service name of the add-in.
138	 */
139	interface com::sun::star::lang::XServiceName;
140
141	// ------------------------------------------------------------------------
142
143	/** provides access to function descriptions and localized names
144		and descriptions.
145 	 */
146	interface com::sun::star::sheet::XAddIn;
147
148	// ------------------------------------------------------------------------
149
150	/**	provides access to compatibility names for the functions.
151	 */
152	[optional] interface com::sun::star::sheet::XCompatibilityNames;
153};
154
155//=============================================================================
156
157}; }; }; };
158
159#endif
160
161