1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #include "vbapane.hxx" 28 #include <vbahelper/vbahelper.hxx> 29 #include <tools/diagnose_ex.h> 30 #include "vbaview.hxx" 31 32 using namespace ::ooo::vba; 33 using namespace ::com::sun::star; 34 35 SwVbaPane::SwVbaPane( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, 36 const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : 37 SwVbaPane_BASE( rParent, rContext ), mxModel( xModel ) 38 { 39 } 40 41 SwVbaPane::~SwVbaPane() 42 { 43 } 44 45 uno::Any SAL_CALL 46 SwVbaPane::View() throw ( css::uno::RuntimeException ) 47 { 48 return uno::makeAny( uno::Reference< word::XView >( new SwVbaView( this, mxContext, mxModel ) ) ); 49 } 50 51 void SAL_CALL 52 SwVbaPane::Close( ) throw ( css::uno::RuntimeException ) 53 { 54 rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseWin")); 55 dispatchRequests( mxModel,url ); 56 } 57 58 rtl::OUString& 59 SwVbaPane::getServiceImplName() 60 { 61 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaPane") ); 62 return sImplName; 63 } 64 65 uno::Sequence< rtl::OUString > 66 SwVbaPane::getServiceNames() 67 { 68 static uno::Sequence< rtl::OUString > aServiceNames; 69 if ( aServiceNames.getLength() == 0 ) 70 { 71 aServiceNames.realloc( 1 ); 72 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Pane" ) ); 73 } 74 return aServiceNames; 75 } 76 77