• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

kpimutils

  • kpimutils
spellingfilter.h
Go to the documentation of this file.
1 /*
2  * spellingfilter.h
3  *
4  * Copyright (c) 2002 Dave Corrie <kde@davecorrie.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 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  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
32 #ifndef KPIMUTILS_SPELLINGFILTER_H
33 #define KPIMUTILS_SPELLINGFILTER_H
34 
35 #include "kpimutils_export.h"
36 #include "linklocator.h"
37 
38 #include <QtCore/QString>
39 #include <QtCore/QStringList>
40 
41 namespace KPIMUtils {
42 
43 class KPIMUTILS_EXPORT SpellingFilter
44 {
45  public:
46  enum UrlFiltering {
47  DontFilterUrls,
48  FilterUrls
49  };
50  enum EmailAddressFiltering {
51  DontFilterEmailAddresses,
52  FilterEmailAddresses
53  };
54 
55  SpellingFilter( const QString &text, const QString &quotePrefix,
56  UrlFiltering filterUrls = FilterUrls,
57  EmailAddressFiltering filterEmailAddresses = FilterEmailAddresses,
58  const QStringList &filterStrings = QStringList() );
59  ~SpellingFilter();
60 
61  QString originalText() const;
62  QString filteredText() const;
63 
64  class TextCensor;
65 
66  private:
67  //@cond PRIVATE
68  class Private;
69  Private *const d;
70  //@endcond
71 };
72 
73 class SpellingFilter::TextCensor : public LinkLocator
74 {
75  public:
76  TextCensor( const QString &s );
77 
78  void censorQuotations( const QString &quotePrefix );
79  void censorUrls();
80  void censorEmailAddresses();
81  void censorString( const QString &s );
82 
83  QString censoredText() const;
84 
85  private:
86  bool atLineStart() const;
87  void skipLine();
88 
89  bool atQuotation( const QString &quotePrefix ) const;
90  void skipQuotation( const QString &quotePrefix );
91  void findQuotation( const QString &quotePrefix );
92 
93  void findEmailAddress();
94 };
95 
96 }
97 
98 #endif
linklocator.h
This file is part of the KDEPIM Utilities library and provides the LinkLocator class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:35 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kpimutils

Skip menu "kpimutils"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal