Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / vbahelper / source / msforms / vbaspinbutton.cxx
blobc93f6426e514dabe718fb0ba77a8aff45c78d758
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #include "vbaspinbutton.hxx"
29 #include <vector>
31 using namespace com::sun::star;
32 using namespace ooo::vba;
35 const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") );
36 const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") );
37 const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") );
39 ScVbaSpinButton::ScVbaSpinButton( 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 ) : SpinButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
43 // Attributes
44 uno::Any SAL_CALL
45 ScVbaSpinButton::getValue() throw (css::uno::RuntimeException)
47 return m_xProps->getPropertyValue( SPINVALUE );
50 void SAL_CALL
51 ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
53 m_xProps->setPropertyValue( SPINVALUE, _value );
56 ::sal_Int32 SAL_CALL
57 ScVbaSpinButton::getMax() throw (uno::RuntimeException)
59 sal_Int32 nMax = 0;
60 m_xProps->getPropertyValue( SPINMAX ) >>= nMax;
61 return nMax;
64 void SAL_CALL
65 ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
67 m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) );
70 ::sal_Int32 SAL_CALL
71 ScVbaSpinButton::getMin() throw (uno::RuntimeException)
73 sal_Int32 nVal = 0;
74 m_xProps->getPropertyValue( SPINMIN ) >>= nVal;
75 return nVal;
78 void SAL_CALL
79 ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
81 m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) );
84 rtl::OUString
85 ScVbaSpinButton::getServiceImplName()
87 return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton"));
90 uno::Sequence< rtl::OUString >
91 ScVbaSpinButton::getServiceNames()
93 static uno::Sequence< rtl::OUString > aServiceNames;
94 if ( aServiceNames.getLength() == 0 )
96 aServiceNames.realloc( 1 );
97 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
99 return aServiceNames;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */