1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef TOOLKIT_AWT_VCLXSPINBUTTON_HXX
28 #define TOOLKIT_AWT_VCLXSPINBUTTON_HXX
29 
30 #include <toolkit/awt/vclxwindow.hxx>
31 #include <toolkit/helper/listenermultiplexer.hxx>
32 #include <cppuhelper/implbase1.hxx>
33 #include <comphelper/uno3.hxx>
34 #include <com/sun/star/awt/XSpinValue.hpp>
35 
36 //........................................................................
37 namespace toolkit
38 {
39 //........................................................................
40 
41 	//====================================================================
42 	//= VCLXSpinButton
43 	//====================================================================
44     typedef ::cppu::ImplHelper1 <   ::com::sun::star::awt::XSpinValue
45                                 >   VCLXSpinButton_Base;
46 
47     class VCLXSpinButton :public VCLXWindow
48                          ,public VCLXSpinButton_Base
49 	{
50     private:
51 	    AdjustmentListenerMultiplexer maAdjustmentListeners;
52 
53     public:
54         VCLXSpinButton();
55 
56     protected:
57         ~VCLXSpinButton( );
58 
59         // XInterface
60         DECLARE_XINTERFACE()
61 
62         // XTypeProvider
63         DECLARE_XTYPEPROVIDER()
64 
65 	    // XComponent
66         void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
67 
68         // XSpinValue
69         virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
70         virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
71         virtual void SAL_CALL setValue( sal_Int32 n ) throw (::com::sun::star::uno::RuntimeException);
72         virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException);
73         virtual sal_Int32 SAL_CALL getValue(  ) throw (::com::sun::star::uno::RuntimeException);
74         virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException);
75         virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException);
76         virtual sal_Int32 SAL_CALL getMinimum(  ) throw (::com::sun::star::uno::RuntimeException);
77         virtual sal_Int32 SAL_CALL getMaximum(  ) throw (::com::sun::star::uno::RuntimeException);
78         virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException);
79         virtual sal_Int32 SAL_CALL getSpinIncrement(  ) throw (::com::sun::star::uno::RuntimeException);
80         virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
81         virtual sal_Int32 SAL_CALL getOrientation(  ) throw (::com::sun::star::uno::RuntimeException);
82 
83 	    // VclWindowPeer
84         virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
85         virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
86 
87         // VCLXWindow
88         void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
89 
90     private:
91         VCLXSpinButton( const VCLXSpinButton& );            // never implemented
92         VCLXSpinButton& operator=( const VCLXSpinButton& ); // never implemented
93 	};
94 
95 //........................................................................
96 } // namespacetoolkit
97 //........................................................................
98 
99 #endif // TOOLKIT_INC_TOOLKIT_AWT_VCLXSPINBUTTON_HXX
100 
101