1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski #include "vbabutton.hxx"
25*b1cdbd2cSJim Jagielski #include "vbanewfont.hxx"
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski using namespace com::sun::star;
28*b1cdbd2cSJim Jagielski using namespace ooo::vba;
29*b1cdbd2cSJim Jagielski
30*b1cdbd2cSJim Jagielski
31*b1cdbd2cSJim Jagielski const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
ScVbaButton(const uno::Reference<XHelperInterface> & xParent,const uno::Reference<uno::XComponentContext> & xContext,const uno::Reference<uno::XInterface> & xControl,const uno::Reference<frame::XModel> & xModel,AbstractGeometryAttributes * pGeomHelper)32*b1cdbd2cSJim Jagielski ScVbaButton::ScVbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
33*b1cdbd2cSJim Jagielski {
34*b1cdbd2cSJim Jagielski }
35*b1cdbd2cSJim Jagielski
36*b1cdbd2cSJim Jagielski // Attributes
37*b1cdbd2cSJim Jagielski rtl::OUString SAL_CALL
getCaption()38*b1cdbd2cSJim Jagielski ScVbaButton::getCaption() throw (css::uno::RuntimeException)
39*b1cdbd2cSJim Jagielski {
40*b1cdbd2cSJim Jagielski rtl::OUString Label;
41*b1cdbd2cSJim Jagielski m_xProps->getPropertyValue( LABEL ) >>= Label;
42*b1cdbd2cSJim Jagielski return Label;
43*b1cdbd2cSJim Jagielski }
44*b1cdbd2cSJim Jagielski
45*b1cdbd2cSJim Jagielski void SAL_CALL
setCaption(const rtl::OUString & _caption)46*b1cdbd2cSJim Jagielski ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
47*b1cdbd2cSJim Jagielski {
48*b1cdbd2cSJim Jagielski m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
49*b1cdbd2cSJim Jagielski }
50*b1cdbd2cSJim Jagielski
getAutoSize()51*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL ScVbaButton::getAutoSize() throw (uno::RuntimeException)
52*b1cdbd2cSJim Jagielski {
53*b1cdbd2cSJim Jagielski return sal_False;
54*b1cdbd2cSJim Jagielski }
55*b1cdbd2cSJim Jagielski
setAutoSize(sal_Bool)56*b1cdbd2cSJim Jagielski void SAL_CALL ScVbaButton::setAutoSize( sal_Bool /*bAutoSize*/ ) throw (uno::RuntimeException)
57*b1cdbd2cSJim Jagielski {
58*b1cdbd2cSJim Jagielski }
59*b1cdbd2cSJim Jagielski
getCancel()60*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL ScVbaButton::getCancel() throw (uno::RuntimeException)
61*b1cdbd2cSJim Jagielski {
62*b1cdbd2cSJim Jagielski return sal_False;
63*b1cdbd2cSJim Jagielski }
64*b1cdbd2cSJim Jagielski
setCancel(sal_Bool)65*b1cdbd2cSJim Jagielski void SAL_CALL ScVbaButton::setCancel( sal_Bool /*bCancel*/ ) throw (uno::RuntimeException)
66*b1cdbd2cSJim Jagielski {
67*b1cdbd2cSJim Jagielski }
68*b1cdbd2cSJim Jagielski
getDefault()69*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL ScVbaButton::getDefault() throw (uno::RuntimeException)
70*b1cdbd2cSJim Jagielski {
71*b1cdbd2cSJim Jagielski return sal_False;
72*b1cdbd2cSJim Jagielski }
73*b1cdbd2cSJim Jagielski
setDefault(sal_Bool)74*b1cdbd2cSJim Jagielski void SAL_CALL ScVbaButton::setDefault( sal_Bool /*bDefault*/ ) throw (uno::RuntimeException)
75*b1cdbd2cSJim Jagielski {
76*b1cdbd2cSJim Jagielski }
77*b1cdbd2cSJim Jagielski
getBackColor()78*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL ScVbaButton::getBackColor() throw (uno::RuntimeException)
79*b1cdbd2cSJim Jagielski {
80*b1cdbd2cSJim Jagielski return 0;
81*b1cdbd2cSJim Jagielski }
82*b1cdbd2cSJim Jagielski
setBackColor(sal_Int32)83*b1cdbd2cSJim Jagielski void SAL_CALL ScVbaButton::setBackColor( sal_Int32 /*nBackColor*/ ) throw (uno::RuntimeException)
84*b1cdbd2cSJim Jagielski {
85*b1cdbd2cSJim Jagielski }
86*b1cdbd2cSJim Jagielski
getForeColor()87*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL ScVbaButton::getForeColor() throw (uno::RuntimeException)
88*b1cdbd2cSJim Jagielski {
89*b1cdbd2cSJim Jagielski return 0;
90*b1cdbd2cSJim Jagielski }
91*b1cdbd2cSJim Jagielski
setForeColor(sal_Int32)92*b1cdbd2cSJim Jagielski void SAL_CALL ScVbaButton::setForeColor( sal_Int32 /*nForeColor*/ ) throw (uno::RuntimeException)
93*b1cdbd2cSJim Jagielski {
94*b1cdbd2cSJim Jagielski }
95*b1cdbd2cSJim Jagielski
getFont()96*b1cdbd2cSJim Jagielski uno::Reference< msforms::XNewFont > SAL_CALL ScVbaButton::getFont() throw (uno::RuntimeException)
97*b1cdbd2cSJim Jagielski {
98*b1cdbd2cSJim Jagielski return new VbaNewFont( this, mxContext, m_xProps );
99*b1cdbd2cSJim Jagielski }
100*b1cdbd2cSJim Jagielski
101*b1cdbd2cSJim Jagielski rtl::OUString&
getServiceImplName()102*b1cdbd2cSJim Jagielski ScVbaButton::getServiceImplName()
103*b1cdbd2cSJim Jagielski {
104*b1cdbd2cSJim Jagielski static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") );
105*b1cdbd2cSJim Jagielski return sImplName;
106*b1cdbd2cSJim Jagielski }
107*b1cdbd2cSJim Jagielski
108*b1cdbd2cSJim Jagielski uno::Sequence< rtl::OUString >
getServiceNames()109*b1cdbd2cSJim Jagielski ScVbaButton::getServiceNames()
110*b1cdbd2cSJim Jagielski {
111*b1cdbd2cSJim Jagielski static uno::Sequence< rtl::OUString > aServiceNames;
112*b1cdbd2cSJim Jagielski if ( aServiceNames.getLength() == 0 )
113*b1cdbd2cSJim Jagielski {
114*b1cdbd2cSJim Jagielski aServiceNames.realloc( 1 );
115*b1cdbd2cSJim Jagielski aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) );
116*b1cdbd2cSJim Jagielski }
117*b1cdbd2cSJim Jagielski return aServiceNames;
118*b1cdbd2cSJim Jagielski }
119