2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2003-11-28 16:27:20 +00:00
|
|
|
|
2013-10-22 17:03:24 +02:00
|
|
|
#ifndef INCLUDED_EMBEDDEDOBJ_SOURCE_COMMONEMBEDDING_XFACTORY_HXX
|
|
|
|
#define INCLUDED_EMBEDDEDOBJ_SOURCE_COMMONEMBEDDING_XFACTORY_HXX
|
2003-11-28 16:27:20 +00:00
|
|
|
|
2013-01-08 14:29:06 +02:00
|
|
|
#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
|
2003-11-28 16:27:20 +00:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2004-10-04 18:50:44 +00:00
|
|
|
#include <cppuhelper/implbase2.hxx>
|
2007-07-06 09:07:46 +00:00
|
|
|
#include <comphelper/mimeconfighelper.hxx>
|
2003-11-28 16:27:20 +00:00
|
|
|
|
2013-01-08 14:29:06 +02:00
|
|
|
class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
|
|
|
|
::com::sun::star::embed::XEmbeddedObjectCreator,
|
2003-11-28 16:27:20 +00:00
|
|
|
::com::sun::star::lang::XServiceInfo >
|
|
|
|
{
|
2013-01-08 15:29:57 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
2003-11-28 16:27:20 +00:00
|
|
|
|
2007-07-06 09:07:46 +00:00
|
|
|
::comphelper::MimeConfigurationHelper m_aConfigHelper;
|
2004-10-04 18:50:44 +00:00
|
|
|
|
2003-11-28 16:27:20 +00:00
|
|
|
public:
|
|
|
|
OOoEmbeddedObjectFactory(
|
2013-01-08 15:29:57 +02:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
|
|
|
|
: m_xContext( rxContext )
|
|
|
|
, m_aConfigHelper( rxContext )
|
2003-11-28 16:27:20 +00:00
|
|
|
{
|
2013-01-08 15:29:57 +02:00
|
|
|
OSL_ENSURE( rxContext.is(), "No service manager is provided!\n" );
|
2003-11-28 16:27:20 +00:00
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static ::com::sun::star::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
|
2003-11-28 16:27:20 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static OUString SAL_CALL impl_staticGetImplementationName();
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
|
|
|
|
impl_staticCreateSelfInstance(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
|
|
|
|
|
|
|
|
|
|
|
|
// XEmbedObjectCreator
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitNew( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitFromEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitFromMediaDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
// XEmbedObjectFactory
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, sal_Int32 nEntryConnectionMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
// XLinkCreator
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
// XLinkFactory
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLinkUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
// XServiceInfo
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
|
2003-11-28 16:27:20 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2004-10-04 18:50:44 +00:00
|
|
|
class OOoSpecialEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
|
|
|
|
::com::sun::star::embed::XEmbedObjectFactory,
|
|
|
|
::com::sun::star::lang::XServiceInfo >
|
|
|
|
{
|
2013-01-08 15:29:57 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
2004-10-04 18:50:44 +00:00
|
|
|
|
2007-07-06 09:07:46 +00:00
|
|
|
::comphelper::MimeConfigurationHelper m_aConfigHelper;
|
2004-10-04 18:50:44 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
OOoSpecialEmbeddedObjectFactory(
|
2013-01-08 15:29:57 +02:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
|
|
|
|
: m_xContext( rxContext )
|
|
|
|
, m_aConfigHelper( rxContext )
|
2004-10-04 18:50:44 +00:00
|
|
|
{
|
2013-01-08 15:29:57 +02:00
|
|
|
OSL_ENSURE( rxContext.is(), "No service manager is provided!\n" );
|
2004-10-04 18:50:44 +00:00
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static ::com::sun::star::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
|
2004-10-04 18:50:44 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static OUString SAL_CALL impl_staticGetImplementationName();
|
2004-10-04 18:50:44 +00:00
|
|
|
|
|
|
|
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
|
|
|
|
impl_staticCreateSelfInstance(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
|
|
|
|
|
|
|
|
// XEmbedObjectFactory
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, sal_Int32 nEntryConnectionMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
2004-10-04 18:50:44 +00:00
|
|
|
|
|
|
|
// XServiceInfo
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
|
2004-10-04 18:50:44 +00:00
|
|
|
};
|
|
|
|
|
2003-11-28 16:27:20 +00:00
|
|
|
#endif
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|