Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / embedserv / source / inc / servprov.hxx
blobac40aaac68a14c09169dec7555e4d64540ab91af
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef _SERVPROV_HXX
21 #define _SERVPROV_HXX
23 #include "common.h"
24 #include <oleidl.h>
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
36 public:
37 EmbedServer_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &xFactory );
38 virtual ~EmbedServer_Impl();
40 // XInterface
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 ();
46 // XTypeProvider
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);
52 protected:
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
60 public:
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);
77 protected:
79 oslInterlockedCount m_refCount;
80 GUID m_guid;
81 DWORD m_factoryHandle;
83 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
86 #endif
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */