Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SWSCANNER_HXX
29 : : #define _SWSCANNER_HXX
30 : :
31 : : #include <i18npool/lang.h>
32 : : #include <modeltoviewhelper.hxx>
33 : :
34 : : class SwTxtNode;
35 : :
36 : : /*************************************************************************
37 : : * class SwScanner
38 : : * Helper class that provides consecutively the words of a selected area
39 : : * during spell check
40 : : *************************************************************************/
41 : :
42 : 6676 : class SwScanner
43 : : {
44 : : rtl::OUString aWord;
45 : : const SwTxtNode& rNode;
46 : : const rtl::OUString aText;
47 : : const LanguageType* pLanguage;
48 : : const ModelToViewHelper& rConversionMap;
49 : : sal_Int32 nStartPos;
50 : : sal_Int32 nEndPos;
51 : : sal_Int32 nBegin;
52 : : sal_Int32 nLen;
53 : : LanguageType aCurrLang;
54 : : sal_uInt16 nWordType;
55 : : sal_Bool bClip;
56 : :
57 : : public:
58 : : SwScanner( const SwTxtNode& rNd, const rtl::OUString& rTxt,
59 : : const LanguageType* pLang,
60 : : const ModelToViewHelper& rConvMap,
61 : : sal_uInt16 nWordType,
62 : : sal_Int32 nStart, sal_Int32 nEnde, sal_Bool bClip = sal_False );
63 : :
64 : :
65 : : // This next word function tries to find the language for the next word
66 : : // It should currently _not_ be used for spell checking, and works only for
67 : : // ! bReverse
68 : : sal_Bool NextWord();
69 : :
70 : 98912 : const rtl::OUString& GetWord() const { return aWord; }
71 : :
72 : 98870 : sal_Int32 GetBegin() const { return nBegin; }
73 : 0 : sal_Int32 GetEnd() const { return nBegin + nLen; }
74 : 29664 : sal_Int32 GetLen() const { return nLen; }
75 : :
76 : 29664 : LanguageType GetCurrentLanguage() const {return aCurrLang;}
77 : : };
78 : :
79 : : #endif
80 : :
81 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|