1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
, std::unique_ptr
<AbstractGeometryAttributes
> pGeomHelper
)
27 : ButtonImpl_BASE( xParent
, xContext
, xControl
, xModel
, std::move(pGeomHelper
) )
33 VbaButton::getCaption()
36 m_xProps
->getPropertyValue( "Label" ) >>= Label
;
41 VbaButton::setCaption( const OUString
& _caption
)
43 m_xProps
->setPropertyValue( "Label", uno::makeAny( _caption
) );
46 sal_Bool SAL_CALL
VbaButton::getAutoSize()
48 return ScVbaControl::getAutoSize();
51 void SAL_CALL
VbaButton::setAutoSize( sal_Bool bAutoSize
)
53 ScVbaControl::setAutoSize( bAutoSize
);
56 sal_Bool SAL_CALL
VbaButton::getLocked()
58 return ScVbaControl::getLocked();
61 void SAL_CALL
VbaButton::setLocked( sal_Bool bLocked
)
63 ScVbaControl::setLocked( bLocked
);
66 sal_Bool SAL_CALL
VbaButton::getCancel()
71 void SAL_CALL
VbaButton::setCancel( sal_Bool
/*bCancel*/ )
76 sal_Bool SAL_CALL
VbaButton::getDefault()
82 void SAL_CALL
VbaButton::setDefault( sal_Bool
/*bDefault*/ )
87 sal_Int32 SAL_CALL
VbaButton::getBackColor()
89 return ScVbaControl::getBackColor();
92 void SAL_CALL
VbaButton::setBackColor( sal_Int32 nBackColor
)
94 ScVbaControl::setBackColor( nBackColor
);
97 sal_Int32 SAL_CALL
VbaButton::getForeColor()
99 return ScVbaControl::getForeColor();
102 void SAL_CALL
VbaButton::setForeColor( sal_Int32
/*nForeColor*/ )
107 uno::Reference
< msforms::XNewFont
> SAL_CALL
VbaButton::getFont()
109 return new VbaNewFont( m_xProps
);
113 VbaButton::getServiceImplName()
118 uno::Sequence
< OUString
>
119 VbaButton::getServiceNames()
121 static uno::Sequence
< OUString
> const aServiceNames
123 "ooo.vba.msforms.Button"
125 return aServiceNames
;
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */