1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: servprov.hxx,v $
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 ************************************************************************/
34 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
40 #include <com/sun/star/uno/Reference.h>
41 #include <com/sun/star/uno/Sequence.h>
42 #include <com/sun/star/uno/XInterface.hpp>
43 #ifndef __COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
44 #include <com/sun/star/lang/XTypeProvider.hpp>
46 #include <cppuhelper/weak.hxx>
49 class EmbedProviderFactory_Impl
;
51 class EmbedServer_Impl
: public ::cppu::OWeakObject
, ::com::sun::star::lang::XTypeProvider
54 EmbedServer_Impl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> &xFactory
);
55 virtual ~EmbedServer_Impl();
58 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
59 throw(::com::sun::star::uno::RuntimeException
);
60 virtual void SAL_CALL
acquire() throw ();
61 virtual void SAL_CALL
release() throw ();
64 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( )
65 throw(::com::sun::star::uno::RuntimeException
);
66 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
67 throw(::com::sun::star::uno::RuntimeException
);
71 CComPtr
< EmbedProviderFactory_Impl
> m_pOLEFactories
[ SUPPORTED_FACTORIES_NUM
];
72 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;
75 class EmbedProviderFactory_Impl
: public IClassFactory
79 EmbedProviderFactory_Impl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
, const GUID
* pGuid
);
80 virtual ~EmbedProviderFactory_Impl();
82 sal_Bool
registerClass();
83 sal_Bool
deregisterClass();
85 /* IUnknown methods */
86 STDMETHOD(QueryInterface
)(REFIID riid
, LPVOID FAR
* ppvObj
);
87 STDMETHOD_(ULONG
, AddRef
)();
88 STDMETHOD_(ULONG
, Release
)();
90 /* IClassFactory methods */
91 STDMETHOD(CreateInstance
)(IUnknown FAR
* punkOuter
, REFIID riid
, void FAR
* FAR
* ppv
);
92 STDMETHOD(LockServer
)(int fLock
);
96 oslInterlockedCount m_refCount
;
98 DWORD m_factoryHandle
;
100 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;