xref: /trunk/main/forms/source/component/spinbutton.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef FORMS_SOURCE_COMPONENT_SPINBUTTON_HXX
24 #define FORMS_SOURCE_COMPONENT_SPINBUTTON_HXX
25 
26 #include "FormComponent.hxx"
27 #include "frm_module.hxx"
28 
29 //........................................................................
30 namespace frm
31 {
32 //........................................................................
33 
34     //====================================================================
35     //= OSpinButtonModel
36     //====================================================================
37     class OSpinButtonModel   :public OBoundControlModel
38     {
39     private:
40         // <properties>
41         sal_Int32   m_nDefaultSpinValue;
42         // </properties>
43 
44     protected:
45         DECLARE_DEFAULT_LEAF_XTOR( OSpinButtonModel );
46 
47         // XServiceInfo
48         DECLARE_SERVICE_REGISTRATION( OSpinButtonModel )
49 
50         // XPersistObject
51         DECLARE_XPERSISTOBJECT()
52 
53         // XCloneable
54         DECLARE_XCLONEABLE();
55 
56         // XPropertyState
57         virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 _nHandle ) const;
58 
59         // OControlModel's property handling
60         virtual void describeFixedProperties(
61             ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
62         ) const;
63 
64         // OPropertySetHelper
65         virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
66         virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue );
67         virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue );
68 
69         // OBoundControlModel
70         virtual ::com::sun::star::uno::Any
71                                 translateDbColumnToControlValue( );
72         virtual sal_Bool        commitControlValueToDbColumn( bool _bPostReset );
73         virtual ::com::sun::star::uno::Any
74                                 getDefaultForReset() const;
75 
76         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
77                                 getSupportedBindingTypes();
78         virtual ::com::sun::star::uno::Any
79                                 translateExternalValueToControlValue( const ::com::sun::star::uno::Any& _rExternalValue ) const;
80         virtual ::com::sun::star::uno::Any
81                                 translateControlValueToExternalValue( ) const;
82 
83         // XCoponent and related helpers
84         virtual void SAL_CALL disposing();
85 
86         // prevent method hiding
87         using OBoundControlModel::disposing;
88         using OBoundControlModel::getFastPropertyValue;
89 
90     };
91 //........................................................................
92 } // namespacefrm
93 //........................................................................
94 
95 #endif // FORMS_SOURCE_COMPONENT_SPINBUTTON_HXX
96