Update ooo320-m1
[ooovba.git] / extensions / source / ole / ole2uno.hxx
blob8075c98ee2457b7d43d27dcb9555d82e5dcd8a9f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ole2uno.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _OLE2UNO_HXX
32 #define _OLE2UNO_HXX
35 #if _MSC_VER > 1000
36 #pragma once
37 #endif // _MSC_VER > 1000
39 #define STRICT
40 #ifndef _WIN32_WINNT
41 #define _WIN32_WINNT 0x0400
42 #endif
44 #define _WIN32_DCOM
45 #if OSL_DEBUG_LEVEL > 0
46 //#define _ATL_DEBUG_INTERFACES
47 #endif
49 #pragma warning (push,1)
50 #pragma warning (disable:4917)
51 #pragma warning (disable:4005)
52 #pragma warning (disable:4548)
54 #include <tools/prewin.h>
55 #include <tchar.h>
56 #if (_MSC_VER >= 1200) || defined(__MINGW32__)
57 #include <dispex.h>
58 #endif
59 #include <tools/postwin.h>
61 #include <tools/presys.h>
62 #include <list>
63 #include <tools/postsys.h>
65 #pragma warning (pop)
66 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
67 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
68 #include <com/sun/star/script/XInvocation.hpp>
69 #include <com/sun/star/registry/XRegistryKey.hpp>
70 #include <com/sun/star/bridge/XBridgeSupplier2.hpp>
71 #include <com/sun/star/bridge/ModelDependent.hpp>
72 #include <com/sun/star/reflection/InvocationTargetException.hpp>
73 #include <com/sun/star/uno/Exception.hpp>
74 #include <com/sun/star/beans/UnknownPropertyException.hpp>
75 #include <cppuhelper/implbase2.hxx>
76 #include <cppuhelper/implbase1.hxx>
77 #include <cppuhelper/typeprovider.hxx>
78 #include <cppuhelper/factory.hxx>
79 #include <sal/types.h>
80 #include <typelib/typeclass.h>
81 #include <osl/diagnose.h>
82 #include <osl/mutex.hxx>
83 #include <com/sun/star/uno/Reference.h>
84 #include <rtl/process.h>
85 #include <rtl/uuid.h>
87 #define UNO_2_OLE_EXCEPTIONCODE 1001
88 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
89 using namespace com::sun::star::uno;
90 using namespace com::sun::star::lang;
91 using namespace com::sun::star::script;
92 using namespace com::sun::star::registry;
93 using namespace com::sun::star::reflection;
94 using namespace com::sun::star::beans;
95 using namespace osl;
96 using namespace rtl;
97 using namespace std;
101 namespace ole_adapter
104 const VARTYPE getVarType( const Any& val);
105 /* creates a Type object for a given type name.
107 The function returns false if the name does not represent
108 a valid type.
110 bool getType( BSTR name, Type & type);
111 void o2u_attachCurrentThread();
113 struct equalOUString_Impl
115 bool operator()(const OUString & s1, const OUString & s2) const
117 return s1 == s2;
121 struct hashOUString_Impl
123 size_t operator()(const OUString & rName) const
125 return rName.hashCode();
130 class BridgeRuntimeError
132 public:
133 BridgeRuntimeError(const OUString& sMessage)
135 message = sMessage;
137 OUString message;
141 Mutex* getBridgeMutex();
143 } // end namespace
147 #endif // _OLE2UNO_HXX