| /************************************************************** | |
| * | |
| * 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, | |
| * software distributed under the License is distributed on an | |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| * KIND, either express or implied. See the License for the | |
| * specific language governing permissions and limitations | |
| * under the License. | |
| * | |
| *************************************************************/ | |
| #ifndef __XFACTORY_HXX_ | |
| #define __XFACTORY_HXX_ | |
| #include <com/sun/star/embed/XEmbedObjectCreator.hpp> | |
| #include <com/sun/star/embed/XEmbedObjectFactory.hpp> | |
| #include <com/sun/star/embed/XLinkCreator.hpp> | |
| #include <com/sun/star/embed/XLinkFactory.hpp> | |
| #include <com/sun/star/lang/XServiceInfo.hpp> | |
| #include <cppuhelper/implbase2.hxx> | |
| #include <cppuhelper/implbase5.hxx> | |
| #include <comphelper/mimeconfighelper.hxx> | |
| class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper5< | |
| ::com::sun::star::embed::XEmbedObjectCreator, | |
| ::com::sun::star::embed::XEmbedObjectFactory, | |
| ::com::sun::star::embed::XLinkCreator, | |
| ::com::sun::star::embed::XLinkFactory, | |
| ::com::sun::star::lang::XServiceInfo > | |
| { | |
| ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; | |
| ::comphelper::MimeConfigurationHelper m_aConfigHelper; | |
| public: | |
| OOoEmbeddedObjectFactory( | |
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) | |
| : m_xFactory( xFactory ) | |
| , m_aConfigHelper( xFactory ) | |
| { | |
| OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" ); | |
| } | |
| static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames(); | |
| static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); | |
| 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 | |
| virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitNew( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ); | |
| 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 ::rtl::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 ); | |
| 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 ::rtl::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 ); | |
| // XEmbedObjectFactory | |
| virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::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 ); | |
| // XLinkCreator | |
| 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 ::rtl::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 ); | |
| // XLinkFactory | |
| virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLinkUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::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 ); | |
| // XServiceInfo | |
| virtual ::rtl::OUString SAL_CALL getImplementationName(); | |
| virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); | |
| virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(); | |
| }; | |
| class OOoSpecialEmbeddedObjectFactory : public ::cppu::WeakImplHelper2< | |
| ::com::sun::star::embed::XEmbedObjectFactory, | |
| ::com::sun::star::lang::XServiceInfo > | |
| { | |
| ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; | |
| ::comphelper::MimeConfigurationHelper m_aConfigHelper; | |
| public: | |
| OOoSpecialEmbeddedObjectFactory( | |
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) | |
| : m_xFactory( xFactory ) | |
| , m_aConfigHelper( xFactory ) | |
| { | |
| OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" ); | |
| } | |
| static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames(); | |
| static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); | |
| 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 | |
| virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::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 ); | |
| // XServiceInfo | |
| virtual ::rtl::OUString SAL_CALL getImplementationName(); | |
| virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); | |
| virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(); | |
| }; | |
| #endif |