equal
deleted
inserted
replaced
20 |
20 |
21 #include <logscntfinderexport.h> |
21 #include <logscntfinderexport.h> |
22 #include <QObject> |
22 #include <QObject> |
23 #include <QList> |
23 #include <QList> |
24 #include <QString> |
24 #include <QString> |
25 |
25 #include "logspredictivetranslator.h" |
26 |
26 |
27 class LogsCntEntry; |
27 class LogsCntEntry; |
28 typedef QObject LogsCntEntryHandle; |
28 typedef QObject LogsCntEntryHandle; |
29 |
29 |
30 |
30 |
31 class LogsCntText |
31 class LogsCntText : public LogsCntToken |
32 { |
32 { |
|
33 |
33 public: |
34 public: |
34 |
|
35 inline LogsCntText() : mHighlights(0){} |
35 inline LogsCntText() : mHighlights(0){} |
36 inline const QString& text() const {return mText;} |
|
37 inline int highlights() const {return mHighlights;} |
36 inline int highlights() const {return mHighlights;} |
38 LOGSCNTFINDER_EXPORT QString richText( QString startTag = QString("<b><u>"), |
37 LOGSCNTFINDER_EXPORT QString richText( QString startTag = QString("<b><u>"), |
39 QString endTag = QString("</u></b>")) const; |
38 QString endTag = QString("</u></b>")) const; |
40 |
39 |
41 |
40 |
42 private: |
41 private: |
43 |
42 |
44 QString mText; |
|
45 QString mTranslatedText; |
|
46 int mHighlights; |
43 int mHighlights; |
47 |
44 |
48 friend class LogsCntEntry; |
45 friend class LogsCntEntry; |
49 friend class UT_LogsCntEntry; |
46 friend class UT_LogsCntEntry; |
50 friend class UT_LogsCntFinder; |
47 friend class UT_LogsCntFinder; |
89 void doSetText( const QString& text, LogsCntTextList& textlist ); |
86 void doSetText( const QString& text, LogsCntTextList& textlist ); |
90 void doSetHighlights( const QString& pattern, LogsCntTextList& nameArray ); |
87 void doSetHighlights( const QString& pattern, LogsCntTextList& nameArray ); |
91 void doSetHighlights( const QString& patternItem, QMutableListIterator<LogsCntText>& names ); |
88 void doSetHighlights( const QString& patternItem, QMutableListIterator<LogsCntText>& names ); |
92 |
89 |
93 void resetHighlights( LogsCntTextList& nameArray ); |
90 void resetHighlights( LogsCntTextList& nameArray ); |
94 bool doSimpleMatch( const QString& pattern ) const; |
|
95 bool doComplexMatch( const QStringList& patternArray ) const; |
|
96 int startsWith( const LogsCntText& nameItem, const QString& pattern ) const; |
91 int startsWith( const LogsCntText& nameItem, const QString& pattern ) const; |
97 |
92 |
98 private: |
93 private: |
99 |
94 |
100 EntryType mType; |
95 EntryType mType; |