bump product version to 4.1.6.2
[LibreOffice.git] / forms / source / component / refvaluecomponent.hxx
blob80c3890042785cff28991ae04766e77c80e2ea45
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX
21 #define FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX
23 #include "FormComponent.hxx"
24 #include "togglestate.hxx"
26 //........................................................................
27 namespace frm
29 //........................................................................
31 //====================================================================
32 //= OReferenceValueComponent
33 //====================================================================
34 /** a OBoundControlModel which features the exchange of a reference value
36 class OReferenceValueComponent : public OBoundControlModel
38 private:
39 // <properties>
40 OUString m_sReferenceValue; // the reference value to use for data exchange
41 OUString m_sNoCheckReferenceValue; // the reference value to be exchanged when the control is not checked
42 ToggleState m_eDefaultChecked; // the default check state
43 // </properties>
45 sal_Bool m_bSupportSecondRefValue; // do we support the SecondaryRefValue property?
47 protected:
48 const OUString& getReferenceValue() const { return m_sReferenceValue; }
49 void setReferenceValue( const OUString& _rRefValue );
51 const OUString& getNoCheckReferenceValue() const { return m_sNoCheckReferenceValue; }
53 ToggleState getDefaultChecked() const { return m_eDefaultChecked; }
54 void setDefaultChecked( ToggleState _eChecked ) { m_eDefaultChecked = _eChecked; }
56 protected:
57 OReferenceValueComponent(
58 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory,
59 const OUString& _rUnoControlModelTypeName,
60 const OUString& _rDefault,
61 sal_Bool _bSupportNoCheckRefValue = sal_False
63 DECLARE_DEFAULT_CLONE_CTOR( OReferenceValueComponent )
64 DECLARE_DEFAULT_DTOR( OReferenceValueComponent );
66 // OPropertySet and friends
67 virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const;
68 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
69 throw (::com::sun::star::uno::Exception);
70 virtual sal_Bool SAL_CALL convertFastPropertyValue(
71 ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue )
72 throw (::com::sun::star::lang::IllegalArgumentException);
73 virtual void describeFixedProperties(
74 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
75 ) const;
76 using ::cppu::OPropertySetHelper::getFastPropertyValue;
78 // OBoundControlModel overridables
79 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
80 getSupportedBindingTypes();
81 virtual ::com::sun::star::uno::Any
82 translateExternalValueToControlValue( const ::com::sun::star::uno::Any& _rExternalValue ) const;
83 virtual ::com::sun::star::uno::Any
84 translateControlValueToExternalValue( ) const;
86 virtual ::com::sun::star::uno::Any
87 translateControlValueToValidatableValue( ) const;
89 virtual ::com::sun::star::uno::Any
90 getDefaultForReset() const;
93 //........................................................................
94 } // namespace frm
95 //........................................................................
97 #endif // FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */