1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SW_INC_SWSCANNER_HXX
21 #define INCLUDED_SW_INC_SWSCANNER_HXX
23 #include <i18nlangtag/lang.h>
24 #include "modeltoviewhelper.hxx"
30 // Helper class that provides consecutively the words of a selected area
34 std::function
<LanguageType (sal_Int32
, sal_Int32
, bool)> m_pGetLangOfChar
;
37 const OUString m_aPreDashReplacementText
;
39 const LanguageType
* m_pLanguage
;
40 const ModelToViewHelper m_ModelToView
;
41 sal_Int32 m_nStartPos
;
45 sal_Int32 m_nOverriddenDashCount
;
46 LanguageType m_aCurrentLang
;
47 sal_uInt16 m_nWordType
;
51 SwScanner(std::function
<LanguageType(sal_Int32
, sal_Int32
, bool)> pGetLangOfChar
,
52 OUString aText
, const LanguageType
* pLang
, ModelToViewHelper aConvMap
,
53 sal_uInt16 nWordType
, sal_Int32 nStart
, sal_Int32 nEnd
, bool bClip
= false);
54 SwScanner( const SwTextNode
& rNd
, const OUString
& rText
,
55 const LanguageType
* pLang
,
56 const ModelToViewHelper
& rConvMap
,
58 sal_Int32 nStart
, sal_Int32 nEnd
, bool bClip
= false );
60 // This next word function tries to find the language for the next word
61 // It should currently _not_ be used for spell checking, and works only for
65 const OUString
& GetWord() const { return m_aWord
; }
66 const OUString
& GetPrevWord() const { return m_aPrevWord
; }
68 sal_Int32
GetBegin() const { return m_nBegin
; }
69 sal_Int32
GetEnd() const { return m_nBegin
+ m_nLength
; }
70 sal_Int32
GetLen() const { return m_nLength
; }
72 LanguageType
GetCurrentLanguage() const {return m_aCurrentLang
;}
74 sal_Int32
getOverriddenDashCount() const {return m_nOverriddenDashCount
; }
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */