Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / spelldialog.hxx
blob4eaf6566f8773c1e0399272c9d54ddb579fc0f76
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_SPELLDIALOG_HXX
21 #define SC_SPELLDIALOG_HXX
23 #include <memory>
24 #include <svx/SpellDialogChildWindow.hxx>
26 // ============================================================================
28 class ScConversionEngineBase;
29 class ScSelectionState;
30 class ScTabViewShell;
31 class ScViewData;
32 class ScRangeList;
33 class ScDocShell;
34 class ScDocument;
36 /** Specialized spell check dialog child window for Calc.
38 This derivation of the ::svx::SpellDialogChildWindow base class provides
39 Calc specific implementations of the virtual functions GetNextWrongSentence()
40 and ApplyChangedSentence().
42 class ScSpellDialogChildWindow : public ::svx::SpellDialogChildWindow
44 public:
45 SFX_DECL_CHILDWINDOW_WITHID( ScSpellDialogChildWindow );
47 explicit ScSpellDialogChildWindow( Window* pParent, sal_uInt16 nId,
48 SfxBindings* pBindings, SfxChildWinInfo* pInfo );
49 virtual ~ScSpellDialogChildWindow();
51 /** This method makes the one from the base class public so that
52 it can be called from the view shell when one is created.
54 virtual void InvalidateSpellDialog();
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.
61 virtual ::svx::SpellPortions GetNextWrongSentence( bool bRecheck );
63 /** This method is responsible for merging corrections made in the
64 spelling dialog back into the document.
66 virtual void ApplyChangedSentence( const ::svx::SpellPortions& rChanged, bool bRecheck );
67 virtual void GetFocus();
68 virtual void LoseFocus();
70 private:
71 void Reset();
72 void Init();
74 bool IsSelectionChanged();
76 private:
77 typedef ::std::auto_ptr< ScConversionEngineBase > ScConvEnginePtr;
78 typedef ::std::auto_ptr< ScDocument > ScDocumentPtr;
79 typedef ::std::auto_ptr< ScSelectionState > ScSelectionStatePtr;
80 typedef ::std::auto_ptr< ScRangeList > ScRangeListPtr;
82 ScConvEnginePtr mxEngine;
83 ScDocumentPtr mxUndoDoc;
84 ScDocumentPtr mxRedoDoc;
85 ScSelectionStatePtr mxOldSel; /// For cursor position in selection
86 ScRangeListPtr mxOldRangeList; /// Original selection range for comparison.
87 ScTabViewShell* mpViewShell;
88 ScViewData* mpViewData;
89 ScDocShell* mpDocShell;
90 ScDocument* mpDoc;
91 bool mbNeedNextObj;
92 bool mbOldIdleEnabled;
95 // ============================================================================
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */