Branch data Line data Source code
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 : : #include "vbascrollbar.hxx"
20 : : #include <vector>
21 : :
22 : : using namespace com::sun::star;
23 : : using namespace ooo::vba;
24 : :
25 : :
26 : 0 : const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") );
27 : 0 : const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") );
28 : 0 : const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") );
29 : 0 : const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") );
30 : 0 : const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") );
31 : :
32 : 0 : ScVbaScrollBar::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, AbstractGeometryAttributes* pGeomHelper ) : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
33 : : {
34 : 0 : }
35 : :
36 : : // Attributes
37 : : uno::Any SAL_CALL
38 : 0 : ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
39 : : {
40 : 0 : return m_xProps->getPropertyValue( SCROLLVALUE );
41 : : }
42 : :
43 : : void SAL_CALL
44 : 0 : ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
45 : : {
46 : 0 : m_xProps->setPropertyValue( SCROLLVALUE, _value );
47 : 0 : }
48 : :
49 : : ::sal_Int32 SAL_CALL
50 : 0 : ScVbaScrollBar::getMax() throw (uno::RuntimeException)
51 : : {
52 : 0 : sal_Int32 nMax = 0;
53 : 0 : m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
54 : 0 : return nMax;
55 : : }
56 : :
57 : : void SAL_CALL
58 : 0 : ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
59 : : {
60 : 0 : m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) );
61 : 0 : }
62 : :
63 : : ::sal_Int32 SAL_CALL
64 : 0 : ScVbaScrollBar::getMin() throw (uno::RuntimeException)
65 : : {
66 : 0 : sal_Int32 nVal = 0;
67 : 0 : m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
68 : 0 : return nVal;
69 : : }
70 : :
71 : : void SAL_CALL
72 : 0 : ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
73 : : {
74 : 0 : m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) );
75 : 0 : }
76 : :
77 : : void SAL_CALL
78 : 0 : ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
79 : : {
80 : 0 : m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
81 : 0 : }
82 : :
83 : : ::sal_Int32 SAL_CALL
84 : 0 : ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
85 : : {
86 : 0 : sal_Int32 nVal = 0;
87 : 0 : m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
88 : 0 : return nVal;
89 : : }
90 : :
91 : : ::sal_Int32 SAL_CALL
92 : 0 : ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
93 : : {
94 : 0 : sal_Int32 nSmallChange = 0;
95 : 0 : m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
96 : 0 : return nSmallChange;
97 : : }
98 : :
99 : : void SAL_CALL
100 : 0 : ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
101 : : {
102 : 0 : m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
103 : 0 : }
104 : :
105 : : rtl::OUString
106 : 0 : ScVbaScrollBar::getServiceImplName()
107 : : {
108 : 0 : return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar"));
109 : : }
110 : :
111 : : uno::Sequence< rtl::OUString >
112 : 0 : ScVbaScrollBar::getServiceNames()
113 : : {
114 : 0 : static uno::Sequence< rtl::OUString > aServiceNames;
115 : 0 : if ( aServiceNames.getLength() == 0 )
116 : : {
117 : 0 : aServiceNames.realloc( 1 );
118 : 0 : aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
119 : : }
120 : 0 : return aServiceNames;
121 : 0 : }
122 : :
123 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|