Commit 5fa94e16 authored by Enrico Ros's avatar Enrico Ros

merging patch_080,085

svn path=/branches/kpdf/annotations/kdegraphics/kpdf/; revision=425031
parent d65e147f
......@@ -249,6 +249,7 @@ void KPDFDocument::closeDocument()
d->searches.clear();
// reset internal variables
d->url = KURL();
d->viewportHistory.clear();
d->viewportHistory.append( DocumentViewport() );
d->viewportIterator = d->viewportHistory.begin();
......@@ -369,6 +370,11 @@ uint KPDFDocument::pages() const
return pages_vector.size();
}
KURL KPDFDocument::currentDocument() const
{
return d->url;
}
bool KPDFDocument::isAllowed( int flags ) const
{
return generator ? generator->isAllowed( flags ) : false;
......
......@@ -74,6 +74,7 @@ class KPDFDocument : public QObject
const DocumentViewport & viewport() const;
uint currentPage() const;
uint pages() const;
KURL currentDocument() const;
bool isAllowed( int /*Document::Permisison(s)*/ ) const;
bool historyAtBegin() const;
bool historyAtEnd() const;
......
......@@ -7,26 +7,28 @@
* (at your option) any later version. *
***************************************************************************/
#ifndef MY_INTERFACE_H
#define MY_INTERFACE_H
#ifndef _KPDF_DCOP_INTERFACE_H_
#define _KPDF_DCOP_INTERFACE_H_
#include <dcopobject.h>
#include <kurl.h>
class kpdf_dcop : virtual public DCOPObject
{
K_DCOP
k_dcop:
virtual ASYNC goToPage(uint page) = 0;
virtual ASYNC openDocument(KURL doc) = 0;
virtual uint pages() = 0;
virtual void slotPreferences() = 0;
virtual void slotFind() = 0;
virtual void slotPrintPreview() = 0;
virtual void slotPreviousPage() = 0;
virtual void slotNextPage() = 0;
virtual void slotGotoFirst() = 0;
virtual void slotGotoLast() = 0;
K_DCOP
k_dcop:
virtual ASYNC goToPage( uint page ) = 0;
virtual ASYNC openDocument( KURL doc ) = 0;
virtual uint pages() = 0;
virtual uint currentPage() = 0;
virtual KURL currentDocument() = 0;
virtual void slotPreferences() = 0;
virtual void slotFind() = 0;
virtual void slotPrintPreview() = 0;
virtual void slotPreviousPage() = 0;
virtual void slotNextPage() = 0;
virtual void slotGotoFirst() = 0;
virtual void slotGotoLast() = 0;
};
#endif
......@@ -310,12 +310,22 @@ void Part::goToPage(uint i)
void Part::openDocument(KURL doc)
{
openURL(doc);
openURL(doc);
}
uint Part::pages()
{
return m_document->pages();
return m_document->pages();
}
uint Part::currentPage()
{
return m_document->pages() ? m_document->currentPage() + 1 : 0;
}
KURL Part::currentDocument()
{
return m_document->currentDocument();
}
//this don't go anywhere but is required by genericfactory.h
......
......@@ -75,6 +75,8 @@ public:
ASYNC goToPage(uint page);
ASYNC openDocument(KURL doc);
uint pages();
uint currentPage();
KURL currentDocument();
protected:
// reimplemented from KParts::ReadOnlyPart
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment