LibreOffice Module vbahelper (master) 1
vbascrollbar.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 "vbascrollbar.hxx"
21
22using namespace com::sun::star;
23using namespace ooo::vba;
24
25ScVbaScrollBar::ScVbaScrollBar( const css::uno::Reference< ov::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 )
26 : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) )
27{
28}
29
30// Attributes
31uno::Any SAL_CALL
33{
34 return m_xProps->getPropertyValue( "ScrollValue" );
35}
36
37void SAL_CALL
39{
40 m_xProps->setPropertyValue( "ScrollValue", _value );
41}
42
43::sal_Int32 SAL_CALL
45{
46 sal_Int32 nMax = 0;
47 m_xProps->getPropertyValue( "ScrollValueMax" ) >>= nMax;
48 return nMax;
49}
50
51void SAL_CALL
52ScVbaScrollBar::setMax( sal_Int32 nVal )
53{
54 m_xProps->setPropertyValue( "ScrollValueMax", uno::Any( nVal ) );
55}
56
57::sal_Int32 SAL_CALL
59{
60 sal_Int32 nVal = 0;
61 m_xProps->getPropertyValue( "ScrollValueMin" ) >>= nVal;
62 return nVal;
63}
64
65void SAL_CALL
66ScVbaScrollBar::setMin( sal_Int32 nVal )
67{
68 m_xProps->setPropertyValue( "ScrollValueMin", uno::Any( nVal ) );
69}
70
71void SAL_CALL
72ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange )
73{
74 m_xProps->setPropertyValue( "BlockIncrement", uno::Any( _largechange ) );
75}
76
77::sal_Int32 SAL_CALL
79{
80 sal_Int32 nVal = 0;
81 m_xProps->getPropertyValue( "BlockIncrement" ) >>= nVal;
82 return nVal;
83}
84
85::sal_Int32 SAL_CALL
87{
88 sal_Int32 nSmallChange = 0;
89 m_xProps->getPropertyValue( "LineIncrement" ) >>= nSmallChange;
90 return nSmallChange;
91}
92
93void SAL_CALL
94ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange )
95{
96 m_xProps->setPropertyValue( "LineIncrement", uno::Any( _smallchange ) );
97}
98
99OUString
101{
102 return "ScVbaScrollBar";
103}
104
105uno::Sequence< OUString >
107{
108 static uno::Sequence< OUString > const aServiceNames
109 {
110 "ooo.vba.msforms.Frame"
111 };
112 return aServiceNames;
113}
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XPropertySet > m_xProps
virtual void SAL_CALL setValue(const css::uno::Any &_value) override
virtual void SAL_CALL setMin(::sal_Int32 _min) override
virtual void SAL_CALL setMax(::sal_Int32 _max) override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual OUString getServiceImplName() override
virtual ::sal_Int32 SAL_CALL getLargeChange() override
virtual void SAL_CALL setSmallChange(::sal_Int32 _smallchange) override
virtual void SAL_CALL setLargeChange(::sal_Int32 _largechange) override
virtual css::uno::Any SAL_CALL getValue() override
ScVbaScrollBar(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)
virtual ::sal_Int32 SAL_CALL getMax() override
virtual ::sal_Int32 SAL_CALL getSmallChange() override
virtual ::sal_Int32 SAL_CALL getMin() override
Sequence< OUString > aServiceNames
Reference< XModel > xModel
cppu::ImplInheritanceHelper< ScVbaControl, ov::msforms::XScrollBar > ScrollBarImpl_BASE