xref: /aoo4110/main/offapi/com/sun/star/sheet/AddIn.idl (revision b1cdbd2c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_sheet_AddIn_idl__
25#define __com_sun_star_sheet_AddIn_idl__
26
27#ifndef __com_sun_star_lang_XServiceName_idl__
28#include <com/sun/star/lang/XServiceName.idl>
29#endif
30
31#ifndef __com_sun_star_sheet_XAddIn_idl__
32#include <com/sun/star/sheet/XAddIn.idl>
33#endif
34
35#ifndef __com_sun_star_sheet_XCompatibilityNames_idl__
36#include <com/sun/star/sheet/XCompatibilityNames.idl>
37#endif
38
39//=============================================================================
40
41module com {  module sun {  module star {  module sheet {
42
43//=============================================================================
44
45/** is the base for AddIn services that supply functions which can be called
46	by other components.
47
48	<p>Any AddIn implementation must implement a service describing its
49	specific set of functions.
50	That service must contain the <type>AddIn</type> service, and the
51	functions that are implemented, in one or more interfaces.
52	The <type scope="com::sun::star::lang">XServiceName</type> interface
53	must describe that service, and the <type>XAddIn</type> interface
54	must describe the individual functions.</p>
55
56	<p>Each AddIn function can take parameters of the following types:</p>
57
58	<dl>
59	<dt><atom>long</atom></dt>
60	<dd>for integer values.</dd>
61
62	<dt><atom>double</atom></dt>
63	<dd>for floating point values.</dd>
64
65	<dt><atom>string</atom></dt>
66	<dd>for text strings.</dd>
67
68	<dt><atom>long[][]</atom></dt>
69	<dd>for (two-dimensional) arrays of integer values.</dd>
70
71	<dt><atom>double[][]</atom></dt>
72	<dd>for (two-dimensional) arrays of floating point values.</dd>
73
74	<dt><atom>string[][]</atom></dt>
75	<dd>for (two-dimensional) arrays of text strings.</dd>
76
77	<dt><atom>any[][]</atom></dt>
78	<dd>for (two-dimensional) arrays of mixed contents. Each <atom>any</atom>
79	will contain a <atom>double</atom> or a <atom>string</atom>, depending on
80	the data.</dd>
81
82	<dt><atom>any</atom></dt>
83	<dd>Depending on the data, a <atom>double</atom>, a <atom>string</atom>,
84	or an <atom>any[][]</atom> will be passed. If no argument is specified in
85	the function call, <void/> will be passed. This allows for optional
86	parameters.</dd>
87
88	<dt><type scope="com::sun::star::table">XCellRange</type></dt>
89	<dd>for a <type scope="com::sun::star::table">XCellRange</type> interface
90	to the source data.</dd>
91
92	<dt><type scope="com::sun::star::beans">XPropertySet</type></dt>
93	<dd>for a <type scope="com::sun::star::beans">XPropertySet</type>
94	interface to the <type>SpreadsheetDocument</type> making the function
95	call. Only one parameter of this type is allowed in each function. It
96	can be used to query document settings like
97	<member>SpreadsheetDocumentSettings::NullDate</member>.</dd>
98
99	<dt><atom>any[]</atom></dt>
100	<dd>for varying parameters. Only the last parameter of a function may
101	have this type. It will be filled with the remaining arguments of the
102	function call that were not used for the previous parameters. Each
103	element of the sequence will be filled as in the case of <atom>any</atom>
104	above.</dd>
105	</dl>
106
107	<p>Each AddIn function must have one of the following return types:</p>
108
109	<ul>
110	<li><atom>long</atom></li>
111	<li><atom>double</atom></li>
112	<li><atom>string</atom></li>
113	<li><atom>long[][]</atom></li>
114	<li><atom>double[][]</atom></li>
115	<li><atom>string[][]</atom></li>
116	<li><atom>any[][]</atom></li>
117	<li><type>XVolatileResult</type></li>
118	<li><atom>any</atom></li>
119	</ul>
120
121	<p>The sequences must contain arrays as described above for the
122	parameter types.
123	An <type>XVolatileResult</type> return value must contain an object
124	implementing the <type>VolatileResult</type> service, that contains
125	a volatile result. Subsequent calls with the same parameters must
126	return the same object.
127	An <atom>any</atom> return value can contain any of the other types.</p>
128 */
129published service AddIn
130{
131	// ------------------------------------------------------------------------
132
133	/** contains a method that returns the service name of the add-in.
134	 */
135	interface com::sun::star::lang::XServiceName;
136
137	// ------------------------------------------------------------------------
138
139	/** provides access to function descriptions and localized names
140		and descriptions.
141 	 */
142	interface com::sun::star::sheet::XAddIn;
143
144	// ------------------------------------------------------------------------
145
146	/**	provides access to compatibility names for the functions.
147	 */
148	[optional] interface com::sun::star::sheet::XCompatibilityNames;
149};
150
151//=============================================================================
152
153}; }; }; };
154
155#endif
156
157