1*408a4873SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*408a4873SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*408a4873SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*408a4873SAndrew Rist * distributed with this work for additional information 6*408a4873SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*408a4873SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*408a4873SAndrew Rist * "License"); you may not use this file except in compliance 9*408a4873SAndrew Rist * with the License. You may obtain a copy of the License at 10*408a4873SAndrew Rist * 11*408a4873SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*408a4873SAndrew Rist * 13*408a4873SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*408a4873SAndrew Rist * software distributed under the License is distributed on an 15*408a4873SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*408a4873SAndrew Rist * KIND, either express or implied. See the License for the 17*408a4873SAndrew Rist * specific language governing permissions and limitations 18*408a4873SAndrew Rist * under the License. 19*408a4873SAndrew Rist * 20*408a4873SAndrew Rist *************************************************************/ 21*408a4873SAndrew Rist 22*408a4873SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_test_bridge_XBridge_idl__ 24cdf0e10cSrcweir#define __com_sun_star_test_bridge_XBridge_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 31cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweirmodule com 35cdf0e10cSrcweir{ 36cdf0e10cSrcweirmodule sun 37cdf0e10cSrcweir{ 38cdf0e10cSrcweirmodule star 39cdf0e10cSrcweir{ 40cdf0e10cSrcweirmodule test 41cdf0e10cSrcweir{ 42cdf0e10cSrcweirmodule bridge 43cdf0e10cSrcweir{ 44cdf0e10cSrcweir 45cdf0e10cSrcweirpublished enum TestEnum 46cdf0e10cSrcweir{ 47cdf0e10cSrcweir TEST, 48cdf0e10cSrcweir ONE, 49cdf0e10cSrcweir TWO, 50cdf0e10cSrcweir CHECK, 51cdf0e10cSrcweir LOLA, 52cdf0e10cSrcweir PALOO, 53cdf0e10cSrcweir ZA 54cdf0e10cSrcweir}; 55cdf0e10cSrcweir 56cdf0e10cSrcweir/** 57cdf0e10cSrcweir * simple types 58cdf0e10cSrcweir */ 59cdf0e10cSrcweirpublished struct TestSimple 60cdf0e10cSrcweir{ 61cdf0e10cSrcweir boolean Bool; 62cdf0e10cSrcweir char Char; 63cdf0e10cSrcweir byte Byte; 64cdf0e10cSrcweir short Short; 65cdf0e10cSrcweir unsigned short UShort; 66cdf0e10cSrcweir long Long; 67cdf0e10cSrcweir unsigned long ULong; 68cdf0e10cSrcweir hyper Hyper; 69cdf0e10cSrcweir unsigned hyper UHyper; 70cdf0e10cSrcweir float Float; 71cdf0e10cSrcweir double Double; 72cdf0e10cSrcweir TestEnum Enum; 73cdf0e10cSrcweir}; 74cdf0e10cSrcweir/** 75cdf0e10cSrcweir * complex types adding string, inteface, any 76cdf0e10cSrcweir */ 77cdf0e10cSrcweirpublished struct TestElement : TestSimple 78cdf0e10cSrcweir{ 79cdf0e10cSrcweir string String; 80cdf0e10cSrcweir com::sun::star::uno::XInterface Interface; 81cdf0e10cSrcweir any Any; 82cdf0e10cSrcweir}; 83cdf0e10cSrcweir/** 84cdf0e10cSrcweir * adding even more complexity, sequence< TestElement > 85cdf0e10cSrcweir */ 86cdf0e10cSrcweirpublished struct TestDataElements : TestElement 87cdf0e10cSrcweir{ 88cdf0e10cSrcweir sequence< TestElement > Sequence; 89cdf0e10cSrcweir}; 90cdf0e10cSrcweir 91cdf0e10cSrcweir/** 92cdf0e10cSrcweir * typedef used in interface 93cdf0e10cSrcweir */ 94cdf0e10cSrcweirpublished typedef TestDataElements TestData; 95cdf0e10cSrcweir 96cdf0e10cSrcweirpublished interface XRecursiveCall : com::sun::star::uno::XInterface 97cdf0e10cSrcweir{ 98cdf0e10cSrcweir /*** 99cdf0e10cSrcweir * @param nToCall If nToCall is 0, the method returns immeadiatly. 100cdf0e10cSrcweir * Otherwise, call the given interface with nToCall -1 101cdf0e10cSrcweir * 102cdf0e10cSrcweir ***/ 103cdf0e10cSrcweir void callRecursivly( [in] XRecursiveCall xCall , [in] long nToCall ); 104cdf0e10cSrcweir}; 105cdf0e10cSrcweir 106cdf0e10cSrcweir/** 107cdf0e10cSrcweir * Monster test interface to test bridge calls. 108cdf0e10cSrcweir * An implementation of this object has to store given values and return whenever there 109cdf0e10cSrcweir * is an out param or return value. 110cdf0e10cSrcweir */ 111cdf0e10cSrcweirpublished interface XBridgeTestBase : com::sun::star::uno::XInterface 112cdf0e10cSrcweir{ 113cdf0e10cSrcweir /** 114cdf0e10cSrcweir * in parameter test, tests by calls reference also (complex types) 115cdf0e10cSrcweir */ 116cdf0e10cSrcweir [oneway] void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte, 117cdf0e10cSrcweir [in] short nShort, [in] unsigned short nUShort, 118cdf0e10cSrcweir [in] long nLong, [in] unsigned long nULong, 119cdf0e10cSrcweir [in] hyper nHyper, [in] unsigned hyper nUHyper, 120cdf0e10cSrcweir [in] float fFloat, [in] double fDouble, 121cdf0e10cSrcweir [in] TestEnum eEnum, [in] string aString, 122cdf0e10cSrcweir [in] com::sun::star::uno::XInterface xInterface, [in] any aAny, 123cdf0e10cSrcweir [in] sequence< TestElement > aSequence, 124cdf0e10cSrcweir [in] TestData aStruct ); 125cdf0e10cSrcweir /** 126cdf0e10cSrcweir * inout parameter test 127cdf0e10cSrcweir * 128cdf0e10cSrcweir * @return aStruct. The out parameter contain the values, that were previously set 129cdf0e10cSrcweir * by setValues or (if not called before) default constructed values. 130cdf0e10cSrcweir * 131cdf0e10cSrcweir */ 132cdf0e10cSrcweir TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte, 133cdf0e10cSrcweir [inout] short nShort, [inout] unsigned short nUShort, 134cdf0e10cSrcweir [inout] long nLong, [inout] unsigned long nULong, 135cdf0e10cSrcweir [inout] hyper nHyper, [inout] unsigned hyper nUHyper, 136cdf0e10cSrcweir [inout] float fFloat, [inout] double fDouble, 137cdf0e10cSrcweir [inout] TestEnum eEnum, [inout] string aString, 138cdf0e10cSrcweir [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny, 139cdf0e10cSrcweir [inout] sequence< TestElement > aSequence, 140cdf0e10cSrcweir [inout] TestData aStruct ); 141cdf0e10cSrcweir 142cdf0e10cSrcweir /** 143cdf0e10cSrcweir * out parameter test 144cdf0e10cSrcweir */ 145cdf0e10cSrcweir TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte, 146cdf0e10cSrcweir [out] short nShort, [out] unsigned short nUShort, 147cdf0e10cSrcweir [out] long nLong, [out] unsigned long nULong, 148cdf0e10cSrcweir [out] hyper nHyper, [out] unsigned hyper nUHyper, 149cdf0e10cSrcweir [out] float fFloat, [out] double fDouble, 150cdf0e10cSrcweir [out] TestEnum eEnum, [out] string aString, 151cdf0e10cSrcweir [out] com::sun::star::uno::XInterface xInterface, [out] any aAny, 152cdf0e10cSrcweir [out] sequence< TestElement > aSequence, 153cdf0e10cSrcweir [out] TestData aStruct ); 154cdf0e10cSrcweir 155cdf0e10cSrcweir [attribute] boolean Bool; 156cdf0e10cSrcweir [attribute] byte Byte; 157cdf0e10cSrcweir [attribute] char Char; 158cdf0e10cSrcweir [attribute] short Short; 159cdf0e10cSrcweir [attribute] unsigned short UShort; 160cdf0e10cSrcweir [attribute] long Long; 161cdf0e10cSrcweir [attribute] unsigned long ULong; 162cdf0e10cSrcweir [attribute] hyper Hyper; 163cdf0e10cSrcweir [attribute] unsigned hyper UHyper; 164cdf0e10cSrcweir [attribute] float Float; 165cdf0e10cSrcweir [attribute] double Double; 166cdf0e10cSrcweir [attribute] TestEnum Enum; 167cdf0e10cSrcweir [attribute] string String; 168cdf0e10cSrcweir [attribute] com::sun::star::uno::XInterface Interface; 169cdf0e10cSrcweir [attribute] any Any; 170cdf0e10cSrcweir [attribute] sequence< TestElement > Sequence; 171cdf0e10cSrcweir [attribute] TestData Struct; 172cdf0e10cSrcweir 173cdf0e10cSrcweir 174cdf0e10cSrcweir /*** 175cdf0e10cSrcweir * This method returns the parameter value. 176cdf0e10cSrcweir * Method to extensivly test anys. 177cdf0e10cSrcweir ****/ 178cdf0e10cSrcweir any transportAny( [in] any value ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir /*** 181cdf0e10cSrcweir * methods to check sequence of calls. Call call() and callOneway 182cdf0e10cSrcweir * in an arbitrary sequence. Increase the callId for every call. 183cdf0e10cSrcweir * The testobject sets an error flag. 184cdf0e10cSrcweir 185cdf0e10cSrcweir @see testSequencePassed 186cdf0e10cSrcweir ***/ 187cdf0e10cSrcweir void call( [in] long nCallId, [in] long nWaitMUSEC ); 188cdf0e10cSrcweir [oneway] void callOneway( [in] long nCallId, [in] long nWaitMUSEC ); 189cdf0e10cSrcweir boolean sequenceOfCallTestPassed(); 190cdf0e10cSrcweir 191cdf0e10cSrcweir /**** 192cdf0e10cSrcweir * methods to check, if threads thread identity is holded. 193cdf0e10cSrcweir * 194cdf0e10cSrcweir ***/ 195cdf0e10cSrcweir void startRecursiveCall( [in] XRecursiveCall xCall , [in] long nToCall ); 196cdf0e10cSrcweir}; 197cdf0e10cSrcweir 198cdf0e10cSrcweir 199cdf0e10cSrcweir/** 200cdf0e10cSrcweir * Inherting from monster; adds raiseException(), attribute raising RuntimeException. 201cdf0e10cSrcweir */ 202cdf0e10cSrcweirpublished interface XBridgeTest : XBridgeTestBase 203cdf0e10cSrcweir{ 204cdf0e10cSrcweir /** 205cdf0e10cSrcweir * the exception struct returned has to be filled with given arguments. 206cdf0e10cSrcweir * return value is for dummy. 207cdf0e10cSrcweir */ 208cdf0e10cSrcweir TestData raiseException( [in] short ArgumentPosition, 209cdf0e10cSrcweir [in] string Message, 210cdf0e10cSrcweir [in] com::sun::star::uno::XInterface Context ) 211cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 212cdf0e10cSrcweir 213cdf0e10cSrcweir 214cdf0e10cSrcweir /** 215cdf0e10cSrcweir * Throws runtime exception. 216cdf0e10cSrcweir * check remote bridges handle exceptions during oneway calls properly. 217cdf0e10cSrcweir * Note that on client side the execption may fly or not. When it flies, it should 218cdf0e10cSrcweir * have the proper message and context. 219cdf0e10cSrcweir ***/ 220cdf0e10cSrcweir [oneway] void raiseRuntimeExceptionOneway( [in] string Message, 221cdf0e10cSrcweir [in] com::sun::star::uno::XInterface Context ); 222cdf0e10cSrcweir 223cdf0e10cSrcweir /** 224cdf0e10cSrcweir * raises runtime exception; 225cdf0e10cSrcweir * the exception struct returned has to be filled with formerly set test data. 226cdf0e10cSrcweir */ 227cdf0e10cSrcweir [attribute] long RuntimeException; 228cdf0e10cSrcweir}; 229cdf0e10cSrcweir 230cdf0e10cSrcweir/** Extended tests with sequences. 231cdf0e10cSrcweir */ 232cdf0e10cSrcweirpublished interface XBridgeTest2 : XBridgeTest 233cdf0e10cSrcweir{ 234cdf0e10cSrcweir sequence< boolean > setSequenceBool( [in] sequence< boolean > aSeq); 235cdf0e10cSrcweir sequence< char > setSequenceChar( [in] sequence< char > aSeq); 236cdf0e10cSrcweir sequence< byte> setSequenceByte( [in] sequence< byte > aSeq); 237cdf0e10cSrcweir sequence< short> setSequenceShort( [in] sequence< short > aSeq); 238cdf0e10cSrcweir sequence< unsigned short > setSequenceUShort( [in] sequence< unsigned short > aSeq); 239cdf0e10cSrcweir sequence< long > setSequenceLong( [in] sequence< long > aSeq); 240cdf0e10cSrcweir sequence< unsigned long > setSequenceULong( [in] sequence< unsigned long > aSeq); 241cdf0e10cSrcweir sequence< hyper > setSequenceHyper( [in] sequence< hyper > aSeq); 242cdf0e10cSrcweir sequence< unsigned hyper > setSequenceUHyper( [in] sequence< unsigned hyper > aSeq); 243cdf0e10cSrcweir sequence< float > setSequenceFloat( [in] sequence< float > aSeq); 244cdf0e10cSrcweir sequence< double > setSequenceDouble( [in] sequence< double > aSeq); 245cdf0e10cSrcweir sequence< TestEnum > setSequenceEnum( [in] sequence< TestEnum > aSeq); 246cdf0e10cSrcweir sequence< string > setSequenceString( [in] sequence< string > aString); 247cdf0e10cSrcweir sequence< com::sun::star::uno::XInterface > setSequenceXInterface( 248cdf0e10cSrcweir [in] sequence< com::sun::star::uno::XInterface > aSeq); 249cdf0e10cSrcweir sequence< any > setSequenceAny( [in] sequence< any > aSeq); 250cdf0e10cSrcweir sequence< TestElement > setSequenceStruct( [in] sequence< TestElement > aSeq); 251cdf0e10cSrcweir 252cdf0e10cSrcweir sequence< sequence< long > > setDim2( [in] sequence< sequence< long > > aSeq); 253cdf0e10cSrcweir sequence< sequence < sequence < long > > > setDim3( 254cdf0e10cSrcweir [in] sequence< sequence < sequence < long > > > aSeq); 255cdf0e10cSrcweir 256cdf0e10cSrcweir void setSequencesInOut( [inout] sequence< boolean > aSeqBoolean, 257cdf0e10cSrcweir [inout] sequence< char > aSeqChar, 258cdf0e10cSrcweir [inout] sequence< byte > aSeqByte, 259cdf0e10cSrcweir [inout] sequence< short > aSeqShort, 260cdf0e10cSrcweir [inout] sequence< unsigned short> aSeqUShort, 261cdf0e10cSrcweir [inout] sequence< long > aSeqLong, 262cdf0e10cSrcweir [inout] sequence< unsigned long > aSeqULong, 263cdf0e10cSrcweir [inout] sequence< hyper > aSeqHyper, 264cdf0e10cSrcweir [inout] sequence< unsigned hyper > aSeqUHyper, 265cdf0e10cSrcweir [inout] sequence< float > aSeqFloat, 266cdf0e10cSrcweir [inout] sequence< double > aSeqDouble, 267cdf0e10cSrcweir [inout] sequence< TestEnum > aSeqEnum, 268cdf0e10cSrcweir [inout] sequence< string > aSeqString, 269cdf0e10cSrcweir [inout] sequence< com::sun::star::uno::XInterface > aSeqXInterface, 270cdf0e10cSrcweir [inout] sequence< any > aSeqAny, 271cdf0e10cSrcweir [inout] sequence< sequence< long > > aSeqDim2, 272cdf0e10cSrcweir [inout] sequence< sequence < sequence < long > > > aSeqDim3); 273cdf0e10cSrcweir 274cdf0e10cSrcweir void setSequencesOut( [out] sequence< boolean > aSeqBoolean, 275cdf0e10cSrcweir [out] sequence< char > aSeqChar, 276cdf0e10cSrcweir [out] sequence< byte > aSeqByte, 277cdf0e10cSrcweir [out] sequence< short > aSeqShort, 278cdf0e10cSrcweir [out] sequence< unsigned short> aSeqUShort, 279cdf0e10cSrcweir [out] sequence< long > aSeqLong, 280cdf0e10cSrcweir [out] sequence< unsigned long > aSeqULong, 281cdf0e10cSrcweir [out] sequence< hyper > aSeqHyper, 282cdf0e10cSrcweir [out] sequence< unsigned hyper > aSeqUHyper, 283cdf0e10cSrcweir [out] sequence< float > aSeqFloat, 284cdf0e10cSrcweir [out] sequence< double > aSeqDouble, 285cdf0e10cSrcweir [out] sequence< TestEnum > aSeqEnum, 286cdf0e10cSrcweir [out] sequence< string > aSeqString, 287cdf0e10cSrcweir [out] sequence< com::sun::star::uno::XInterface > aSeqXInterface, 288cdf0e10cSrcweir [out] sequence< any > aSeqAny, 289cdf0e10cSrcweir [out] sequence< sequence< long > > aSeqDim2, 290cdf0e10cSrcweir [out] sequence< sequence < sequence < long > > > aSeqDim3); 291cdf0e10cSrcweir 292cdf0e10cSrcweir 293cdf0e10cSrcweir}; 294cdf0e10cSrcweir//============================================================================= 295cdf0e10cSrcweir 296cdf0e10cSrcweir}; 297cdf0e10cSrcweir}; 298cdf0e10cSrcweir}; 299cdf0e10cSrcweir}; 300cdf0e10cSrcweir}; 301cdf0e10cSrcweir 302cdf0e10cSrcweir#endif 303