• 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
linklocator.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002 Dave Corrie <kde@davecorrie.com>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
29 #ifndef KPIMUTILS_LINKLOCATOR_H
30 #define KPIMUTILS_LINKLOCATOR_H
31 
32 #include "kpimutils_export.h"
33 
34 #include <QtCore/QString>
35 
36 namespace KPIMUtils {
37 
48 class KPIMUTILS_EXPORT LinkLocator
49 {
50  public:
58  explicit LinkLocator( const QString &text, int pos = 0 );
59 
63  ~LinkLocator();
64 
74  void setMaxUrlLen( int length );
75 
81  int maxUrlLen() const;
82 
93  void setMaxAddressLen( int length );
94 
99  int maxAddressLen() const;
100 
109  QString getUrl();
110 
121  QString getEmailAddress();
122 
143  static QString convertToHtml( const QString &plainText, int flags = 0,
144  int maxUrlLen = 4096, int maxAddressLen = 255 );
145 
146  static const int PreserveSpaces = 0x01;
147  static const int ReplaceSmileys = 0x02;
148  static const int IgnoreUrls = 0x04;
149  static const int HighlightText = 0x08;
150 
156  static QString pngToDataUrl( const QString & iconPath );
157 
158  protected:
162  QString mText;
163 
167  int mPos;
168 
169  bool atUrl() const;
170  bool isEmptyUrl( const QString &url ) const;
171 
176  QString highlightedText();
177 
178  private:
179  private:
180  //@cond PRIVATE
181  class Private;
182  Private *const d;
183  //@endcond
184 
185 };
186 
187 }
188 
189 #endif
KPIMUtils::LinkLocator::mPos
int mPos
The current scan position.
Definition: linklocator.h:167
KPIMUtils::LinkLocator::mText
QString mText
The plaintext string being scanned for URLs and email addresses.
Definition: linklocator.h:162
KPIMUtils::LinkLocator
LinkLocator assists in identifying sections of text that can usefully be converted in hyperlinks in H...
Definition: linklocator.h:48
QString
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