summaryrefslogtreecommitdiff
path: root/udkapi/com/sun/star/test/bridge/XBridgeTest.idl
blob: 05f444a4331881e5febdf2cedeabf38f49255ee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef __com_sun_star_test_bridge_XBridge_idl__
#define __com_sun_star_test_bridge_XBridge_idl__

#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif

#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
#include <com/sun/star/lang/IllegalArgumentException.idl>
#endif

module com
{
module sun
{
module star
{
module test
{
module bridge
{

published enum TestEnum
{
    TEST,
    ONE,
    TWO,
    CHECK,
    LOLA,
    PALOO,
    ZA
};

/**
 * simple types
 */
published struct TestSimple
{
    boolean                    Bool;
    char                       Char;
    byte                       Byte;
    short                      Short;
    unsigned short             UShort;
    long                       Long;
    unsigned long              ULong;
    hyper                      Hyper;
    unsigned hyper             UHyper;
    float                      Float;
    double                     Double;
    TestEnum                   Enum;
};
/**
 * complex types adding string, inteface, any
 */
published struct TestElement : TestSimple
{
    string                     String;
    com::sun::star::uno::XInterface   Interface;
    any                        Any;
};
/**
 * adding even more complexity, sequence< TestElement >
 */
published struct TestDataElements : TestElement
{
    sequence< TestElement > Sequence;
};

/**
 * typedef used in interface
 */
published typedef TestDataElements TestData;

published interface XRecursiveCall : com::sun::star::uno::XInterface
{
    /***
     * @param nToCall If nToCall is 0, the method returns immeadiatly.
     *                Otherwise, call the given interface with nToCall -1
     *
     ***/
    void callRecursivly( [in] XRecursiveCall xCall , [in] long nToCall );
};

/**
 * Monster test interface to test bridge calls.
 * An implementation of this object has to store given values and return whenever there
 * is an out param or return value.
 */
published interface XBridgeTestBase : com::sun::star::uno::XInterface
{
    /**
     * in parameter test, tests by calls reference also (complex types)
     */
    [oneway] void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte,
                             [in] short nShort, [in] unsigned short nUShort,
                             [in] long nLong, [in] unsigned long nULong,
                             [in] hyper nHyper, [in] unsigned hyper nUHyper,
                             [in] float fFloat, [in] double fDouble,
                             [in] TestEnum eEnum, [in] string aString,
                             [in] com::sun::star::uno::XInterface xInterface, [in] any aAny,
                             [in] sequence< TestElement > aSequence,
                             [in] TestData aStruct );
    /**
     * inout parameter test
     *
     * @return aStruct. The out parameter contain the values, that were previously set
     *         by setValues or (if not called before) default constructed values.
     *
     */
    TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte,
                         [inout] short nShort, [inout] unsigned short nUShort,
                         [inout] long nLong, [inout] unsigned long nULong,
                         [inout] hyper nHyper, [inout] unsigned hyper nUHyper,
                         [inout] float fFloat, [inout] double fDouble,
                         [inout] TestEnum eEnum, [inout] string aString,
                         [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny,
                         [inout] sequence< TestElement > aSequence,
                         [inout] TestData aStruct );

    /**
     * out parameter test
     */
    TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte,
                        [out] short nShort, [out] unsigned short nUShort,
                        [out] long nLong, [out] unsigned long nULong,
                        [out] hyper nHyper, [out] unsigned hyper nUHyper,
                        [out] float fFloat, [out] double fDouble,
                        [out] TestEnum eEnum, [out] string aString,
                        [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
                        [out] sequence< TestElement > aSequence,
                        [out] TestData aStruct );

    [attribute] boolean                  Bool;
    [attribute] byte                     Byte;
    [attribute] char                     Char;
    [attribute] short                    Short;
    [attribute] unsigned short           UShort;
    [attribute] long                     Long;
    [attribute] unsigned long            ULong;
    [attribute] hyper                    Hyper;
    [attribute] unsigned hyper           UHyper;
    [attribute] float                    Float;
    [attribute] double                   Double;
    [attribute] TestEnum                 Enum;
    [attribute] string                   String;
    [attribute] com::sun::star::uno::XInterface Interface;
    [attribute] any                      Any;
    [attribute] sequence< TestElement >  Sequence;
    [attribute] TestData                 Struct;


    /***
     * This method returns the parameter value.
     * Method to extensivly test anys.
     ****/
    any transportAny( [in] any value );

    /***
     * methods to check sequence of calls. Call call() and callOneway
     * in an arbitrary sequence. Increase the callId for every call.
     * The testobject sets an error flag.

        @see testSequencePassed
     ***/
    void call( [in] long nCallId, [in] long nWaitMUSEC );
    [oneway] void callOneway( [in] long nCallId, [in] long nWaitMUSEC );
    boolean sequenceOfCallTestPassed();

    /****
     * methods to check, if threads thread identity is holded.
     *
     ***/
    void startRecursiveCall( [in] XRecursiveCall xCall , [in] long nToCall );
};


/**
 * Inherting from monster; adds raiseException(), attribute raising RuntimeException.
 */
published interface XBridgeTest : XBridgeTestBase
{
    /**
     * the exception struct returned has to be filled with given arguments.
     * return value is for dummy.
     */
    TestData raiseException( [in] short ArgumentPosition,
                             [in] string Message,
                             [in] com::sun::star::uno::XInterface Context )
        raises( com::sun::star::lang::IllegalArgumentException );


    /**
     * Throws runtime exception.
     * check remote bridges handle exceptions during oneway calls properly.
     * Note that on client side the execption may fly or not. When it flies, it should
     * have the proper message and context.
     ***/
    [oneway] void raiseRuntimeExceptionOneway(  [in] string Message,
                                                [in] com::sun::star::uno::XInterface Context );

    /**
     * raises runtime exception;
     * the exception struct returned has to be filled with formerly set test data.
     */
    [attribute] long                     RuntimeException;
};

/** Extended tests with sequences.
 */
published interface XBridgeTest2 : XBridgeTest
{
    sequence< boolean > setSequenceBool( [in] sequence< boolean > aSeq);
    sequence< char > setSequenceChar( [in] sequence< char > aSeq);
    sequence< byte> setSequenceByte( [in] sequence< byte > aSeq);
    sequence< short> setSequenceShort( [in] sequence< short > aSeq);
    sequence< unsigned short > setSequenceUShort( [in] sequence< unsigned short > aSeq);
    sequence< long > setSequenceLong( [in] sequence< long > aSeq);
    sequence< unsigned long > setSequenceULong( [in] sequence< unsigned long > aSeq);
    sequence< hyper > setSequenceHyper( [in] sequence< hyper > aSeq);
    sequence< unsigned hyper > setSequenceUHyper( [in] sequence< unsigned hyper > aSeq);
    sequence< float > setSequenceFloat( [in] sequence< float > aSeq);
    sequence< double > setSequenceDouble( [in] sequence< double > aSeq);
    sequence< TestEnum > setSequenceEnum( [in] sequence< TestEnum > aSeq);
    sequence< string > setSequenceString( [in] sequence< string > aString);
    sequence< com::sun::star::uno::XInterface > setSequenceXInterface(
        [in] sequence< com::sun::star::uno::XInterface > aSeq);
    sequence< any > setSequenceAny( [in] sequence< any > aSeq);
    sequence< TestElement > setSequenceStruct( [in] sequence< TestElement > aSeq);

    sequence< sequence< long > > setDim2( [in] sequence< sequence< long > > aSeq);
    sequence< sequence < sequence < long > > > setDim3(
        [in] sequence< sequence < sequence < long > > > aSeq);

    void setSequencesInOut( [inout] sequence< boolean > aSeqBoolean,
                       [inout] sequence< char > aSeqChar,
                       [inout] sequence< byte > aSeqByte,
                       [inout] sequence< short > aSeqShort,
                       [inout] sequence< unsigned short> aSeqUShort,
                       [inout] sequence< long > aSeqLong,
                       [inout] sequence< unsigned long > aSeqULong,
                       [inout] sequence< hyper > aSeqHyper,
                       [inout] sequence< unsigned hyper > aSeqUHyper,
                       [inout] sequence< float > aSeqFloat,
                       [inout] sequence< double > aSeqDouble,
                       [inout] sequence< TestEnum > aSeqEnum,
                       [inout] sequence< string > aSeqString,
                       [inout] sequence< com::sun::star::uno::XInterface > aSeqXInterface,
                       [inout] sequence< any > aSeqAny,
                       [inout] sequence< sequence< long > > aSeqDim2,
                       [inout] sequence< sequence < sequence < long > > > aSeqDim3);

    void setSequencesOut( [out] sequence< boolean > aSeqBoolean,
                       [out] sequence< char > aSeqChar,
                       [out] sequence< byte > aSeqByte,
                       [out] sequence< short > aSeqShort,
                       [out] sequence< unsigned short> aSeqUShort,
                       [out] sequence< long > aSeqLong,
                       [out] sequence< unsigned long > aSeqULong,
                       [out] sequence< hyper > aSeqHyper,
                       [out] sequence< unsigned hyper > aSeqUHyper,
                       [out] sequence< float > aSeqFloat,
                       [out] sequence< double > aSeqDouble,
                       [out] sequence< TestEnum > aSeqEnum,
                       [out] sequence< string > aSeqString,
                       [out] sequence< com::sun::star::uno::XInterface > aSeqXInterface,
                       [out] sequence< any > aSeqAny,
                       [out] sequence< sequence< long > > aSeqDim2,
                       [out] sequence< sequence < sequence < long > > > aSeqDim3);


};
//=============================================================================

};
};
};
};
};

#endif