1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include "propertyhandler.hxx"
24 #include "eformshelper.hxx"
26 #include <comphelper/propmultiplex.hxx>
27 #include <rtl/ref.hxx>
31 class OPropertyChangeMultiplexer
;
41 class SubmissionHelper
: public EFormsHelper
46 const css::uno::Reference
< css::beans::XPropertySet
>& _rxIntrospectee
,
47 const css::uno::Reference
< css::frame::XModel
>& _rxContextDocument
50 /** determines whether the given control model is able to trigger submissions
52 Instances of the <type>SubmissionHelper</type> class should not be instantiated
53 for components where this method returned <FALSE/>
55 static bool canTriggerSubmissions(
56 const css::uno::Reference
< css::beans::XPropertySet
>& _rxControlModel
,
57 const css::uno::Reference
< css::frame::XModel
>& _rxContextDocument
62 //= SubmissionPropertyHandler
64 /** a property handler for any virtual string properties
66 class SubmissionPropertyHandler
: public PropertyHandlerComponent
, public ::comphelper::OPropertyChangeListener
69 std::unique_ptr
< SubmissionHelper
> m_pHelper
;
70 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_xPropChangeMultiplexer
;
73 explicit SubmissionPropertyHandler(
74 const css::uno::Reference
< css::uno::XComponentContext
>& _rxContext
77 virtual ~SubmissionPropertyHandler() override
;
80 virtual OUString SAL_CALL
getImplementationName() override
;
81 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames () override
;
83 // XPropertyHandler overriables
84 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& _rPropertyName
) override
;
85 virtual void SAL_CALL
setPropertyValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rValue
) override
;
86 virtual css::uno::Sequence
< OUString
>
87 SAL_CALL
getActuatingProperties( ) override
;
88 virtual css::uno::Sequence
< OUString
>
89 SAL_CALL
getSupersededProperties( ) override
;
90 virtual css::inspection::LineDescriptor
91 SAL_CALL
describePropertyLine( const OUString
& _rPropertyName
, const css::uno::Reference
< css::inspection::XPropertyControlFactory
>& _rxControlFactory
) override
;
92 virtual void SAL_CALL
actuatingPropertyChanged( const OUString
& _rActuatingPropertyName
, const css::uno::Any
& _rNewValue
, const css::uno::Any
& _rOldValue
, const css::uno::Reference
< css::inspection::XObjectInspectorUI
>& _rxInspectorUI
, sal_Bool
) override
;
93 virtual css::uno::Any SAL_CALL
convertToPropertyValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rControlValue
) override
;
94 virtual css::uno::Any SAL_CALL
convertToControlValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rPropertyValue
, const css::uno::Type
& _rControlValueType
) override
;
96 // PropertyHandler overridables
97 virtual css::uno::Sequence
< css::beans::Property
>
98 doDescribeSupportedProperties() const override
;
99 virtual void onNewComponent() override
;
102 // OPropertyChangeListener
103 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& _rEvent
) override
;
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */