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

kpimutils

  • sources
  • kde-4.14
  • kdepimlibs
  • 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 
44 class KPIMUTILS_DEPRECATED_EXPORT SpellingFilter
45 {
46  public:
47  enum UrlFiltering {
48  DontFilterUrls,
49  FilterUrls
50  };
51  enum EmailAddressFiltering {
52  DontFilterEmailAddresses,
53  FilterEmailAddresses
54  };
55 
56  SpellingFilter( const QString &text, const QString &quotePrefix,
57  UrlFiltering filterUrls = FilterUrls,
58  EmailAddressFiltering filterEmailAddresses = FilterEmailAddresses,
59  const QStringList &filterStrings = QStringList() );
60  ~SpellingFilter();
61 
62  QString originalText() const;
63  QString filteredText() const;
64 
65  class TextCensor;
66 
67  private:
68  //@cond PRIVATE
69  class Private;
70  Private *const d;
71  //@endcond
72 };
73 
74 class SpellingFilter::TextCensor : public LinkLocator
75 {
76  public:
77  TextCensor( const QString &s );
78 
79  void censorQuotations( const QString &quotePrefix );
80  void censorUrls();
81  void censorEmailAddresses();
82  void censorString( const QString &s );
83 
84  QString censoredText() const;
85 
86  private:
87  bool atLineStart() const;
88  void skipLine();
89 
90  bool atQuotation( const QString &quotePrefix ) const;
91  void skipQuotation( const QString &quotePrefix );
92  void findQuotation( const QString &quotePrefix );
93 
94  void findEmailAddress();
95 };
96 
97 }
98 
99 #endif
KPIMUtils::SpellingFilter
Definition: spellingfilter.h:44
KPIMUtils::LinkLocator
LinkLocator assists in identifying sections of text that can usefully be converted in hyperlinks in H...
Definition: linklocator.h:48
QString
QStringList
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:25 by doxygen 1.8.7 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
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs 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

Search



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