LibreOffice Module sc (master)  1
spellcheckcontext.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
11 #define INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
12 
13 #include <i18nlangtag/lang.h>
15 #include "types.hxx"
16 
17 #include <memory>
18 #include <vector>
19 
20 class ScDocument;
21 class ScTabEditEngine;
22 
23 namespace sc
24 {
30 {
31  class SpellCheckCache;
32  struct SpellCheckStatus;
34 
35  std::unique_ptr<SpellCheckCache> mpCache;
36  std::unique_ptr<SpellCheckResult> mpResult;
38  std::unique_ptr<ScTabEditEngine> mpEngine;
39  std::unique_ptr<SpellCheckStatus> mpStatus;
42 
43 public:
44  SpellCheckContext(ScDocument* pDocument, SCTAB nTab);
46  void dispose();
47 
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);
52 
53  void reset();
54  void resetForContentChange();
55  void setTabNo(SCTAB nTab);
56 
57 private:
58  void ensureResults(SCCOL nCol, SCROW nRow);
59  void resetCache(bool bContentChangeOnly = false);
60  void setup();
61 };
62 }
63 
64 #endif
65 
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isMisspelled(SCCOL nCol, SCROW nRow) const
std::unique_ptr< SpellCheckCache > mpCache
std::unique_ptr< ScTabEditEngine > mpEngine
void setTabNo(SCTAB nTab)
std::unique_ptr< SpellCheckResult > mpResult
std::unique_ptr< SpellCheckStatus > mpStatus
sal_Int16 SCCOL
Definition: types.hxx:22
void setMisspellRanges(SCCOL nCol, SCROW nRow, const std::vector< editeng::MisspellRanges > *pRanges)
SpellCheckContext(ScDocument *pDocument, SCTAB nTab)
sal_Int32 SCROW
Definition: types.hxx:18
const std::vector< editeng::MisspellRanges > * getMisspellRanges(SCCOL nCol, SCROW nRow) const
void ensureResults(SCCOL nCol, SCROW nRow)
void resetCache(bool bContentChangeOnly=false)
sal_Int16 SCTAB
Definition: types.hxx:23