From 2c32696a04bc195c8ce61a0df6dcafb8c0c49fe0 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Thu, 27 Mar 2003 09:58:12 +0000 Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD --- sd/source/ui/unoidl/unodoc.cxx | 152 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sd/source/ui/unoidl/unodoc.cxx (limited to 'sd/source/ui/unoidl/unodoc.cxx') diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx new file mode 100644 index 000000000000..c3eabd7feb31 --- /dev/null +++ b/sd/source/ui/unoidl/unodoc.cxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: unodoc.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-27 10:58:02 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// System - Includes ----------------------------------------------------- + +#include +#include + +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include +#endif + +#include "sdmod.hxx" + +using namespace ::com::sun::star; + +// com.sun.star.comp.Draw.DrawingDocument + +::rtl::OUString SAL_CALL SdDrawingDocument_getImplementationName() throw( uno::RuntimeException ) +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.DrawingDocument" ) ); +} + +uno::Sequence< rtl::OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNames() throw( uno::RuntimeException ) +{ + uno::Sequence< rtl::OUString > aSeq( 3 ); + aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OfficeDocument")); + aSeq[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocument")); + aSeq[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocumentFactory")); + + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) +{ + // to create the service the SW_MOD should be already initialized + DBG_ASSERT( SD_MOD(), "No StarDraw module!" ); + + if ( SD_MOD() ) + { + ::rtl::OUString aFactoryURL( RTL_CONSTASCII_USTRINGPARAM ( "private:factory/sdraw" ) ); + const SfxObjectFactory* pFactory = SfxObjectFactory::GetFactory( aFactoryURL ); + if ( pFactory ) + { + SfxObjectShell* pShell = pFactory->CreateObject(); + if( pShell ) + return uno::Reference< uno::XInterface >( pShell->GetModel() ); + } + } + + return uno::Reference< uno::XInterface >(); +} + +// com.sun.star.comp.Draw.PresentationDocument + +::rtl::OUString SAL_CALL SdPresentationDocument_getImplementationName() throw( uno::RuntimeException ) +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.PresentationDocument" ) ); +} + +uno::Sequence< rtl::OUString > SAL_CALL SdPresentationDocument_getSupportedServiceNames() throw( uno::RuntimeException ) +{ + uno::Sequence< rtl::OUString > aSeq( 4 ); + aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OfficeDocument")); + aSeq[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocument")); + aSeq[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocumentFactory")); + aSeq[3] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument")); + + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) +{ + // to create the service the SW_MOD should be already initialized + DBG_ASSERT( SD_MOD(), "No StarDraw module!" ); + + if ( SD_MOD() ) + { + ::rtl::OUString aFactoryURL( RTL_CONSTASCII_USTRINGPARAM ( "private:factory/simpress" ) ); + const SfxObjectFactory* pFactory = SfxObjectFactory::GetFactory( aFactoryURL ); + if ( pFactory ) + { + SfxObjectShell* pShell = pFactory->CreateObject(); + if( pShell ) + return uno::Reference< uno::XInterface >( pShell->GetModel() ); + } + } + + return uno::Reference< uno::XInterface >(); +} + + -- cgit