1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: refvaluecomponent.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX
32 #define FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX
34 #include "FormComponent.hxx"
35 #include "togglestate.hxx"
37 /** === begin UNO includes === **/
38 /** === end UNO includes === **/
40 //........................................................................
43 //........................................................................
45 //====================================================================
46 //= OReferenceValueComponent
47 //====================================================================
48 /** a OBoundControlModel which features the exchange of a reference value
50 class OReferenceValueComponent
: public OBoundControlModel
54 ::rtl::OUString m_sReferenceValue
; // the reference value to use for data exchange
55 ::rtl::OUString m_sNoCheckReferenceValue
; // the reference value to be exchanged when the control is not checked
56 ToggleState m_eDefaultChecked
; // the default check state
59 sal_Bool m_bSupportSecondRefValue
; // do we support the SecondaryRefValue property?
62 const ::rtl::OUString
& getReferenceValue() const { return m_sReferenceValue
; }
63 void setReferenceValue( const ::rtl::OUString
& _rRefValue
);
65 const ::rtl::OUString
& getNoCheckReferenceValue() const { return m_sNoCheckReferenceValue
; }
67 ToggleState
getDefaultChecked() const { return m_eDefaultChecked
; }
68 void setDefaultChecked( ToggleState _eChecked
) { m_eDefaultChecked
= _eChecked
; }
71 OReferenceValueComponent(
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxFactory
,
73 const ::rtl::OUString
& _rUnoControlModelTypeName
,
74 const ::rtl::OUString
& _rDefault
,
75 sal_Bool _bSupportNoCheckRefValue
= sal_False
77 DECLARE_DEFAULT_CLONE_CTOR( OReferenceValueComponent
)
78 DECLARE_DEFAULT_DTOR( OReferenceValueComponent
);
80 // OPropertySet and friends
81 virtual void SAL_CALL
getFastPropertyValue(::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const;
82 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
83 throw (::com::sun::star::uno::Exception
);
84 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
85 ::com::sun::star::uno::Any
& _rConvertedValue
, ::com::sun::star::uno::Any
& _rOldValue
, sal_Int32 _nHandle
, const ::com::sun::star::uno::Any
& _rValue
)
86 throw (::com::sun::star::lang::IllegalArgumentException
);
87 virtual void describeFixedProperties(
88 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& /* [out] */ _rProps
90 using ::cppu::OPropertySetHelper::getFastPropertyValue
;
92 // OBoundControlModel overridables
93 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
94 getSupportedBindingTypes();
95 virtual ::com::sun::star::uno::Any
96 translateExternalValueToControlValue( const ::com::sun::star::uno::Any
& _rExternalValue
) const;
97 virtual ::com::sun::star::uno::Any
98 translateControlValueToExternalValue( ) const;
100 virtual ::com::sun::star::uno::Any
101 translateControlValueToValidatableValue( ) const;
103 virtual ::com::sun::star::uno::Any
104 getDefaultForReset() const;
107 //........................................................................
109 //........................................................................
111 #endif // FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX