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