bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / propctrlr / submissionhandler.hxx
blob2832852fe459bdf358fd2f26ffd2bb001e725ead
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 INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
23 #include <memory>
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>
31 namespace comphelper
33 class OPropertyChangeMultiplexer;
37 namespace pcr
41 //= SubmissionHelper
43 class SubmissionHelper : public EFormsHelper
45 public:
46 SubmissionHelper(
47 osl::Mutex& _rMutex,
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
72 private:
73 std::unique_ptr< SubmissionHelper > m_pHelper;
74 rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_xPropChangeMultiplexer;
76 public:
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;
88 protected:
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;
107 private:
108 // OPropertyChangeListener
109 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
113 } // namespace pcr
116 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */