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