bump product version to 5.0.4.1
[LibreOffice.git] / vbahelper / source / msforms / vbabutton.cxx
blob07383330a91079d269c5f48e9b0763fb6df6e3be
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "vbabutton.hxx"
21 #include "vbanewfont.hxx"
23 using namespace com::sun::star;
24 using namespace ooo::vba;
26 VbaButton::VbaButton( 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 )
30 // Attributes
31 OUString SAL_CALL
32 VbaButton::getCaption() throw (css::uno::RuntimeException, std::exception)
34 OUString Label;
35 m_xProps->getPropertyValue( "Label" ) >>= Label;
36 return Label;
39 void SAL_CALL
40 VbaButton::setCaption( const OUString& _caption ) throw (::com::sun::star::uno::RuntimeException, std::exception)
42 m_xProps->setPropertyValue( "Label", uno::makeAny( _caption ) );
45 sal_Bool SAL_CALL VbaButton::getAutoSize() throw (uno::RuntimeException, std::exception)
47 return ScVbaControl::getAutoSize();
50 void SAL_CALL VbaButton::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException, std::exception)
52 ScVbaControl::setAutoSize( bAutoSize );
55 sal_Bool SAL_CALL VbaButton::getLocked() throw (uno::RuntimeException, std::exception)
57 return ScVbaControl::getLocked();
60 void SAL_CALL VbaButton::setLocked( sal_Bool bLocked ) throw (uno::RuntimeException, std::exception)
62 ScVbaControl::setLocked( bLocked );
65 sal_Bool SAL_CALL VbaButton::getCancel() throw (uno::RuntimeException, std::exception)
67 return sal_False;
70 void SAL_CALL VbaButton::setCancel( sal_Bool /*bCancel*/ ) throw (uno::RuntimeException, std::exception)
72 // #STUB
75 sal_Bool SAL_CALL VbaButton::getDefault() throw (uno::RuntimeException, std::exception)
77 // #STUB
78 return sal_False;
81 void SAL_CALL VbaButton::setDefault( sal_Bool /*bDefault*/ ) throw (uno::RuntimeException, std::exception)
83 // #STUB
86 sal_Int32 SAL_CALL VbaButton::getBackColor() throw (uno::RuntimeException, std::exception)
88 return ScVbaControl::getBackColor();
91 void SAL_CALL VbaButton::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException, std::exception)
93 ScVbaControl::setBackColor( nBackColor );
96 sal_Int32 SAL_CALL VbaButton::getForeColor() throw (uno::RuntimeException)
98 return ScVbaControl::getForeColor();
101 void SAL_CALL VbaButton::setForeColor( sal_Int32 /*nForeColor*/ ) throw (uno::RuntimeException)
103 // #STUB
106 uno::Reference< msforms::XNewFont > SAL_CALL VbaButton::getFont() throw (uno::RuntimeException, std::exception)
108 return new VbaNewFont( m_xProps );
111 OUString
112 VbaButton::getServiceImplName()
114 return OUString("VbaButton");
117 uno::Sequence< OUString >
118 VbaButton::getServiceNames()
120 static uno::Sequence< OUString > aServiceNames;
121 if ( aServiceNames.getLength() == 0 )
123 aServiceNames.realloc( 1 );
124 aServiceNames[ 0 ] = "ooo.vba.msforms.Button";
126 return aServiceNames;
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */