[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kparts
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2010-10-09 14:59:03
Message-ID: 20101009145903.2A8CFAC892 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1184242 by adawit:

Added a function for searching and highlighting of a given string.

 M  +5 -0      textextension.cpp  
 M  +15 -0     textextension.h  


--- trunk/KDE/kdelibs/kparts/textextension.cpp #1184241:1184242
@@ -64,3 +64,8 @@
 {
     return QString();
 }
+
+bool KParts::TextExtension::findText(const QString&, KFind::SearchOptions) const
+{
+    return false;
+}
--- trunk/KDE/kdelibs/kparts/textextension.h #1184241:1184242
@@ -22,6 +22,7 @@
 
 #include <QtCore/QObject>
 #include <kparts/kparts_export.h>
+#include <kfind.h>
 
 namespace KParts
 {
@@ -85,6 +86,20 @@
      */
     virtual QString pageText(Format format) const;
 
+    /**
+     * Returns true if @p string is found using the given @p options.
+     *
+     * If any text matches @p string, then it will be selected/highlighted.
+     * To find the next matching text, simply call this function again with the
+     * same search text until it returns false.
+     * 
+     * To clear a selection, just pass an empty string.
+     * 
+     * Note that parts that implement this extension might not support all the
+     * options available in @ref KFind::SearchOptions.
+     */
+    virtual bool findText(const QString& string, KFind::SearchOptions options) const;
+    
     // for future extensions can be made via slots
 
 Q_SIGNALS:
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic