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

kpimutils

  • 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
36namespace KPIMUtils {
37
48class 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 QString getUrlAndCheckValidHref(bool *badurl = 0);
111
122 QString getEmailAddress();
123
144 static QString convertToHtml( const QString &plainText, int flags = 0,
145 int maxUrlLen = 4096, int maxAddressLen = 255 );
146
147 static const int PreserveSpaces = 0x01;
148 static const int ReplaceSmileys = 0x02;
149 static const int IgnoreUrls = 0x04;
150 static const int HighlightText = 0x08;
151
157 static QString pngToDataUrl( const QString & iconPath );
158
159protected:
163 QString mText;
164
168 int mPos;
169
170 bool atUrl() const;
171 bool isEmptyUrl( const QString &url ) const;
172
177 QString highlightedText();
178
179 private:
180 private:
181 //@cond PRIVATE
182 class Private;
183 Private *const d;
184 //@endcond
185
186};
187
188}
189
190#endif
KPIMUtils::LinkLocator
LinkLocator assists in identifying sections of text that can usefully be converted in hyperlinks in H...
Definition: linklocator.h:49
KPIMUtils::LinkLocator::mText
QString mText
The plaintext string being scanned for URLs and email addresses.
Definition: linklocator.h:163
KPIMUtils::LinkLocator::mPos
int mPos
The current scan position.
Definition: linklocator.h:168
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.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
  • Related Pages

kdepimlibs-4.14.10 API Reference

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