cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / inc / SpellDialogChildWindow.hxx
blob3d2163a7e018e53963c36aa2f8448f3e407c03d1
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 #pragma once
22 #include <svx/SpellDialogChildWindow.hxx>
23 #include <svl/lstner.hxx>
25 class SdOutliner;
27 namespace sd
29 /** This derivation of the svx::SpellDialogChildWindow base class
30 provides Draw and Impress specific implementations of
31 GetNextWrongSentence() and ApplyChangedSentence().
33 class SpellDialogChildWindow final : public svx::SpellDialogChildWindow, public SfxListener
35 public:
36 SpellDialogChildWindow(vcl::Window* pParent, sal_uInt16 nId, SfxBindings* pBindings,
37 SfxChildWinInfo* pInfo);
38 virtual ~SpellDialogChildWindow() override;
40 /** This method makes the one from the base class public so that
41 it can be called from the view shell when one is created.
43 void InvalidateSpellDialog();
45 // SfxListener
46 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
48 SFX_DECL_CHILDWINDOW_WITHID(SpellDialogChildWindow);
50 private:
51 /** Iterate over the sentences in all text shapes and stop at the
52 next sentence with spelling errors. While doing so the view
53 mode may be changed and text shapes are set into edit mode.
55 virtual svx::SpellPortions GetNextWrongSentence(bool bRecheck) override;
57 /** This method is responsible for merging corrections made in the
58 spelling dialog back into the document.
60 virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck) override;
61 virtual void GetFocus() override;
62 virtual void LoseFocus() override;
64 /** This outliner is used to do the main work of iterating over a
65 document and finding sentences with spelling errors.
67 SdOutliner* mpSdOutliner;
69 /** When this flag is <TRUE/> then eventually we have to destroy
70 the outliner in mpSdOutliner.
72 bool mbOwnOutliner;
74 /** Provide an outliner in the mpSdOutliner data member. When the
75 view shell has changed since the last call this include the
76 deletion/release of formerly created/obtained one prior to
77 construction/obtaining of a new one.
79 void ProvideOutliner();
81 void EndSpellingAndClearOutliner();
84 } // end of namespace ::sd
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */