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 SD_SPELL_DIALOG_CHILD_WINDOW_HXX
29 #define SD_SPELL_DIALOG_CHILD_WINDOW_HXX
30 
31 #include <svx/SpellDialogChildWindow.hxx>
32 
33 
34 namespace sd {
35 
36 class Outliner;
37 
38 /** This derivation of the ::svx::SpellDialogChildWindow base class
39     provides Draw and Impress specific implementations of
40     GetNextWrongSentence() and ApplyChangedSentence().
41 */
42 class SpellDialogChildWindow
43     : public ::svx::SpellDialogChildWindow
44 {
45 public:
46     SpellDialogChildWindow (
47         ::Window* pParent,
48         sal_uInt16 nId,
49         SfxBindings* pBindings,
50         SfxChildWinInfo* pInfo);
51     virtual ~SpellDialogChildWindow (void);
52 
53     /** This method makes the one from the base class public so that
54         it can be called from the view shell when one is created.
55     */
56     virtual void InvalidateSpellDialog (void);
57 
58 	SFX_DECL_CHILDWINDOW(SpellDialogChildWindow);
59 
60 protected:
61     /** Iterate over the sentences in all text shapes and stop at the
62         next sentence with spelling errors. While doing so the view
63         mode may be changed and text shapes are set into edit mode.
64     */
65     virtual ::svx::SpellPortions GetNextWrongSentence( bool bRecheck );
66 
67     /** This method is responsible for merging corrections made in the
68         spelling dialog back into the document.
69     */
70     virtual void ApplyChangedSentence(const ::svx::SpellPortions& rChanged, bool bRecheck);
71     virtual void GetFocus (void);
72     virtual void LoseFocus (void);
73 
74 private:
75     /** This outliner is used to do the main work of iterating over a
76         document and finding sentences with spelling errors.
77     */
78     Outliner* mpSdOutliner;
79 
80     /** When this flag is <TRUE/> then eventually we have to destroy
81         the outliner in mpSdOutliner.
82     */
83     bool mbOwnOutliner;
84 
85     /** Provide an outliner in the mpSdOutliner data member.  When the
86         view shell has changed since the last call this include the
87         deletion/release of formerly created/obtained one prior to
88         construction/obtaining of a new one.
89     */
90     void ProvideOutliner (void);
91 };
92 
93 } // end of namespace ::sd
94 
95 #endif
96