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 EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
21 #define EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
23 #include "propertyhandler.hxx"
24 #include "eformshelper.hxx"
26 #include <com/sun/star/xforms/XSubmission.hpp>
27 #include <comphelper/propmultiplex.hxx>
31 class OPropertyChangeMultiplexer
;
34 //........................................................................
37 //........................................................................
39 //====================================================================
41 //====================================================================
42 class SubmissionHelper
: public EFormsHelper
47 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxIntrospectee
,
48 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& _rxContextDocument
51 /** determines whether the given control model is able to trigger submissions
53 Instances of the <type>SubmissionHelper</type> class should not be instantiated
54 for components where this method returned <FALSE/>
56 static bool canTriggerSubmissions(
57 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxControlModel
,
58 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& _rxContextDocument
62 //====================================================================
63 //= SubmissionPropertyHandler
64 //====================================================================
65 class SubmissionPropertyHandler
;
66 typedef HandlerComponentBase
< SubmissionPropertyHandler
> EditPropertyHandler_Base
;
67 /** a property handler for any virtual string properties
69 class SubmissionPropertyHandler
: public EditPropertyHandler_Base
, public ::comphelper::OPropertyChangeListener
72 ::osl::Mutex m_aMutex
;
73 ::std::auto_ptr
< SubmissionHelper
> m_pHelper
;
74 ::comphelper::OPropertyChangeMultiplexer
* m_pPropChangeMultiplexer
;
77 SubmissionPropertyHandler(
78 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxContext
81 static OUString SAL_CALL
getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException
);
82 static ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException
);
84 ~SubmissionPropertyHandler();
87 // XPropertyHandler overriables
88 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& _rPropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
setPropertyValue( const OUString
& _rPropertyName
, const ::com::sun::star::uno::Any
& _rValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
90 virtual ::com::sun::star::uno::Sequence
< OUString
>
91 SAL_CALL
getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException
);
92 virtual ::com::sun::star::uno::Sequence
< OUString
>
93 SAL_CALL
getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::com::sun::star::inspection::LineDescriptor
95 SAL_CALL
describePropertyLine( const OUString
& _rPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XPropertyControlFactory
>& _rxControlFactory
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::NullPointerException
, ::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
actuatingPropertyChanged( const OUString
& _rActuatingPropertyName
, const ::com::sun::star::uno::Any
& _rNewValue
, const ::com::sun::star::uno::Any
& _rOldValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XObjectInspectorUI
>& _rxInspectorUI
, sal_Bool
) throw (::com::sun::star::lang::NullPointerException
, ::com::sun::star::uno::RuntimeException
);
97 virtual ::com::sun::star::uno::Any SAL_CALL
convertToPropertyValue( const OUString
& _rPropertyName
, const ::com::sun::star::uno::Any
& _rControlValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
98 virtual ::com::sun::star::uno::Any SAL_CALL
convertToControlValue( const OUString
& _rPropertyName
, const ::com::sun::star::uno::Any
& _rPropertyValue
, const ::com::sun::star::uno::Type
& _rControlValueType
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
100 // PropertyHandler overridables
101 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>
102 SAL_CALL
doDescribeSupportedProperties() const;
103 virtual void onNewComponent();
106 // OPropertyChangeListener
107 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent
& _rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
110 //........................................................................
112 //........................................................................
114 #endif // EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */