merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / propctrlr / submissionhandler.hxx
blobc2c19ecfb4d959b1029784865284199a996c1ffe
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
29 #define EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
31 #include "propertyhandler.hxx"
32 #include "eformshelper.hxx"
34 /** === begin UNO includes === **/
35 #include <com/sun/star/xforms/XSubmission.hpp>
36 /** === end UNO includes === **/
37 #include <comphelper/propmultiplex.hxx>
39 namespace comphelper
41 class OPropertyChangeMultiplexer;
44 //........................................................................
45 namespace pcr
47 //........................................................................
49 //====================================================================
50 //= SubmissionHelper
51 //====================================================================
52 class SubmissionHelper : public EFormsHelper
54 public:
55 SubmissionHelper(
56 osl::Mutex& _rMutex,
57 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxIntrospectee,
58 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
61 /** determines whether the given control model is able to trigger submissions
63 Instances of the <type>SubmissionHelper</type> class should not be instantiated
64 for components where this method returned <FALSE/>
66 static bool canTriggerSubmissions(
67 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
68 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
69 ) SAL_THROW(());
72 //====================================================================
73 //= SubmissionPropertyHandler
74 //====================================================================
75 class SubmissionPropertyHandler;
76 typedef HandlerComponentBase< SubmissionPropertyHandler > EditPropertyHandler_Base;
77 /** a property handler for any virtual string properties
79 class SubmissionPropertyHandler : public EditPropertyHandler_Base, public ::comphelper::OPropertyChangeListener
81 private:
82 ::osl::Mutex m_aMutex;
83 ::std::auto_ptr< SubmissionHelper > m_pHelper;
84 ::comphelper::OPropertyChangeMultiplexer* m_pPropChangeMultiplexer;
86 public:
87 SubmissionPropertyHandler(
88 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
91 static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException);
92 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException);
94 ~SubmissionPropertyHandler();
96 protected:
97 // XPropertyHandler overriables
98 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
100 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
101 SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
102 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
103 SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
104 virtual ::com::sun::star::inspection::LineDescriptor
105 SAL_CALL describePropertyLine( const ::rtl::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);
106 virtual void SAL_CALL actuatingPropertyChanged( const ::rtl::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);
107 virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rControlValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
108 virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue( const ::rtl::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);
110 // PropertyHandler overridables
111 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
112 SAL_CALL doDescribeSupportedProperties() const;
113 virtual void onNewComponent();
115 private:
116 // OPropertyChangeListener
117 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
120 //........................................................................
121 } // namespace pcr
122 //........................................................................
124 #endif // EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX