1*96821c26SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96821c26SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96821c26SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96821c26SAndrew Rist  * distributed with this work for additional information
6*96821c26SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96821c26SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96821c26SAndrew Rist  * "License"); you may not use this file except in compliance
9*96821c26SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96821c26SAndrew Rist  *
11*96821c26SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96821c26SAndrew Rist  *
13*96821c26SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96821c26SAndrew Rist  * software distributed under the License is distributed on an
15*96821c26SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96821c26SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96821c26SAndrew Rist  * specific language governing permissions and limitations
18*96821c26SAndrew Rist  * under the License.
19*96821c26SAndrew Rist  *
20*96821c26SAndrew Rist  *************************************************************/
21*96821c26SAndrew Rist 
22*96821c26SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef BASCTL_DOCEVENTNOTIFIER_HXX
25cdf0e10cSrcweir #define BASCTL_DOCEVENTNOTIFIER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir /** === begin UNO includes === **/
28cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
29cdf0e10cSrcweir /** === end UNO includes === **/
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <rtl/ref.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <boost/noncopyable.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //........................................................................
36cdf0e10cSrcweir namespace basctl
37cdf0e10cSrcweir {
38cdf0e10cSrcweir //........................................................................
39cdf0e10cSrcweir 
40cdf0e10cSrcweir     class ScriptDocument;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 	//====================================================================
43cdf0e10cSrcweir 	//= DocumentEventListener
44cdf0e10cSrcweir 	//====================================================================
45cdf0e10cSrcweir     class SAL_NO_VTABLE DocumentEventListener : ::boost::noncopyable
46cdf0e10cSrcweir     {
47cdf0e10cSrcweir     public:
48cdf0e10cSrcweir         virtual void onDocumentCreated( const ScriptDocument& _rDocument ) = 0;
49cdf0e10cSrcweir         virtual void onDocumentOpened( const ScriptDocument& _rDocument ) = 0;
50cdf0e10cSrcweir         virtual void onDocumentSave( const ScriptDocument& _rDocument ) = 0;
51cdf0e10cSrcweir         virtual void onDocumentSaveDone( const ScriptDocument& _rDocument ) = 0;
52cdf0e10cSrcweir         virtual void onDocumentSaveAs( const ScriptDocument& _rDocument ) = 0;
53cdf0e10cSrcweir         virtual void onDocumentSaveAsDone( const ScriptDocument& _rDocument ) = 0;
54cdf0e10cSrcweir         virtual void onDocumentClosed( const ScriptDocument& _rDocument ) = 0;
55cdf0e10cSrcweir         virtual void onDocumentTitleChanged( const ScriptDocument& _rDocument ) = 0;
56cdf0e10cSrcweir         virtual void onDocumentModeChanged( const ScriptDocument& _rDocument ) = 0;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir         virtual ~DocumentEventListener();
59cdf0e10cSrcweir     };
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	//====================================================================
62cdf0e10cSrcweir 	//= DocumentEventNotifier
63cdf0e10cSrcweir 	//====================================================================
64cdf0e10cSrcweir     class DocumentEventNotifier_Impl;
65cdf0e10cSrcweir     /** allows registering at the GlobalEventBroadcaster for global document events
66cdf0e10cSrcweir     */
67cdf0e10cSrcweir 	class DocumentEventNotifier
68cdf0e10cSrcweir 	{
69cdf0e10cSrcweir     public:
70cdf0e10cSrcweir         /** create a notifier instance which notifies about events of all documents in the whole application
71cdf0e10cSrcweir         */
72cdf0e10cSrcweir         DocumentEventNotifier( DocumentEventListener& _rListener );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir         /** creates a notifier instance which notifies about events at a single document
75cdf0e10cSrcweir         */
76cdf0e10cSrcweir         DocumentEventNotifier( DocumentEventListener& _rListener,
77cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         ~DocumentEventNotifier();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     public:
82cdf0e10cSrcweir         void    dispose();
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     private:
85cdf0e10cSrcweir         ::rtl::Reference< DocumentEventNotifier_Impl >  m_pImpl;
86cdf0e10cSrcweir 	};
87cdf0e10cSrcweir 
88cdf0e10cSrcweir //........................................................................
89cdf0e10cSrcweir } // namespace basctl
90cdf0e10cSrcweir //........................................................................
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #endif // BASCTL_DOCEVENTNOTIFIER_HXX
93