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 : #ifndef TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
20 : #define TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
21 :
22 : #include <toolkit/controls/unocontrolmodel.hxx>
23 : #include <toolkit/helper/servicenames.hxx>
24 : #include <toolkit/controls/unocontrolbase.hxx>
25 : #include <toolkit/helper/macros.hxx>
26 : #include <com/sun/star/awt/XSpinValue.hpp>
27 : #include <com/sun/star/awt/XAdjustmentListener.hpp>
28 : #include <comphelper/uno3.hxx>
29 : #include <cppuhelper/implbase2.hxx>
30 :
31 : //........................................................................
32 : namespace toolkit
33 : {
34 : //........................................................................
35 :
36 : //====================================================================
37 : //= UnoSpinButtonModel
38 : //====================================================================
39 22 : class UnoSpinButtonModel : public UnoControlModel
40 : {
41 : protected:
42 : ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
43 : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
44 :
45 : public:
46 : UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
47 2 : UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;}
48 :
49 2 : UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); }
50 :
51 : // XMultiPropertySet
52 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
53 :
54 : // XPersistObject
55 : OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
56 :
57 : // XServiceInfo
58 : OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
59 : ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
60 : };
61 :
62 : //====================================================================
63 : //= UnoSpinButtonControl
64 : //====================================================================
65 :
66 : typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XAdjustmentListener
67 : , ::com::sun::star::awt::XSpinValue
68 : > UnoSpinButtonControl_Base;
69 :
70 2 : class UnoSpinButtonControl :public UnoControlBase
71 : ,public UnoSpinButtonControl_Base
72 : {
73 : private:
74 : AdjustmentListenerMultiplexer maAdjustmentListeners;
75 :
76 : public:
77 : UnoSpinButtonControl();
78 : OUString GetComponentServiceName();
79 :
80 245 : DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase );
81 : ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
82 :
83 : void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
84 2 : void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
85 : void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
86 :
87 : // XTypeProvider
88 : DECLARE_XTYPEPROVIDER()
89 :
90 : // XAdjustmentListener
91 : void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
92 :
93 : // XSpinValue
94 : virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
95 : virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
96 : virtual void SAL_CALL setValue( sal_Int32 value ) throw (::com::sun::star::uno::RuntimeException);
97 : virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException);
98 : virtual sal_Int32 SAL_CALL getValue( ) throw (::com::sun::star::uno::RuntimeException);
99 : virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException);
100 : virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException);
101 : virtual sal_Int32 SAL_CALL getMinimum( ) throw (::com::sun::star::uno::RuntimeException);
102 : virtual sal_Int32 SAL_CALL getMaximum( ) throw (::com::sun::star::uno::RuntimeException);
103 : virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException);
104 : virtual sal_Int32 SAL_CALL getSpinIncrement( ) throw (::com::sun::star::uno::RuntimeException);
105 : virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
106 : virtual sal_Int32 SAL_CALL getOrientation( ) throw (::com::sun::star::uno::RuntimeException);
107 :
108 : // XServiceInfo
109 : OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
110 : ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
111 : };
112 :
113 :
114 :
115 : //........................................................................
116 : } // namespacetoolkit
117 : //........................................................................
118 :
119 : #endif // TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
120 :
121 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|