1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: submissionhandler.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
32 #define EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX
34 #include "propertyhandler.hxx"
35 #include "eformshelper.hxx"
37 /** === begin UNO includes === **/
38 #include <com/sun/star/xforms/XSubmission.hpp>
39 /** === end UNO includes === **/
40 #include <comphelper/propmultiplex.hxx>
44 class OPropertyChangeMultiplexer
;
47 //........................................................................
50 //........................................................................
52 //====================================================================
54 //====================================================================
55 class SubmissionHelper
: public EFormsHelper
60 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxIntrospectee
,
61 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& _rxContextDocument
64 /** determines whether the given control model is able to trigger submissions
66 Instances of the <type>SubmissionHelper</type> class should not be instantiated
67 for components where this method returned <FALSE/>
69 static bool canTriggerSubmissions(
70 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxControlModel
,
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& _rxContextDocument
75 //====================================================================
76 //= SubmissionPropertyHandler
77 //====================================================================
78 class SubmissionPropertyHandler
;
79 typedef HandlerComponentBase
< SubmissionPropertyHandler
> EditPropertyHandler_Base
;
80 /** a property handler for any virtual string properties
82 class SubmissionPropertyHandler
: public EditPropertyHandler_Base
, public ::comphelper::OPropertyChangeListener
85 ::osl::Mutex m_aMutex
;
86 ::std::auto_ptr
< SubmissionHelper
> m_pHelper
;
87 ::comphelper::OPropertyChangeMultiplexer
* m_pPropChangeMultiplexer
;
90 SubmissionPropertyHandler(
91 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxContext
94 static ::rtl::OUString SAL_CALL
getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException
);
95 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException
);
97 ~SubmissionPropertyHandler();
100 // XPropertyHandler overriables
101 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& _rPropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
102 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
);
103 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
104 SAL_CALL
getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException
);
105 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
106 SAL_CALL
getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException
);
107 virtual ::com::sun::star::inspection::LineDescriptor
108 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
);
109 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
);
110 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
);
111 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
);
113 // PropertyHandler overridables
114 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>
115 SAL_CALL
doDescribeSupportedProperties() const;
116 virtual void onNewComponent();
119 // OPropertyChangeListener
120 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent
& _rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
123 //........................................................................
125 //........................................................................
127 #endif // EXTENSIONS_SOURCE_PROPCTRLR_SUBMISSIONHANDLER_HXX