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 #pragma once
11 
12 #include <i18nlangtag/lang.h>
14 #include "types.hxx"
15 
16 #include <memory>
17 #include <vector>
18 
19 class ScDocument;
20 class ScTabEditEngine;
21 
22 namespace sc
23 {
29 {
30  class SpellCheckCache;
31  struct SpellCheckStatus;
33 
34  std::unique_ptr<SpellCheckCache> mpCache;
35  std::unique_ptr<SpellCheckResult> mpResult;
37  std::unique_ptr<ScTabEditEngine> mpEngine;
38  std::unique_ptr<SpellCheckStatus> mpStatus;
41 
42 public:
43  SpellCheckContext(ScDocument* pDocument, SCTAB nTab);
45  void dispose();
46 
47  bool isMisspelled(SCCOL nCol, SCROW nRow) const;
48  const std::vector<editeng::MisspellRanges>* getMisspellRanges(SCCOL nCol, SCROW nRow) const;
49  void setMisspellRanges(SCCOL nCol, SCROW nRow,
50  const std::vector<editeng::MisspellRanges>* pRanges);
51 
52  void reset();
53  void resetForContentChange();
54  void setTabNo(SCTAB nTab);
55 
56 private:
57  void ensureResults(SCCOL nCol, SCROW nRow);
58  void resetCache(bool bContentChangeOnly = false);
59  void setup();
60 };
61 }
62 
63 /* 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:21
void setMisspellRanges(SCCOL nCol, SCROW nRow, const std::vector< editeng::MisspellRanges > *pRanges)
SpellCheckContext(ScDocument *pDocument, SCTAB nTab)
sal_Int32 SCROW
Definition: types.hxx:17
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:22