kpimutils
linklocator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00029 #ifndef KPIMUTILS_LINKLOCATOR_H
00030 #define KPIMUTILS_LINKLOCATOR_H
00031
00032 #include "kpimutils_export.h"
00033
00034 #include <QtCore/QString>
00035
00036 namespace KPIMUtils {
00037
00048 class KPIMUTILS_EXPORT LinkLocator
00049 {
00050 public:
00058 explicit LinkLocator( const QString &text, int pos = 0 );
00059
00063 ~LinkLocator();
00064
00074 void setMaxUrlLen( int length );
00075
00081 int maxUrlLen() const;
00082
00093 void setMaxAddressLen( int length );
00094
00099 int maxAddressLen() const;
00100
00109 QString getUrl();
00110
00121 QString getEmailAddress();
00122
00143 static QString convertToHtml( const QString &plainText, int flags = 0,
00144 int maxUrlLen = 4096, int maxAddressLen = 255 );
00145
00146 static const int PreserveSpaces = 0x01;
00147 static const int ReplaceSmileys = 0x02;
00148 static const int IgnoreUrls = 0x04;
00149 static const int HighlightText = 0x08;
00150
00156 static QString pngToDataUrl( const QString & iconPath );
00157
00158 protected:
00162 QString mText;
00163
00167 int mPos;
00168
00169 bool atUrl() const;
00170 bool isEmptyUrl( const QString &url ) const;
00171
00176 QString highlightedText();
00177
00178 private:
00179 private:
00180
00181 class Private;
00182 Private *const d;
00183
00184
00185 };
00186
00187 }
00188
00189 #endif