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 "vbasystemaxcontrol.hxx"
24
25 using namespace com::sun::star;
26 using namespace ooo::vba;
27
28 //----------------------------------------------------------
VbaSystemAXControl(const uno::Reference<ov::XHelperInterface> & xParent,const uno::Reference<uno::XComponentContext> & xContext,const uno::Reference<uno::XInterface> & xControl,const uno::Reference<frame::XModel> & xModel,AbstractGeometryAttributes * pGeomHelper)29 VbaSystemAXControl::VbaSystemAXControl( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper )
30 : SystemAXControlImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
31 , m_xControlInvocation( xControl, uno::UNO_QUERY_THROW )
32 {
33 }
34
35 //----------------------------------------------------------
getIntrospection()36 uno::Reference< beans::XIntrospectionAccess > SAL_CALL VbaSystemAXControl::getIntrospection()
37 throw ( uno::RuntimeException )
38 {
39 return m_xControlInvocation->getIntrospection();
40 }
41
42 //----------------------------------------------------------
invoke(const::rtl::OUString & aFunctionName,const uno::Sequence<uno::Any> & aParams,uno::Sequence<::sal_Int16> & aOutParamIndex,uno::Sequence<uno::Any> & aOutParam)43 uno::Any SAL_CALL VbaSystemAXControl::invoke( const ::rtl::OUString& aFunctionName, const uno::Sequence< uno::Any >& aParams, uno::Sequence< ::sal_Int16 >& aOutParamIndex, uno::Sequence< uno::Any >& aOutParam )
44 throw ( lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException )
45 {
46 return m_xControlInvocation->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
47 }
48
49 //----------------------------------------------------------
setValue(const::rtl::OUString & aPropertyName,const uno::Any & aValue)50 void SAL_CALL VbaSystemAXControl::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue )
51 throw ( beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException )
52 {
53 m_xControlInvocation->setValue( aPropertyName, aValue );
54 }
55
56 //----------------------------------------------------------
getValue(const::rtl::OUString & aPropertyName)57 uno::Any SAL_CALL VbaSystemAXControl::getValue( const ::rtl::OUString& aPropertyName )
58 throw ( beans::UnknownPropertyException, uno::RuntimeException )
59 {
60 return m_xControlInvocation->getValue( aPropertyName );
61 }
62
63 //----------------------------------------------------------
hasMethod(const::rtl::OUString & aName)64 ::sal_Bool SAL_CALL VbaSystemAXControl::hasMethod( const ::rtl::OUString& aName )
65 throw ( uno::RuntimeException )
66 {
67 return m_xControlInvocation->hasMethod( aName );
68 }
69
70 //----------------------------------------------------------
hasProperty(const::rtl::OUString & aName)71 ::sal_Bool SAL_CALL VbaSystemAXControl::hasProperty( const ::rtl::OUString& aName )
72 throw ( uno::RuntimeException )
73 {
74 return m_xControlInvocation->hasProperty( aName );
75 }
76
77 //----------------------------------------------------------
78 rtl::OUString&
getServiceImplName()79 VbaSystemAXControl::getServiceImplName()
80 {
81 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "VbaSystemAXControl" ) );
82 return sImplName;
83 }
84
85 //----------------------------------------------------------
86 uno::Sequence< rtl::OUString >
getServiceNames()87 VbaSystemAXControl::getServiceNames()
88 {
89 static uno::Sequence< rtl::OUString > aServiceNames;
90 if ( aServiceNames.getLength() == 0 )
91 {
92 aServiceNames.realloc( 1 );
93 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.msforms.Frame" ) );
94 }
95 return aServiceNames;
96 }
97
98