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

kspell2

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

kspell2

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

kspell2

Skip menu "kspell2"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kspell2 by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |