• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kpimutils

linklocator.h

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 2002 Dave Corrie <kde@davecorrie.com>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation; either
00007   version 2 of the License, or (at your option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public License
00015   along with this library; see the file COPYING.LIB.  If not, write to
00016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017   Boston, MA 02110-1301, USA.
00018 */
00030 #ifndef KPIMUTILS_LINKLOCATOR_H_
00031 #define KPIMUTILS_LINKLOCATOR_H_
00032 
00033 #include "kpimutils_export.h"
00034 
00035 #include <QtCore/QString>
00036 #include <QtCore/QMap>
00037 
00038 namespace KPIMUtils {
00039 
00046 class KPIMUTILS_EXPORT LinkLocator
00047 {
00048   public:
00056     explicit LinkLocator( const QString &text, int pos = 0 );
00057 
00061     ~LinkLocator();
00062 
00072     void setMaxUrlLen( int length );
00073 
00079     int maxUrlLen() const;
00080 
00091     void setMaxAddressLen( int length );
00092 
00097     int maxAddressLen() const;
00098 
00107     QString getUrl();
00108 
00119     QString getEmailAddress();
00120 
00141     static QString convertToHtml( const QString &plainText, int flags = 0,
00142                                   int maxUrlLen = 4096, int maxAddressLen = 255 );
00143 
00144     static const int PreserveSpaces = 0x01;
00145     static const int ReplaceSmileys = 0x02;
00146     static const int IgnoreUrls     = 0x04;
00147     static const int HighlightText  = 0x08;
00148 
00154     static QString pngToDataUrl( const QString & iconPath );
00155 
00156   protected:
00160     QString mText;
00161 
00165     int mPos;
00166 
00167     bool atUrl() const;
00168     bool isEmptyUrl( const QString &url ) const;
00169 
00176     QString getEmoticon();
00177 
00182     QString highlightedText();
00183 
00184   private:
00185     private:
00186     //@cond PRIVATE
00187     class Private;
00188     Private *const d;
00189     //@endcond
00190 
00194     static QMap<QString, QString> *s_smileyEmoticonNameMap;
00195 
00199     static QMap<QString, QString> *s_smileyEmoticonHTMLCache;
00200 
00204     static void cleanupLinkLocator();
00205 };
00206 
00207 }
00208 
00209 #endif

kpimutils

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal