Bump version to 6.4-15
[LibreOffice.git] / sc / inc / spellcheckcontext.hxx
blobd4a0e0162530ffbd85ac7dbd9ce772f8e4714178
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/.
8 */
10 #ifndef INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
11 #define INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
13 #include <i18nlangtag/lang.h>
14 #include <editeng/misspellrange.hxx>
15 #include "types.hxx"
17 #include <memory>
18 #include <vector>
20 class ScDocument;
21 class ScTabEditEngine;
23 namespace sc
25 /**
26 * Class shared between grid windows to cache
27 * spelling results.
29 class SpellCheckContext
31 class SpellCheckCache;
32 struct SpellCheckStatus;
33 struct SpellCheckResult;
35 std::unique_ptr<SpellCheckCache> mpCache;
36 std::unique_ptr<SpellCheckResult> mpResult;
37 ScDocument* pDoc;
38 std::unique_ptr<ScTabEditEngine> mpEngine;
39 std::unique_ptr<SpellCheckStatus> mpStatus;
40 SCTAB mnTab;
41 LanguageType meLanguage;
43 public:
44 SpellCheckContext(ScDocument* pDocument, SCTAB nTab);
45 ~SpellCheckContext();
46 void dispose();
48 bool isMisspelled(SCCOL nCol, SCROW nRow) const;
49 const std::vector<editeng::MisspellRanges>* getMisspellRanges(SCCOL nCol, SCROW nRow) const;
50 void setMisspellRanges(SCCOL nCol, SCROW nRow,
51 const std::vector<editeng::MisspellRanges>* pRanges);
53 void reset();
54 void resetForContentChange();
55 void setTabNo(SCTAB nTab);
57 private:
58 void ensureResults(SCCOL nCol, SCROW nRow);
59 void resetCache(bool bContentChangeOnly = false);
60 void setup();
64 #endif
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */