xref: /aoo41x/main/svx/source/inc/fmscriptingenv.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef SVX_FMSCRIPTINGENV_HXX
29 #define SVX_FMSCRIPTINGENV_HXX
30 
31 /** === begin UNO includes === **/
32 #include <com/sun/star/script/XEventAttacherManager.hpp>
33 /** === end UNO includes === **/
34 #include <rtl/ref.hxx>
35 
36 class FmFormModel;
37 //........................................................................
38 namespace svxform
39 {
40 //........................................................................
41 
42 	//====================================================================
43 	//= IFormScriptingEnvironment
44 	//====================================================================
45     /** describes the interface implemented by a component which handles scripting requirements
46         in a form/control environment.
47     */
48     class SAL_NO_VTABLE IFormScriptingEnvironment : public ::rtl::IReference
49 	{
50     public:
51         /** registers an XEventAttacherManager whose events should be monitored and handled
52 
53             @param _rxManager
54                 the XEventAttacherManager to monitor. Must not be <NULL/>.
55 
56             @throws ::com::sun::star::lang::IllegalArgumentException
57                 if <arg>_rxManager</arg> is <NULL/>
58             @throws ::com::sun::star::lang::DisposedException
59                 if the instance is already disposed
60             @throws ::com::sun::star::uno::RuntimeException
61                 if attaching as script listener to the manager fails with a RuntimeException itself
62         */
63         virtual void registerEventAttacherManager(
64             const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >& _rxManager ) = 0;
65 
66         /** registers an XEventAttacherManager whose events should not be monitored and handled anymore
67 
68             @param _rxManager
69                 the XEventAttacherManager which was previously registered. Must not ne <NULL/>.
70 
71             @throws ::com::sun::star::lang::IllegalArgumentException
72                 if <arg>_rxManager</arg> is <NULL/>
73             @throws ::com::sun::star::lang::DisposedException
74                 if the instance is already disposed
75             @throws ::com::sun::star::uno::RuntimeException
76                 if removing as script listener from the manager fails with a RuntimeException itself
77         */
78         virtual void revokeEventAttacherManager(
79             const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >& _rxManager ) = 0;
80 
81         /** disposes the scripting environment instance
82         */
83         virtual void dispose() = 0;
84 
85         virtual ~IFormScriptingEnvironment();
86 	};
87     typedef ::rtl::Reference< IFormScriptingEnvironment >   PFormScriptingEnvironment;
88 
89 	//====================================================================
90     /** creates a default component implementing the IFormScriptingEnvironment interface
91     */
92     PFormScriptingEnvironment   createDefaultFormScriptingEnvironment( FmFormModel& _rFormModel );
93 
94 //........................................................................
95 } // namespace svxform
96 //........................................................................
97 
98 #endif // SVX_FMSCRIPTINGENV_HXX
99 
100