update dev300-m58
[ooovba.git] / sc / source / ui / inc / spelldialog.hxx
blobcbf4f3670eae0848bbe012eb1a98059ea80c6f06
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: spelldialog.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_SPELLDIALOG_HXX
32 #define SC_SPELLDIALOG_HXX
34 #include <memory>
35 #include <svx/SpellDialogChildWindow.hxx>
37 // ============================================================================
39 class ScConversionEngineBase;
40 class ScSelectionState;
41 class ScTabViewShell;
42 class ScViewData;
43 class ScDocShell;
44 class ScDocument;
46 /** Specialized spell check dialog child window for Calc.
48 This derivation of the ::svx::SpellDialogChildWindow base class provides
49 Calc specific implementations of the virtual functions GetNextWrongSentence()
50 and ApplyChangedSentence().
52 class ScSpellDialogChildWindow : public ::svx::SpellDialogChildWindow
54 public:
55 SFX_DECL_CHILDWINDOW( ScSpellDialogChildWindow );
57 explicit ScSpellDialogChildWindow( Window* pParent, USHORT nId,
58 SfxBindings* pBindings, SfxChildWinInfo* pInfo );
59 virtual ~ScSpellDialogChildWindow();
61 /** This method makes the one from the base class public so that
62 it can be called from the view shell when one is created.
64 virtual void InvalidateSpellDialog();
66 protected:
67 /** Iterate over the sentences in all text shapes and stop at the
68 next sentence with spelling errors. While doing so the view
69 mode may be changed and text shapes are set into edit mode.
71 virtual ::svx::SpellPortions GetNextWrongSentence();
73 /** This method is responsible for merging corrections made in the
74 spelling dialog back into the document.
76 virtual void ApplyChangedSentence( const ::svx::SpellPortions& rChanged );
77 virtual void GetFocus();
78 virtual void LoseFocus();
80 private:
81 void Reset();
82 void Init();
84 bool IsSelectionChanged();
86 private:
87 typedef ::std::auto_ptr< ScConversionEngineBase > ScConvEnginePtr;
88 typedef ::std::auto_ptr< ScDocument > ScDocumentPtr;
89 typedef ::std::auto_ptr< ScSelectionState > ScSelectionStatePtr;
91 ScConvEnginePtr mxEngine;
92 ScDocumentPtr mxUndoDoc;
93 ScDocumentPtr mxRedoDoc;
94 ScSelectionStatePtr mxOldSel; /// Old selection state for comparison.
95 ScTabViewShell* mpViewShell;
96 ScViewData* mpViewData;
97 ScDocShell* mpDocShell;
98 ScDocument* mpDoc;
99 bool mbNeedNextObj;
100 bool mbOldIdleDisabled;
103 // ============================================================================
105 #endif