Update ooo320-m1
[ooovba.git] / basctl / source / inc / doceventnotifier.hxx
blob65e123bbf4cdd5a18bd9ce378ff91968b6ec519c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doceventnotifier.hxx,v $
10 * $Revision: 1.3 $
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 BASCTL_DOCEVENTNOTIFIER_HXX
32 #define BASCTL_DOCEVENTNOTIFIER_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/frame/XModel.hpp>
36 /** === end UNO includes === **/
38 #include <rtl/ref.hxx>
40 #include <boost/noncopyable.hpp>
42 //........................................................................
43 namespace basctl
45 //........................................................................
47 class ScriptDocument;
49 //====================================================================
50 //= DocumentEventListener
51 //====================================================================
52 class SAL_NO_VTABLE DocumentEventListener : ::boost::noncopyable
54 public:
55 virtual void onDocumentCreated( const ScriptDocument& _rDocument ) = 0;
56 virtual void onDocumentOpened( const ScriptDocument& _rDocument ) = 0;
57 virtual void onDocumentSave( const ScriptDocument& _rDocument ) = 0;
58 virtual void onDocumentSaveDone( const ScriptDocument& _rDocument ) = 0;
59 virtual void onDocumentSaveAs( const ScriptDocument& _rDocument ) = 0;
60 virtual void onDocumentSaveAsDone( const ScriptDocument& _rDocument ) = 0;
61 virtual void onDocumentClosed( const ScriptDocument& _rDocument ) = 0;
62 virtual void onDocumentTitleChanged( const ScriptDocument& _rDocument ) = 0;
63 virtual void onDocumentModeChanged( const ScriptDocument& _rDocument ) = 0;
65 virtual ~DocumentEventListener();
68 //====================================================================
69 //= DocumentEventNotifier
70 //====================================================================
71 class DocumentEventNotifier_Impl;
72 /** allows registering at the GlobalEventBroadcaster for global document events
74 class DocumentEventNotifier
76 public:
77 /** create a notifier instance which notifies about events of all documents in the whole application
79 DocumentEventNotifier( DocumentEventListener& _rListener );
81 /** creates a notifier instance which notifies about events at a single document
83 DocumentEventNotifier( DocumentEventListener& _rListener,
84 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument );
86 ~DocumentEventNotifier();
88 public:
89 void dispose();
91 private:
92 ::rtl::Reference< DocumentEventNotifier_Impl > m_pImpl;
95 //........................................................................
96 } // namespace basctl
97 //........................................................................
99 #endif // BASCTL_DOCEVENTNOTIFIER_HXX