xref: /aoo42x/main/sw/inc/dlelstnr.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 _DLELSTNR_HXX_
29 #define _DLELSTNR_HXX_
30 
31 #include <cppuhelper/weak.hxx>
32 #include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp>
33 #include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
34 #include <com/sun/star/frame/XTerminateListener.hpp>
35 #include <com/sun/star/frame/XDesktop.hpp>
36 #include <cppuhelper/implbase2.hxx>	// helper for implementations
37 
38 
39 namespace com { namespace sun { namespace star {
40 	namespace linguistic2 {
41 		class XDictionaryList;
42 		class XLinguServiceManager;
43         class XProofreadingIterator;
44 	}
45 	namespace frame {
46 		class XTerminateListener;
47 	}
48 } } }
49 
50 ///////////////////////////////////////////////////////////////////////////
51 // SwLinguServiceEventListener
52 // is a EventListener that triggers spellchecking
53 // and hyphenation when relevant changes (to the
54 // dictionaries of the dictionary list, or properties) were made.
55 //
56 
57 class SwLinguServiceEventListener :
58 	public cppu::WeakImplHelper2
59 	<
60 		com::sun::star::linguistic2::XLinguServiceEventListener,
61 		com::sun::star::frame::XTerminateListener
62 	>
63 {
64 	com::sun::star::uno::Reference<
65         com::sun::star::frame::XDesktop >                       xDesktop;
66 	com::sun::star::uno::Reference<
67         com::sun::star::linguistic2::XLinguServiceManager >     xLngSvcMgr;
68     com::sun::star::uno::Reference<
69         com::sun::star::linguistic2::XProofreadingIterator > 	xGCIterator;
70 
71 	// disallow use of copy-constructor and assignment operator
72 	SwLinguServiceEventListener(const SwLinguServiceEventListener &);
73 	SwLinguServiceEventListener & operator = (const SwLinguServiceEventListener &);
74 
75 public:
76 	SwLinguServiceEventListener();
77 	virtual ~SwLinguServiceEventListener();
78 
79 	// XEventListener
80     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEventObj ) throw(::com::sun::star::uno::RuntimeException);
81 
82 	// XDictionaryListEventListener
83     virtual void SAL_CALL processDictionaryListEvent( const ::com::sun::star::linguistic2::DictionaryListEvent& rDicListEvent) throw( ::com::sun::star::uno::RuntimeException );
84 
85 	// XLinguServiceEventListener
86     virtual void SAL_CALL processLinguServiceEvent( const ::com::sun::star::linguistic2::LinguServiceEvent& rLngSvcEvent ) throw(::com::sun::star::uno::RuntimeException);
87 
88     // XTerminateListener
89     virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& rEventObj ) throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
90     virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& rEventObj ) throw(::com::sun::star::uno::RuntimeException);
91 };
92 
93 
94 #endif
95 
96