1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2011 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 INCLUDED_BINARYURP_SOURCE_PROXY_HXX 29 #define INCLUDED_BINARYURP_SOURCE_PROXY_HXX 30 31 #include "sal/config.h" 32 33 #include "boost/noncopyable.hpp" 34 #include "osl/interlck.h" 35 #include "rtl/ref.hxx" 36 #include "rtl/ustring.hxx" 37 #include "typelib/typedescription.h" 38 #include "typelib/typedescription.hxx" 39 #include "uno/any2.h" 40 #include "uno/dispatcher.h" 41 42 namespace binaryurp { class Bridge; } 43 namespace com { namespace sun { namespace star { namespace uno { 44 class UnoInterfaceReference; 45 } } } } 46 47 namespace binaryurp { 48 49 class Proxy: public uno_Interface, private boost::noncopyable { 50 public: 51 Proxy( 52 rtl::Reference< Bridge > const & bridge, rtl::OUString const & oid, 53 com::sun::star::uno::TypeDescription const & type); 54 55 rtl::OUString getOid() const; 56 57 com::sun::star::uno::TypeDescription getType() const; 58 59 void do_acquire(); 60 61 void do_release(); 62 63 void do_free(); 64 65 void do_dispatch( 66 typelib_TypeDescription const * member, void * returnValue, 67 void ** arguments, uno_Any ** exception) const; 68 69 static bool isProxy( 70 rtl::Reference< Bridge > const & bridge, 71 com::sun::star::uno::UnoInterfaceReference const & object, 72 rtl::OUString * oid); 73 74 private: 75 ~Proxy(); 76 77 void do_dispatch_throw( 78 typelib_TypeDescription const * member, void * returnValue, 79 void ** arguments, uno_Any ** exception) const; 80 81 bool isProxy(rtl::Reference< Bridge > const & bridge, rtl::OUString * oid) 82 const; 83 84 rtl::Reference< Bridge > bridge_; 85 rtl::OUString oid_; 86 com::sun::star::uno::TypeDescription type_; 87 oslInterlockedCount references_; 88 }; 89 90 } 91 92 #endif 93