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