• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdespell2
 

tdespell2

  • tdespell2
filter.h
1/*
2 * filter.h
3 *
4 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21
22#ifndef TDESPELL_FILTER_H
23#define TDESPELL_FILTER_H
24
25#include <tqstring.h>
26#include <tdelibs_export.h>
27
28namespace KSpell2
29{
30 class Settings;
31
39 struct Word
40 {
41 Word() : start( 0 ), end( true )
42 {}
43
44 Word( const TQString& w, int st, bool e = false )
45 : word( w ), start( st ), end( e )
46 {}
47 Word( const Word& other )
48 : word( other.word ), start( other.start ),
49 end( other.end )
50 {}
51
52 TQString word;
53 uint start;
54 bool end;
55 };
56
64 class TDE_EXPORT Filter
65 {
66 public:
67 static Filter *defaultFilter();
68 public:
69 Filter();
70 virtual ~Filter();
71
72 static Word end();
73
77 void setSettings( Settings* );
78
82 Settings *settings() const;
83
84 bool atEnd() const;
85
86 void setBuffer( const TQString& buffer );
87 TQString buffer() const;
88
89 void restart();
90
91 virtual Word nextWord() const;
92 virtual Word previousWord() const;
93 virtual Word wordAtPosition( unsigned int pos ) const;
94
95 virtual void setCurrentPosition( int );
96 virtual int currentPosition() const;
97 virtual void replace( const Word& w, const TQString& newWord );
98
102 virtual TQString context() const;
103 protected:
104 bool trySkipLinks() const;
105 bool ignore( const TQString& word ) const;
106 TQChar skipToLetter( uint &fromPosition ) const;
107 bool shouldBeSkipped( bool wordWasUppercase, bool wordWasRunTogether,
108 const TQString& foundWord ) const;
109
110 protected:
111 TQString m_buffer;
112 mutable uint m_currentPosition;
113
114 private:
115 class Private;
116 Private *d;
117 };
118
119}
120
121#endif
KSpell2::Filter
Filter is used to split text into words which will be spell checked.
Definition: filter.h:65
KSpell2
tdespell_hspellclient.h
Definition: backgroundchecker.h:29
KSpell2::Word
Structure abstracts the word and its position in the parent text.
Definition: filter.h:40

tdespell2

Skip menu "tdespell2"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

tdespell2

Skip menu "tdespell2"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdespell2 by doxygen 1.9.4
This website is maintained by Timothy Pearson.