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