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 .
20 #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
24 #include "propertyhandler.hxx"
25 #include "eformshelper.hxx"
27 #include <com/sun/star/xforms/XSubmission.hpp>
28 #include <comphelper/propmultiplex.hxx>
29 #include <rtl/ref.hxx>
33 class OPropertyChangeMultiplexer
;
43 class SubmissionHelper
: public EFormsHelper
48 const css::uno::Reference
< css::beans::XPropertySet
>& _rxIntrospectee
,
49 const css::uno::Reference
< css::frame::XModel
>& _rxContextDocument
52 /** determines whether the given control model is able to trigger submissions
54 Instances of the <type>SubmissionHelper</type> class should not be instantiated
55 for components where this method returned <FALSE/>
57 static bool canTriggerSubmissions(
58 const css::uno::Reference
< css::beans::XPropertySet
>& _rxControlModel
,
59 const css::uno::Reference
< css::frame::XModel
>& _rxContextDocument
64 //= SubmissionPropertyHandler
66 class SubmissionPropertyHandler
;
67 typedef HandlerComponentBase
< SubmissionPropertyHandler
> EditPropertyHandler_Base
;
68 /** a property handler for any virtual string properties
70 class SubmissionPropertyHandler
: public EditPropertyHandler_Base
, public ::comphelper::OPropertyChangeListener
73 std::unique_ptr
< SubmissionHelper
> m_pHelper
;
74 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_xPropChangeMultiplexer
;
77 explicit SubmissionPropertyHandler(
78 const css::uno::Reference
< css::uno::XComponentContext
>& _rxContext
81 /// @throws css::uno::RuntimeException
82 static OUString
getImplementationName_static( );
83 /// @throws css::uno::RuntimeException
84 static css::uno::Sequence
< OUString
> getSupportedServiceNames_static( );
86 virtual ~SubmissionPropertyHandler() override
;
89 // XPropertyHandler overriables
90 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& _rPropertyName
) override
;
91 virtual void SAL_CALL
setPropertyValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rValue
) override
;
92 virtual css::uno::Sequence
< OUString
>
93 SAL_CALL
getActuatingProperties( ) override
;
94 virtual css::uno::Sequence
< OUString
>
95 SAL_CALL
getSupersededProperties( ) override
;
96 virtual css::inspection::LineDescriptor
97 SAL_CALL
describePropertyLine( const OUString
& _rPropertyName
, const css::uno::Reference
< css::inspection::XPropertyControlFactory
>& _rxControlFactory
) override
;
98 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
;
99 virtual css::uno::Any SAL_CALL
convertToPropertyValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rControlValue
) override
;
100 virtual css::uno::Any SAL_CALL
convertToControlValue( const OUString
& _rPropertyName
, const css::uno::Any
& _rPropertyValue
, const css::uno::Type
& _rControlValueType
) override
;
102 // PropertyHandler overridables
103 virtual css::uno::Sequence
< css::beans::Property
>
104 doDescribeSupportedProperties() const override
;
105 virtual void onNewComponent() override
;
108 // OPropertyChangeListener
109 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& _rEvent
) override
;
116 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */