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 {
38 return m_xControlInvocation->getIntrospection();
39 }
40
41 //----------------------------------------------------------
invoke(const::rtl::OUString & aFunctionName,const uno::Sequence<uno::Any> & aParams,uno::Sequence<::sal_Int16> & aOutParamIndex,uno::Sequence<uno::Any> & aOutParam)42 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 )
43 {
44 return m_xControlInvocation->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
45 }
46
47 //----------------------------------------------------------
setValue(const::rtl::OUString & aPropertyName,const uno::Any & aValue)48 void SAL_CALL VbaSystemAXControl::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue )
49 {
50 m_xControlInvocation->setValue( aPropertyName, aValue );
51 }
52
53 //----------------------------------------------------------
getValue(const::rtl::OUString & aPropertyName)54 uno::Any SAL_CALL VbaSystemAXControl::getValue( const ::rtl::OUString& aPropertyName )
55 {
56 return m_xControlInvocation->getValue( aPropertyName );
57 }
58
59 //----------------------------------------------------------
hasMethod(const::rtl::OUString & aName)60 ::sal_Bool SAL_CALL VbaSystemAXControl::hasMethod( const ::rtl::OUString& aName )
61 {
62 return m_xControlInvocation->hasMethod( aName );
63 }
64
65 //----------------------------------------------------------
hasProperty(const::rtl::OUString & aName)66 ::sal_Bool SAL_CALL VbaSystemAXControl::hasProperty( const ::rtl::OUString& aName )
67 {
68 return m_xControlInvocation->hasProperty( aName );
69 }
70
71 //----------------------------------------------------------
72 rtl::OUString&
getServiceImplName()73 VbaSystemAXControl::getServiceImplName()
74 {
75 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "VbaSystemAXControl" ) );
76 return sImplName;
77 }
78
79 //----------------------------------------------------------
80 uno::Sequence< rtl::OUString >
getServiceNames()81 VbaSystemAXControl::getServiceNames()
82 {
83 static uno::Sequence< rtl::OUString > aServiceNames;
84 if ( aServiceNames.getLength() == 0 )
85 {
86 aServiceNames.realloc( 1 );
87 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.msforms.Frame" ) );
88 }
89 return aServiceNames;
90 }
91