update dev300-m58
[ooovba.git] / vbahelper / source / msforms / vbascrollbar.cxx
blobe754903141129de903b4cfecf7b48efb59760493
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile$
7 * $Revision$
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * MA 02111-1307 USA
34 ************************************************************************/
35 #include "vbascrollbar.hxx"
36 #include <vector>
38 using namespace com::sun::star;
39 using namespace ooo::vba;
42 const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") );
43 const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") );
44 const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
45 const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") );
46 const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") );
47 const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") );
49 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 )
53 // Attributes
54 uno::Any SAL_CALL
55 ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
57 return m_xProps->getPropertyValue( SCROLLVALUE );
60 void SAL_CALL
61 ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
63 m_xProps->setPropertyValue( SCROLLVALUE, _value );
66 ::sal_Int32 SAL_CALL
67 ScVbaScrollBar::getMax() throw (uno::RuntimeException)
69 sal_Int32 nMax = 0;
70 m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
71 return nMax;
74 void SAL_CALL
75 ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
77 m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) );
80 ::sal_Int32 SAL_CALL
81 ScVbaScrollBar::getMin() throw (uno::RuntimeException)
83 sal_Int32 nVal = 0;
84 m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
85 return nVal;
88 void SAL_CALL
89 ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
91 m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) );
94 void SAL_CALL
95 ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
97 m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
100 ::sal_Int32 SAL_CALL
101 ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
103 sal_Int32 nVal = 0;
104 m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
105 return nVal;
108 ::sal_Int32 SAL_CALL
109 ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
111 sal_Int32 nSmallChange = 0;
112 m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
113 return nSmallChange;
116 void SAL_CALL
117 ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
119 m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
122 rtl::OUString&
123 ScVbaScrollBar::getServiceImplName()
125 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") );
126 return sImplName;
129 uno::Sequence< rtl::OUString >
130 ScVbaScrollBar::getServiceNames()
132 static uno::Sequence< rtl::OUString > aServiceNames;
133 if ( aServiceNames.getLength() == 0 )
135 aServiceNames.realloc( 1 );
136 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
138 return aServiceNames;