1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SD_SPELL_DIALOG_CHILD_WINDOW_HXX
25cdf0e10cSrcweir #define SD_SPELL_DIALOG_CHILD_WINDOW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/SpellDialogChildWindow.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace sd {
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class Outliner;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /** This derivation of the ::svx::SpellDialogChildWindow base class
35cdf0e10cSrcweir     provides Draw and Impress specific implementations of
36cdf0e10cSrcweir     GetNextWrongSentence() and ApplyChangedSentence().
37cdf0e10cSrcweir */
38cdf0e10cSrcweir class SpellDialogChildWindow
39cdf0e10cSrcweir     : public ::svx::SpellDialogChildWindow
40cdf0e10cSrcweir {
41cdf0e10cSrcweir public:
42cdf0e10cSrcweir     SpellDialogChildWindow (
43cdf0e10cSrcweir         ::Window* pParent,
44cdf0e10cSrcweir         sal_uInt16 nId,
45cdf0e10cSrcweir         SfxBindings* pBindings,
46cdf0e10cSrcweir         SfxChildWinInfo* pInfo);
47cdf0e10cSrcweir     virtual ~SpellDialogChildWindow (void);
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     /** This method makes the one from the base class public so that
50cdf0e10cSrcweir         it can be called from the view shell when one is created.
51cdf0e10cSrcweir     */
52cdf0e10cSrcweir     virtual void InvalidateSpellDialog (void);
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	SFX_DECL_CHILDWINDOW(SpellDialogChildWindow);
55cdf0e10cSrcweir 
56cdf0e10cSrcweir protected:
57cdf0e10cSrcweir     /** Iterate over the sentences in all text shapes and stop at the
58cdf0e10cSrcweir         next sentence with spelling errors. While doing so the view
59cdf0e10cSrcweir         mode may be changed and text shapes are set into edit mode.
60cdf0e10cSrcweir     */
61cdf0e10cSrcweir     virtual ::svx::SpellPortions GetNextWrongSentence( bool bRecheck );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     /** This method is responsible for merging corrections made in the
64cdf0e10cSrcweir         spelling dialog back into the document.
65cdf0e10cSrcweir     */
66cdf0e10cSrcweir     virtual void ApplyChangedSentence(const ::svx::SpellPortions& rChanged, bool bRecheck);
67cdf0e10cSrcweir     virtual void GetFocus (void);
68cdf0e10cSrcweir     virtual void LoseFocus (void);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir private:
71cdf0e10cSrcweir     /** This outliner is used to do the main work of iterating over a
72cdf0e10cSrcweir         document and finding sentences with spelling errors.
73cdf0e10cSrcweir     */
74cdf0e10cSrcweir     Outliner* mpSdOutliner;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     /** When this flag is <TRUE/> then eventually we have to destroy
77cdf0e10cSrcweir         the outliner in mpSdOutliner.
78cdf0e10cSrcweir     */
79cdf0e10cSrcweir     bool mbOwnOutliner;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     /** Provide an outliner in the mpSdOutliner data member.  When the
82cdf0e10cSrcweir         view shell has changed since the last call this include the
83cdf0e10cSrcweir         deletion/release of formerly created/obtained one prior to
84cdf0e10cSrcweir         construction/obtaining of a new one.
85cdf0e10cSrcweir     */
86cdf0e10cSrcweir     void ProvideOutliner (void);
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir } // end of namespace ::sd
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif
92