xref: /aoo42x/main/sw/source/ui/vba/vbapane.cxx (revision efeef26f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #include "vbapane.hxx"
24 #include <vbahelper/vbahelper.hxx>
25 #include <tools/diagnose_ex.h>
26 #include "vbaview.hxx"
27 
28 using namespace ::ooo::vba;
29 using namespace ::com::sun::star;
30 
SwVbaPane(const uno::Reference<ooo::vba::XHelperInterface> & rParent,const uno::Reference<uno::XComponentContext> & rContext,const uno::Reference<frame::XModel> & xModel)31 SwVbaPane::SwVbaPane( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext,
32     const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) :
33     SwVbaPane_BASE( rParent, rContext ), mxModel( xModel )
34 {
35 }
36 
~SwVbaPane()37 SwVbaPane::~SwVbaPane()
38 {
39 }
40 
41 uno::Any SAL_CALL
View()42 SwVbaPane::View() throw ( css::uno::RuntimeException )
43 {
44     return uno::makeAny( uno::Reference< word::XView >( new SwVbaView( this,  mxContext, mxModel ) ) );
45 }
46 
47 void SAL_CALL
Close()48 SwVbaPane::Close( ) throw ( css::uno::RuntimeException )
49 {
50     rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseWin"));
51     dispatchRequests( mxModel,url );
52 }
53 
54 rtl::OUString&
getServiceImplName()55 SwVbaPane::getServiceImplName()
56 {
57 	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaPane") );
58 	return sImplName;
59 }
60 
61 uno::Sequence< rtl::OUString >
getServiceNames()62 SwVbaPane::getServiceNames()
63 {
64 	static uno::Sequence< rtl::OUString > aServiceNames;
65 	if ( aServiceNames.getLength() == 0 )
66 	{
67 		aServiceNames.realloc( 1 );
68 		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Pane" ) );
69 	}
70 	return aServiceNames;
71 }
72 
73