xref: /aoo42x/main/svx/source/inc/fmscriptingenv.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SVX_FMSCRIPTINGENV_HXX
25 #define SVX_FMSCRIPTINGENV_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/script/XEventAttacherManager.hpp>
29 /** === end UNO includes === **/
30 #include <rtl/ref.hxx>
31 
32 class FmFormModel;
33 //........................................................................
34 namespace svxform
35 {
36 //........................................................................
37 
38 	//====================================================================
39 	//= IFormScriptingEnvironment
40 	//====================================================================
41     /** describes the interface implemented by a component which handles scripting requirements
42         in a form/control environment.
43     */
44     class SAL_NO_VTABLE IFormScriptingEnvironment : public ::rtl::IReference
45 	{
46     public:
47         /** registers an XEventAttacherManager whose events should be monitored and handled
48 
49             @param _rxManager
50                 the XEventAttacherManager to monitor. Must not be <NULL/>.
51 
52             @throws ::com::sun::star::lang::IllegalArgumentException
53                 if <arg>_rxManager</arg> is <NULL/>
54             @throws ::com::sun::star::lang::DisposedException
55                 if the instance is already disposed
56             @throws ::com::sun::star::uno::RuntimeException
57                 if attaching as script listener to the manager fails with a RuntimeException itself
58         */
59         virtual void registerEventAttacherManager(
60             const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >& _rxManager ) = 0;
61 
62         /** registers an XEventAttacherManager whose events should not be monitored and handled anymore
63 
64             @param _rxManager
65                 the XEventAttacherManager which was previously registered. Must not ne <NULL/>.
66 
67             @throws ::com::sun::star::lang::IllegalArgumentException
68                 if <arg>_rxManager</arg> is <NULL/>
69             @throws ::com::sun::star::lang::DisposedException
70                 if the instance is already disposed
71             @throws ::com::sun::star::uno::RuntimeException
72                 if removing as script listener from the manager fails with a RuntimeException itself
73         */
74         virtual void revokeEventAttacherManager(
75             const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >& _rxManager ) = 0;
76 
77         /** disposes the scripting environment instance
78         */
79         virtual void dispose() = 0;
80 
81         virtual ~IFormScriptingEnvironment();
82 	};
83     typedef ::rtl::Reference< IFormScriptingEnvironment >   PFormScriptingEnvironment;
84 
85 	//====================================================================
86     /** creates a default component implementing the IFormScriptingEnvironment interface
87     */
88     PFormScriptingEnvironment   createDefaultFormScriptingEnvironment( FmFormModel& _rFormModel );
89 
90 //........................................................................
91 } // namespace svxform
92 //........................................................................
93 
94 #endif // SVX_FMSCRIPTINGENV_HXX
95 
96