Bump for 3.6-28
[LibreOffice.git] / extensions / source / propctrlr / submissionhandler.hxx
blob0ee0e8df8a0301c23be41a64b34b6de4b5359391
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
30 #define EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
32 #include "propertyhandler.hxx"
33 #include "eformshelper.hxx"
35 /** === begin UNO includes === **/
36 #include <com/sun/star/xforms/XSubmission.hpp>
37 /** === end UNO includes === **/
38 #include <comphelper/propmultiplex.hxx>
40 namespace comphelper
42 class OPropertyChangeMultiplexer;
45 //........................................................................
46 namespace pcr
48 //........................................................................
50 //====================================================================
51 //= SubmissionHelper
52 //====================================================================
53 class SubmissionHelper : public EFormsHelper
55 public:
56 SubmissionHelper(
57 osl::Mutex& _rMutex,
58 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxIntrospectee,
59 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
62 /** determines whether the given control model is able to trigger submissions
64 Instances of the <type>SubmissionHelper</type> class should not be instantiated
65 for components where this method returned <FALSE/>
67 static bool canTriggerSubmissions(
68 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
69 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
70 ) SAL_THROW(());
73 //====================================================================
74 //= SubmissionPropertyHandler
75 //====================================================================
76 class SubmissionPropertyHandler;
77 typedef HandlerComponentBase< SubmissionPropertyHandler > EditPropertyHandler_Base;
78 /** a property handler for any virtual string properties
80 class SubmissionPropertyHandler : public EditPropertyHandler_Base, public ::comphelper::OPropertyChangeListener
82 private:
83 ::osl::Mutex m_aMutex;
84 ::std::auto_ptr< SubmissionHelper > m_pHelper;
85 ::comphelper::OPropertyChangeMultiplexer* m_pPropChangeMultiplexer;
87 public:
88 SubmissionPropertyHandler(
89 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
92 static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException);
93 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException);
95 ~SubmissionPropertyHandler();
97 protected:
98 // XPropertyHandler overriables
99 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
100 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);
101 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
102 SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
103 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
104 SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
105 virtual ::com::sun::star::inspection::LineDescriptor
106 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);
107 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);
108 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);
109 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);
111 // PropertyHandler overridables
112 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
113 SAL_CALL doDescribeSupportedProperties() const;
114 virtual void onNewComponent();
116 private:
117 // OPropertyChangeListener
118 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
121 //........................................................................
122 } // namespace pcr
123 //........................................................................
125 #endif // EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */