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
19class ScDocument;
20class ScTabEditEngine;
21
22namespace sc
23{
29{
30 class SpellCheckCache;
31 struct SpellCheckStatus;
32 struct SpellCheckResult;
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
42public:
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();
54 void setTabNo(SCTAB nTab);
55
56private:
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: */
Class shared between grid windows to cache spelling results.
void setTabNo(SCTAB nTab)
std::unique_ptr< ScTabEditEngine > mpEngine
std::unique_ptr< SpellCheckResult > mpResult
void ensureResults(SCCOL nCol, SCROW nRow)
std::unique_ptr< SpellCheckStatus > mpStatus
void resetCache(bool bContentChangeOnly=false)
bool isMisspelled(SCCOL nCol, SCROW nRow) const
SpellCheckContext(ScDocument *pDocument, SCTAB nTab)
void setMisspellRanges(SCCOL nCol, SCROW nRow, const std::vector< editeng::MisspellRanges > *pRanges)
std::unique_ptr< SpellCheckCache > mpCache
const std::vector< editeng::MisspellRanges > * getMisspellRanges(SCCOL nCol, SCROW nRow) const
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17