update dev300-m58
[ooovba.git] / extensions / source / ole / unotypewrapper.hxx
bloba77a7494e84bb4ee40ecdddc3a0d193186642aac
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: unotypewrapper.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
30 #ifndef UNO_TYPE_WRAPPER_HXX
31 #define UNO_TYPE_WRAPPER_HXX
33 #pragma warning (push,1)
34 #pragma warning (disable:4548)
36 #include <tools/presys.h>
37 //#include "stdafx.h"
38 #define STRICT
39 #define _WIN32_WINNT 0x0400
40 #define _WIN32_DCOM
41 #if OSL_DEBUG_LEVEL > 0
42 //#define _ATL_DEBUG_INTERFACES
43 #endif
44 #include <atlbase.h>
45 extern CComModule _Module;
46 #include <atlcom.h>
47 #include <tools/postsys.h>
49 #pragma warning (pop)
50 #pragma warning (disable:4505)
51 // disable "unreferenced local function has been removed" globally
53 #include "comifaces.hxx"
55 /* creates an UnoTypWrapper and sets the Name property to the value
56 specified by sTypeName.
57 Returns true if the object could be created and initialized.
59 bool createUnoTypeWrapper(BSTR sTypeName, VARIANT * pVariant);
60 bool createUnoTypeWrapper(const rtl::OUString& sTypeName, VARIANT * pVar);
62 class UnoTypeWrapper:
63 public CComObjectRootEx<CComMultiThreadModel>,
64 public IUnoTypeWrapper,
65 public IDispatch
67 public:
68 UnoTypeWrapper();
69 virtual ~UnoTypeWrapper();
71 BEGIN_COM_MAP(UnoTypeWrapper)
72 COM_INTERFACE_ENTRY(IDispatch)
73 COM_INTERFACE_ENTRY(IUnoTypeWrapper)
74 END_COM_MAP()
76 // IDispatch -------------------------------------------
77 STDMETHOD( GetTypeInfoCount)(UINT *pctinfo);
79 STDMETHOD( GetTypeInfo)( UINT iTInfo,
80 LCID lcid,
81 ITypeInfo **ppTInfo);
83 STDMETHOD( GetIDsOfNames)( REFIID riid,
84 LPOLESTR *rgszNames,
85 UINT cNames,
86 LCID lcid,
87 DISPID *rgDispId);
89 STDMETHOD( Invoke)( DISPID dispIdMember,
90 REFIID riid,
91 LCID lcid,
92 WORD wFlags,
93 DISPPARAMS *pDispParams,
94 VARIANT *pVarResult,
95 EXCEPINFO *pExcepInfo,
96 UINT *puArgErr);
97 // IUnoTypeWrapper --------------------------------------
98 STDMETHOD(put_Name)(BSTR val);
99 STDMETHOD(get_Name)(BSTR* pVal);
101 CComBSTR m_sName;
104 #endif