LibreOffice Module vbahelper (master) 1
vbabutton.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "vbabutton.hxx"
21#include "vbanewfont.hxx"
22
23using namespace com::sun::star;
24using namespace ooo::vba;
25
26VbaButton::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) )
28{
29}
30
31// Attributes
32OUString SAL_CALL
34{
35 OUString Label;
36 m_xProps->getPropertyValue( "Label" ) >>= Label;
37 return Label;
38}
39
40void SAL_CALL
41VbaButton::setCaption( const OUString& _caption )
42{
43 m_xProps->setPropertyValue( "Label", uno::Any( _caption ) );
44}
45
47{
49}
50
51void SAL_CALL VbaButton::setAutoSize( sal_Bool bAutoSize )
52{
53 ScVbaControl::setAutoSize( bAutoSize );
54}
55
57{
59}
60
61void SAL_CALL VbaButton::setLocked( sal_Bool bLocked )
62{
63 ScVbaControl::setLocked( bLocked );
64}
65
67{
68 return false;
69}
70
71void SAL_CALL VbaButton::setCancel( sal_Bool /*bCancel*/ )
72{
73 // #STUB
74}
75
77{
78 // #STUB
79 return false;
80}
81
82void SAL_CALL VbaButton::setDefault( sal_Bool /*bDefault*/ )
83{
84 // #STUB
85}
86
87sal_Int32 SAL_CALL VbaButton::getBackColor()
88{
90}
91
92void SAL_CALL VbaButton::setBackColor( sal_Int32 nBackColor )
93{
94 ScVbaControl::setBackColor( nBackColor );
95}
96
97sal_Int32 SAL_CALL VbaButton::getForeColor()
98{
100}
101
102void SAL_CALL VbaButton::setForeColor( sal_Int32 /*nForeColor*/ )
103{
104 // #STUB
105}
106
107uno::Reference< msforms::XNewFont > SAL_CALL VbaButton::getFont()
108{
109 return new VbaNewFont( m_xProps );
110}
111
112OUString
114{
115 return "VbaButton";
116}
117
118uno::Sequence< OUString >
120{
121 static uno::Sequence< OUString > const aServiceNames
122 {
123 "ooo.vba.msforms.Button"
124 };
125 return aServiceNames;
126}
127
128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XPropertySet > m_xProps
bool getLocked()
Definition: vbacontrol.cxx:745
virtual ::sal_Int32 SAL_CALL getForeColor()
Definition: vbacontrol.cxx:432
sal_Int32 getBackColor()
Definition: vbacontrol.cxx:708
bool getAutoSize() const
Definition: vbacontrol.cxx:726
void setAutoSize(bool bAutoSize)
Definition: vbacontrol.cxx:737
void setBackColor(sal_Int32 nBackColor)
Definition: vbacontrol.cxx:715
void setLocked(bool bAutoSize)
Definition: vbacontrol.cxx:752
virtual sal_Bool SAL_CALL getDefault() override
Definition: vbabutton.cxx:76
virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() override
Definition: vbabutton.cxx:107
virtual void SAL_CALL setForeColor(sal_Int32 nForeColor) override
Definition: vbabutton.cxx:102
virtual sal_Bool SAL_CALL getAutoSize() override
Definition: vbabutton.cxx:46
virtual void SAL_CALL setAutoSize(sal_Bool bAutoSize) override
Definition: vbabutton.cxx:51
virtual void SAL_CALL setLocked(sal_Bool bAutoSize) override
Definition: vbabutton.cxx:61
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbabutton.cxx:119
virtual void SAL_CALL setDefault(sal_Bool bDefault) override
Definition: vbabutton.cxx:82
virtual OUString getServiceImplName() override
Definition: vbabutton.cxx:113
virtual sal_Int32 SAL_CALL getBackColor() override
Definition: vbabutton.cxx:87
virtual void SAL_CALL setCancel(sal_Bool bCancel) override
Definition: vbabutton.cxx:71
virtual sal_Bool SAL_CALL getCancel() override
Definition: vbabutton.cxx:66
virtual OUString SAL_CALL getCaption() override
Definition: vbabutton.cxx:33
virtual void SAL_CALL setCaption(const OUString &_caption) override
Definition: vbabutton.cxx:41
virtual void SAL_CALL setBackColor(sal_Int32 nBackColor) override
Definition: vbabutton.cxx:92
virtual sal_Int32 SAL_CALL getForeColor() override
Definition: vbabutton.cxx:97
virtual sal_Bool SAL_CALL getLocked() override
Definition: vbabutton.cxx:56
VbaButton(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::uno::XInterface > &xControl, const css::uno::Reference< css::frame::XModel > &xModel, std::unique_ptr< ov::AbstractGeometryAttributes > pGeomHelper)
Definition: vbabutton.cxx:26
Sequence< OUString > aServiceNames
Reference< XModel > xModel
unsigned char sal_Bool
cppu::ImplInheritanceHelper< ScVbaControl, ov::msforms::XCommandButton > ButtonImpl_BASE
Definition: vbabutton.hxx:27