Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / vbahelper / source / msforms / vbabutton.cxx
blob9f4ddb9182120cf3b8c21001d7d9bd44d65937a5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "vbabutton.hxx"
30 #include "vbanewfont.hxx"
32 using namespace com::sun::star;
33 using namespace ooo::vba;
36 const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
37 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 )
41 // Attributes
42 rtl::OUString SAL_CALL
43 ScVbaButton::getCaption() throw (css::uno::RuntimeException)
45 rtl::OUString Label;
46 m_xProps->getPropertyValue( LABEL ) >>= Label;
47 return Label;
50 void SAL_CALL
51 ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
53 m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
56 sal_Bool SAL_CALL ScVbaButton::getAutoSize() throw (uno::RuntimeException)
58 return ScVbaControl::getAutoSize();
61 void SAL_CALL ScVbaButton::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException)
63 ScVbaControl::setAutoSize( bAutoSize );
66 sal_Bool SAL_CALL ScVbaButton::getLocked() throw (uno::RuntimeException)
68 return ScVbaControl::getLocked();
71 void SAL_CALL ScVbaButton::setLocked( sal_Bool bLocked ) throw (uno::RuntimeException)
73 ScVbaControl::setLocked( bLocked );
76 sal_Bool SAL_CALL ScVbaButton::getCancel() throw (uno::RuntimeException)
78 return sal_False;
81 void SAL_CALL ScVbaButton::setCancel( sal_Bool /*bCancel*/ ) throw (uno::RuntimeException)
85 sal_Bool SAL_CALL ScVbaButton::getDefault() throw (uno::RuntimeException)
87 return sal_False;
90 void SAL_CALL ScVbaButton::setDefault( sal_Bool /*bDefault*/ ) throw (uno::RuntimeException)
94 sal_Int32 SAL_CALL ScVbaButton::getBackColor() throw (uno::RuntimeException)
96 return ScVbaControl::getBackColor();
99 void SAL_CALL ScVbaButton::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException)
101 ScVbaControl::setBackColor( nBackColor );
104 sal_Int32 SAL_CALL ScVbaButton::getForeColor() throw (uno::RuntimeException)
106 return ScVbaControl::getForeColor();
109 void SAL_CALL ScVbaButton::setForeColor( sal_Int32 /*nForeColor*/ ) throw (uno::RuntimeException)
113 uno::Reference< msforms::XNewFont > SAL_CALL ScVbaButton::getFont() throw (uno::RuntimeException)
115 return new VbaNewFont( this, mxContext, m_xProps );
118 rtl::OUString
119 ScVbaButton::getServiceImplName()
121 return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaButton"));
124 uno::Sequence< rtl::OUString >
125 ScVbaButton::getServiceNames()
127 static uno::Sequence< rtl::OUString > aServiceNames;
128 if ( aServiceNames.getLength() == 0 )
130 aServiceNames.realloc( 1 );
131 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) );
133 return aServiceNames;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */