LibreOffice Module forms (master) 1
refvaluecomponent.hxx
Go to the documentation of this file.
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
20#pragma once
21
22#include <FormComponent.hxx>
23#include <togglestate.hxx>
24
25
26namespace frm
27{
28
32 {
33 private:
34 // <properties>
35 OUString m_sReferenceValue; // the reference value to use for data exchange
36 OUString m_sNoCheckReferenceValue; // the reference value to be exchanged when the control is not checked
37 ToggleState m_eDefaultChecked; // the default check state
38 // </properties>
39
40 protected:
41 const OUString& getReferenceValue() const { return m_sReferenceValue; }
42 void setReferenceValue( const OUString& _rRefValue );
43
44 const OUString& getNoCheckReferenceValue() const { return m_sNoCheckReferenceValue; }
45
47 void setDefaultChecked( ToggleState _eChecked ) { m_eDefaultChecked = _eChecked; }
48
49 protected:
51 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory,
52 const OUString& _rUnoControlModelTypeName,
53 const OUString& _rDefault
54 );
56 const OReferenceValueComponent* _pOriginal,
57 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory
58 );
59
60 virtual ~OReferenceValueComponent() override;
61
62 // OPropertySet and friends
63 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle) const override;
64 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
65 virtual sal_Bool SAL_CALL convertFastPropertyValue(
66 css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle, const css::uno::Any& _rValue ) override;
67 virtual void describeFixedProperties(
68 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps
69 ) const override;
70 using ::cppu::OPropertySetHelper::getFastPropertyValue;
71
72 // OBoundControlModel overridables
73 virtual css::uno::Sequence< css::uno::Type >
74 getSupportedBindingTypes() override;
75 virtual css::uno::Any translateExternalValueToControlValue( const css::uno::Any& _rExternalValue ) const override;
76 virtual css::uno::Any translateControlValueToExternalValue( ) const override;
77
78 virtual css::uno::Any translateControlValueToValidatableValue( ) const override;
79
80 virtual css::uno::Any getDefaultForReset() const override;
81 };
82
83
84} // namespace frm
85
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
an OBoundControlModel which features the exchange of a reference value
OReferenceValueComponent(const OReferenceValueComponent *_pOriginal, const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual css::uno::Any translateControlValueToValidatableValue() const override
retrieves the current value of the control, in a shape which can be used with our external validator.
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &_rConvertedValue, css::uno::Any &_rOldValue, sal_Int32 _nHandle, const css::uno::Any &_rValue) override
void setDefaultChecked(ToggleState _eChecked)
virtual css::uno::Any getDefaultForReset() const override
returns the default which should be used when resetting the control
virtual ~OReferenceValueComponent() override
virtual css::uno::Any translateControlValueToExternalValue() const override
commits the current control value to our external value binding
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
OReferenceValueComponent(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory, const OUString &_rUnoControlModelTypeName, const OUString &_rDefault)
const OUString & getReferenceValue() const
ToggleState getDefaultChecked() const
virtual void describeFixedProperties(css::uno::Sequence< css::beans::Property > &_rProps) const override
describes the properties provided by this class, or its respective derived class
const OUString & getNoCheckReferenceValue() const
virtual css::uno::Any translateExternalValueToControlValue(const css::uno::Any &_rExternalValue) const override
translates the given value, which was obtained from the current external value binding,...
virtual css::uno::Sequence< css::uno::Type > getSupportedBindingTypes() override
returns the data types which the control could use to exchange data with an external value binding
void setReferenceValue(const OUString &_rRefValue)
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
ToggleState
Definition: togglestate.hxx:27
unsigned char sal_Bool