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

List:       kde-commits
Subject:    KDE/kdelibs/kparts
From:       David Faure <faure () kde ! org>
Date:       2010-09-24 21:24:22
Message-ID: 20100924212422.74A49AC892 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1179230 by dfaure:

Add pageCount / currentPage / pageText for parts who support the concept of pages, \
such as okularpart, as suggested by tsdgeos and pino; could be useful for "read this \
page" (kttsd) or "translate this page" (babelfish).


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


--- trunk/KDE/kdelibs/kparts/textextension.cpp #1179229:1179230
@@ -49,3 +49,18 @@
 {
     return KGlobal::findDirectChild<KParts::TextExtension *>(obj);
 }
+
+int KParts::TextExtension::pageCount() const
+{
+    return 0;
+}
+
+int KParts::TextExtension::currentPage() const
+{
+    return 0;
+}
+
+QString KParts::TextExtension::pageText(Format) const
+{
+    return QString();
+}
--- trunk/KDE/kdelibs/kparts/textextension.h #1179229:1179230
@@ -68,6 +68,23 @@
      */
     virtual QString completeText(Format format) const;
 
+
+    /**
+     * Returns the number of pages, for parts who support the concept of pages.
+     * Otherwise returns 0.
+     */
+    virtual int pageCount() const;
+    /**
+     * Returns the current page (between 0 and pageCount()-1),
+     * for parts who support the concept of pages.
+     * Otherwise returns 0.
+     */
+    virtual int currentPage() const;
+    /**
+     * Returns the text in a given page, in the requested format.
+     */
+    virtual QString pageText(Format format) 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