1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <com/sun/star/uno/XInterface.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <cppuhelper/weak.hxx>
32 class EmbedProviderFactory_Impl
;
34 class EmbedServer_Impl
: public ::cppu::OWeakObject
, ::com::sun::star::lang::XTypeProvider
37 EmbedServer_Impl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> &xFactory
);
38 virtual ~EmbedServer_Impl();
41 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
42 throw(::com::sun::star::uno::RuntimeException
);
43 virtual void SAL_CALL
acquire() throw ();
44 virtual void SAL_CALL
release() throw ();
47 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( )
48 throw(::com::sun::star::uno::RuntimeException
);
49 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
50 throw(::com::sun::star::uno::RuntimeException
);
54 CComPtr
< EmbedProviderFactory_Impl
> m_pOLEFactories
[ SUPPORTED_FACTORIES_NUM
];
55 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;
58 class EmbedProviderFactory_Impl
: public IClassFactory
62 EmbedProviderFactory_Impl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
, const GUID
* pGuid
);
63 virtual ~EmbedProviderFactory_Impl();
65 sal_Bool
registerClass();
66 sal_Bool
deregisterClass();
68 /* IUnknown methods */
69 STDMETHOD(QueryInterface
)(REFIID riid
, LPVOID FAR
* ppvObj
);
70 STDMETHOD_(ULONG
, AddRef
)();
71 STDMETHOD_(ULONG
, Release
)();
73 /* IClassFactory methods */
74 STDMETHOD(CreateInstance
)(IUnknown FAR
* punkOuter
, REFIID riid
, void FAR
* FAR
* ppv
);
75 STDMETHOD(LockServer
)(int fLock
);
79 oslInterlockedCount m_refCount
;
81 DWORD m_factoryHandle
;
83 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */