xref: /aoo41x/main/sc/source/ui/inc/spelldialog.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_SPELLDIALOG_HXX
25cdf0e10cSrcweir #define SC_SPELLDIALOG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <memory>
28cdf0e10cSrcweir #include <svx/SpellDialogChildWindow.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // ============================================================================
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class ScConversionEngineBase;
33cdf0e10cSrcweir class ScSelectionState;
34cdf0e10cSrcweir class ScTabViewShell;
35cdf0e10cSrcweir class ScViewData;
36cdf0e10cSrcweir class ScDocShell;
37cdf0e10cSrcweir class ScDocument;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir /** Specialized spell check dialog child window for Calc.
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     This derivation of the ::svx::SpellDialogChildWindow base class provides
42cdf0e10cSrcweir     Calc specific implementations of the virtual functions GetNextWrongSentence()
43cdf0e10cSrcweir     and ApplyChangedSentence().
44cdf0e10cSrcweir  */
45cdf0e10cSrcweir class ScSpellDialogChildWindow : public ::svx::SpellDialogChildWindow
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir     SFX_DECL_CHILDWINDOW( ScSpellDialogChildWindow );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     explicit            ScSpellDialogChildWindow( Window* pParent, sal_uInt16 nId,
51cdf0e10cSrcweir                             SfxBindings* pBindings, SfxChildWinInfo* pInfo );
52cdf0e10cSrcweir     virtual             ~ScSpellDialogChildWindow();
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     /** This method makes the one from the base class public so that
55cdf0e10cSrcweir         it can be called from the view shell when one is created.
56cdf0e10cSrcweir     */
57cdf0e10cSrcweir     virtual void        InvalidateSpellDialog();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir protected:
60cdf0e10cSrcweir     /** Iterate over the sentences in all text shapes and stop at the
61cdf0e10cSrcweir         next sentence with spelling errors. While doing so the view
62cdf0e10cSrcweir         mode may be changed and text shapes are set into edit mode.
63cdf0e10cSrcweir     */
64cdf0e10cSrcweir     virtual ::svx::SpellPortions GetNextWrongSentence( bool bRecheck );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     /** This method is responsible for merging corrections made in the
67cdf0e10cSrcweir         spelling dialog back into the document.
68cdf0e10cSrcweir     */
69cdf0e10cSrcweir     virtual void        ApplyChangedSentence( const ::svx::SpellPortions& rChanged, bool bRecheck );
70cdf0e10cSrcweir     virtual void        GetFocus();
71cdf0e10cSrcweir     virtual void        LoseFocus();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir private:
74cdf0e10cSrcweir     void                Reset();
75cdf0e10cSrcweir     void                Init();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     bool                IsSelectionChanged();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir private:
80cdf0e10cSrcweir     typedef ::std::auto_ptr< ScConversionEngineBase >   ScConvEnginePtr;
81cdf0e10cSrcweir     typedef ::std::auto_ptr< ScDocument >               ScDocumentPtr;
82cdf0e10cSrcweir     typedef ::std::auto_ptr< ScSelectionState >         ScSelectionStatePtr;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     ScConvEnginePtr     mxEngine;
85cdf0e10cSrcweir     ScDocumentPtr       mxUndoDoc;
86cdf0e10cSrcweir     ScDocumentPtr       mxRedoDoc;
87cdf0e10cSrcweir     ScSelectionStatePtr mxOldSel;           /// Old selection state for comparison.
88cdf0e10cSrcweir     ScTabViewShell*     mpViewShell;
89cdf0e10cSrcweir     ScViewData*         mpViewData;
90cdf0e10cSrcweir     ScDocShell*         mpDocShell;
91cdf0e10cSrcweir     ScDocument*         mpDoc;
92cdf0e10cSrcweir     bool                mbNeedNextObj;
93cdf0e10cSrcweir     bool                mbOldIdleDisabled;
94cdf0e10cSrcweir };
95cdf0e10cSrcweir 
96cdf0e10cSrcweir // ============================================================================
97cdf0e10cSrcweir 
98cdf0e10cSrcweir #endif
99cdf0e10cSrcweir 
100