tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / extensions / source / propctrlr / submissionhandler.hxx
blobf263041b21348b9e1b80b28394adfc7988da29b2
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 #pragma once
22 #include <memory>
23 #include "propertyhandler.hxx"
24 #include "eformshelper.hxx"
26 #include <comphelper/propmultiplex.hxx>
27 #include <rtl/ref.hxx>
29 namespace comphelper
31 class OPropertyChangeMultiplexer;
35 namespace pcr
39 //= SubmissionHelper
41 class SubmissionHelper : public EFormsHelper
43 public:
44 SubmissionHelper(
45 osl::Mutex& _rMutex,
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
68 private:
69 std::unique_ptr< SubmissionHelper > m_pHelper;
70 rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_xPropChangeMultiplexer;
72 public:
73 explicit SubmissionPropertyHandler(
74 const css::uno::Reference< css::uno::XComponentContext >& _rxContext
77 virtual ~SubmissionPropertyHandler() override;
78 protected:
79 // XServiceInfo
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;
101 private:
102 // OPropertyChangeListener
103 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
107 } // namespace pcr
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */