2004-09-08 12:41:14 +00:00
|
|
|
/***************************************************************************
|
2005-02-20 16:04:40 +00:00
|
|
|
* Copyright (C) 2004-2005 by Enrico Ros <eros.kde@email.it> *
|
2007-08-13 22:25:27 +00:00
|
|
|
* Copyright (C) 2004-2007 by Albert Astals Cid <aacid@kde.org> *
|
2004-09-08 12:41:14 +00:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_DOCUMENT_H_
|
|
|
|
#define _OKULAR_DOCUMENT_H_
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
#include <okular/core/okular_export.h>
|
|
|
|
#include <okular/core/area.h>
|
|
|
|
#include <okular/core/global.h>
|
2007-01-05 23:12:06 +00:00
|
|
|
#include <okular/core/pagesize.h>
|
2006-05-08 20:12:04 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QStringList>
|
|
|
|
#include <QtCore/QVector>
|
|
|
|
#include <QtXml/QDomDocument>
|
|
|
|
|
2005-11-04 11:59:51 +00:00
|
|
|
#include <kmimetype.h>
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2007-10-15 23:01:27 +00:00
|
|
|
class QPrinter;
|
2007-11-26 21:43:54 +00:00
|
|
|
class QPrintDialog;
|
2007-03-07 18:15:00 +00:00
|
|
|
class KComponentData;
|
2006-12-27 16:04:49 +00:00
|
|
|
class KBookmark;
|
2007-01-28 15:46:10 +00:00
|
|
|
class KConfigDialog;
|
2007-08-28 23:17:00 +00:00
|
|
|
class KXMLGUIClient;
|
2006-03-20 22:51:56 +00:00
|
|
|
class KUrl;
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
namespace Okular {
|
|
|
|
|
|
|
|
class Annotation;
|
2006-12-27 16:04:49 +00:00
|
|
|
class BookmarkManager;
|
2006-09-21 08:45:36 +00:00
|
|
|
class DocumentInfo;
|
|
|
|
class DocumentObserver;
|
2007-04-14 19:44:07 +00:00
|
|
|
class DocumentPrivate;
|
2006-09-21 08:45:36 +00:00
|
|
|
class DocumentSynopsis;
|
|
|
|
class DocumentViewport;
|
|
|
|
class EmbeddedFile;
|
2006-10-25 15:35:53 +00:00
|
|
|
class ExportFormat;
|
2007-07-07 20:35:01 +00:00
|
|
|
class FontInfo;
|
2006-09-21 08:45:36 +00:00
|
|
|
class Generator;
|
2007-04-20 12:37:12 +00:00
|
|
|
class Action;
|
2006-09-21 08:45:36 +00:00
|
|
|
class Page;
|
|
|
|
class PixmapRequest;
|
2006-11-17 22:15:15 +00:00
|
|
|
class SourceReference;
|
2006-06-23 21:11:52 +00:00
|
|
|
class VisiblePageRect;
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2006-05-28 15:54:48 +00:00
|
|
|
/** IDs for seaches. Globally defined here. **/
|
|
|
|
#define PART_SEARCH_ID 1
|
|
|
|
#define PAGEVIEW_SEARCH_ID 2
|
|
|
|
#define SW_SEARCH_ID 3
|
2007-03-17 22:58:41 +00:00
|
|
|
#define PRESENTATION_SEARCH_ID 4
|
2006-05-28 15:54:48 +00:00
|
|
|
|
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
/**
|
2004-12-11 17:25:03 +00:00
|
|
|
* @short The Document. Heart of everything. Actions take place here.
|
2004-09-08 12:41:14 +00:00
|
|
|
*
|
2006-09-21 08:45:36 +00:00
|
|
|
* The Document is the main object in Okular. All views query the Document to
|
2004-12-11 17:25:03 +00:00
|
|
|
* get data/properties or even for accessing pages (in a 'const' way).
|
|
|
|
*
|
|
|
|
* It is designed to keep it detached from the document type (pdf, ps, you
|
|
|
|
* name it..) so whenever you want to get some data, it asks its internals
|
|
|
|
* generator to do the job and return results in a format-indepedent way.
|
|
|
|
*
|
|
|
|
* Apart from the generator (the currently running one) the document stores
|
2006-09-21 08:45:36 +00:00
|
|
|
* all the Pages ('Page' class) of the current document in a vector and
|
2004-12-11 17:25:03 +00:00
|
|
|
* notifies all the registered DocumentObservers when some content changes.
|
|
|
|
*
|
|
|
|
* For a better understanding of hieracies @see README.internals.png
|
2006-09-21 08:45:36 +00:00
|
|
|
* @see DocumentObserver, Page
|
2004-09-08 12:41:14 +00:00
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
class OKULAR_EXPORT Document : public QObject
|
2004-09-08 12:41:14 +00:00
|
|
|
{
|
2004-12-22 18:21:36 +00:00
|
|
|
Q_OBJECT
|
2007-01-02 22:37:55 +00:00
|
|
|
|
2004-11-09 17:20:19 +00:00
|
|
|
public:
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
2007-03-30 17:46:50 +00:00
|
|
|
* Creates a new document with the given @p widget as widget to relay GUI things (messageboxes, ...).
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-04-15 19:11:10 +00:00
|
|
|
explicit Document( QWidget *widget );
|
2004-11-09 17:20:19 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Destroys the document.
|
|
|
|
*/
|
|
|
|
~Document();
|
2005-11-04 11:59:51 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Opens the document.
|
|
|
|
*/
|
2006-03-20 22:51:56 +00:00
|
|
|
bool openDocument( const QString & docFile, const KUrl & url, const KMimeType::Ptr &mime );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the document.
|
|
|
|
*/
|
2004-11-09 17:20:19 +00:00
|
|
|
void closeDocument();
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Registers a new @p observer for the document.
|
|
|
|
*/
|
|
|
|
void addObserver( DocumentObserver *observer );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregisters the given @p observer for the document.
|
|
|
|
*/
|
|
|
|
void removeObserver( DocumentObserver *observer );
|
2004-11-09 17:20:19 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Reparses and applies the configuration.
|
|
|
|
*/
|
|
|
|
void reparseConfig();
|
2005-03-05 15:59:15 +00:00
|
|
|
|
2007-03-30 17:46:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the widget to be used for relaying GUI things (messageboxes, ...)
|
|
|
|
*/
|
|
|
|
QWidget *widget() const;
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the document is currently opened.
|
|
|
|
*/
|
2005-01-15 01:08:35 +00:00
|
|
|
bool isOpened() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the meta data of the document or 0 if no meta data
|
|
|
|
* are available.
|
|
|
|
*/
|
2004-12-11 17:25:03 +00:00
|
|
|
const DocumentInfo * documentInfo() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the table of content of the document or 0 if no
|
|
|
|
* table of content is available.
|
|
|
|
*/
|
2004-12-11 17:25:03 +00:00
|
|
|
const DocumentSynopsis * documentSynopsis() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-07-15 13:54:36 +00:00
|
|
|
* Starts the reading of the information about the fonts in the
|
2007-07-07 20:35:01 +00:00
|
|
|
* document, if available.
|
|
|
|
*
|
|
|
|
* The results as well the end of the reading is notified using the
|
|
|
|
* signals gotFont(), fontReadingProgress() and fontReadingEnded()
|
|
|
|
*/
|
|
|
|
void startFontReading();
|
|
|
|
|
2007-07-08 21:22:37 +00:00
|
|
|
/**
|
2007-07-15 13:54:36 +00:00
|
|
|
* Force the termination of the reading of the information about the
|
2007-07-08 21:22:37 +00:00
|
|
|
* fonts in the document, if running.
|
|
|
|
*/
|
|
|
|
void stopFontReading();
|
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
/**
|
|
|
|
* Whether the current document can provide information about the
|
|
|
|
* fonts used in it.
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-07-07 20:35:01 +00:00
|
|
|
bool canProvideFontInformation() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of embedded files or 0 if no embedded files
|
|
|
|
* are available.
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
const QList<EmbeddedFile*> *embeddedFiles() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the page object for the given page @p number or 0
|
|
|
|
* if the number is out of range.
|
|
|
|
*/
|
|
|
|
const Page * page( int number ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current viewport of the document.
|
|
|
|
*/
|
2005-01-09 23:37:07 +00:00
|
|
|
const DocumentViewport & viewport() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the list of visible page rectangles.
|
|
|
|
* @see VisiblePageRect
|
|
|
|
*/
|
2006-06-23 21:11:52 +00:00
|
|
|
void setVisiblePageRects( const QVector< VisiblePageRect * > & visiblePageRects, int excludeId = -1 );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of visible page rectangles.
|
|
|
|
*/
|
|
|
|
const QVector< VisiblePageRect * > & visiblePageRects() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of the current page.
|
|
|
|
*/
|
2004-11-09 17:20:19 +00:00
|
|
|
uint currentPage() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of pages of the document.
|
|
|
|
*/
|
2004-11-09 17:20:19 +00:00
|
|
|
uint pages() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the url of the currently opened document.
|
|
|
|
*/
|
2006-03-20 22:51:56 +00:00
|
|
|
KUrl currentDocument() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-03-10 23:59:11 +00:00
|
|
|
* Returns whether the given @p action is allowed in the document.
|
|
|
|
* @see @ref Permission
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-03-10 23:59:11 +00:00
|
|
|
bool isAllowed( Permission action ) const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document supports searching.
|
|
|
|
*/
|
2005-06-24 16:45:25 +00:00
|
|
|
bool supportsSearching() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-01-05 23:12:06 +00:00
|
|
|
* Returns whether the document supports the listing of page sizes.
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-01-05 23:12:06 +00:00
|
|
|
bool supportsPageSizes() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-01-05 23:12:06 +00:00
|
|
|
* Returns the list of supported page sizes or an empty list if this
|
2007-01-02 22:37:55 +00:00
|
|
|
* feature is not available.
|
2007-01-05 23:12:06 +00:00
|
|
|
* @see supportsPageSizes()
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-01-05 23:12:06 +00:00
|
|
|
PageSize::List pageSizes() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document supports the export to ASCII text.
|
|
|
|
*/
|
2006-07-01 22:17:53 +00:00
|
|
|
bool canExportToText() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exports the document as ASCII text and saves it under @p fileName.
|
|
|
|
*/
|
2006-07-01 22:17:53 +00:00
|
|
|
bool exportToText( const QString& fileName ) const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of supported export formats.
|
|
|
|
* @see ExportFormat
|
|
|
|
*/
|
2006-10-25 15:35:53 +00:00
|
|
|
QList<ExportFormat> exportFormats() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exports the document in the given @p format and saves it under @p fileName.
|
|
|
|
*/
|
2006-10-25 15:35:53 +00:00
|
|
|
bool exportTo( const QString& fileName, const ExportFormat& format ) const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document history is at the begin.
|
|
|
|
*/
|
2005-01-27 17:31:07 +00:00
|
|
|
bool historyAtBegin() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document history is at the end.
|
|
|
|
*/
|
2005-01-27 17:31:07 +00:00
|
|
|
bool historyAtEnd() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the meta data for the given @p key and @p option or an empty variant
|
|
|
|
* if the key doesn't exists.
|
|
|
|
*/
|
|
|
|
QVariant metaData( const QString & key, const QVariant & option = QVariant() ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current rotation of the document.
|
|
|
|
*/
|
2007-01-05 17:09:47 +00:00
|
|
|
Rotation rotation() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If all pages have the same size this method returns it, if the page sizes
|
|
|
|
* differ an empty size object is returned.
|
|
|
|
*/
|
2006-10-15 19:37:14 +00:00
|
|
|
QSizeF allPagesSize() const;
|
2004-11-09 17:20:19 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Returns the size string for the given @p page or an empty string
|
|
|
|
* if the page is out of range.
|
|
|
|
*/
|
|
|
|
QString pageSizeString( int page ) const;
|
|
|
|
|
|
|
|
/**
|
2007-08-28 23:17:00 +00:00
|
|
|
* Returns the gui client of the generator, if it provides one.
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-08-28 23:17:00 +00:00
|
|
|
KXMLGUIClient* guiClient();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the current document viewport to the given @p page.
|
|
|
|
*
|
|
|
|
* @param excludeId The observer ids which shouldn't be effected by this change.
|
|
|
|
* @param smoothMove Whether the move shall be animated smoothly.
|
|
|
|
*/
|
2005-02-01 18:23:55 +00:00
|
|
|
void setViewportPage( int page, int excludeId = -1, bool smoothMove = false );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the current document viewport to the given @p viewport.
|
|
|
|
*
|
|
|
|
* @param excludeId The observer ids which shouldn't be effected by this change.
|
|
|
|
* @param smoothMove Whether the move shall be animated smoothly.
|
|
|
|
*/
|
|
|
|
void setViewport( const DocumentViewport &viewport, int excludeId = -1, bool smoothMove = false );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the current document viewport to the next viewport in the
|
|
|
|
* viewport history.
|
|
|
|
*/
|
2005-01-27 17:31:07 +00:00
|
|
|
void setPrevViewport();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the current document viewport to the previous viewport in the
|
|
|
|
* viewport history.
|
|
|
|
*/
|
2005-01-27 17:31:07 +00:00
|
|
|
void setNextViewport();
|
2006-09-26 22:22:01 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Sets the next @p viewport in the viewport history.
|
|
|
|
*/
|
|
|
|
void setNextDocumentViewport( const DocumentViewport &viewport );
|
|
|
|
|
2007-07-08 14:25:08 +00:00
|
|
|
/**
|
|
|
|
* Sets the zoom for the current document.
|
|
|
|
*
|
|
|
|
* @param excludeId The observer ids which shouldn't be effected by this change.
|
|
|
|
*/
|
|
|
|
void setZoom( int factor, int excludeId = -1 );
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Sends @p requests for pixmap generation.
|
|
|
|
*/
|
|
|
|
void requestPixmaps( const QLinkedList<PixmapRequest*> &requests );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a request for text page generation for the given page @p number.
|
|
|
|
*/
|
2007-08-13 22:25:27 +00:00
|
|
|
void requestTextPage( uint number );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a new @p annotation to the given @p page.
|
|
|
|
*/
|
|
|
|
void addPageAnnotation( int page, Annotation *annotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifies the given @p annotation on the given @p page.
|
|
|
|
*/
|
|
|
|
void modifyPageAnnotation( int page, Annotation *annotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the given @p annotation from the given @p page.
|
|
|
|
*/
|
|
|
|
void removePageAnnotation( int page, Annotation *annotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the given @p annotations from the given @p page.
|
|
|
|
*/
|
2007-05-26 19:25:18 +00:00
|
|
|
void removePageAnnotations( int page, const QList<Annotation*> &annotations );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the text selection for the given @p page.
|
|
|
|
*
|
|
|
|
* @param rect The rectangle of the selection.
|
|
|
|
* @param color The color of the selection.
|
|
|
|
*/
|
2006-09-26 22:22:01 +00:00
|
|
|
void setPageTextSelection( int page, RegularAreaRect * rect, const QColor & color );
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Describes the possible search types.
|
|
|
|
*/
|
|
|
|
enum SearchType
|
|
|
|
{
|
|
|
|
NextMatch, ///< Search next match
|
|
|
|
PreviousMatch, ///< Search previous match
|
|
|
|
AllDocument, ///< Search complete document
|
|
|
|
GoogleAll, ///< Search all words in google style
|
|
|
|
GoogleAny ///< Search any words in google style
|
|
|
|
};
|
|
|
|
|
2007-08-13 22:25:27 +00:00
|
|
|
/**
|
|
|
|
* Describes how search ended
|
|
|
|
*/
|
|
|
|
enum SearchStatus
|
|
|
|
{
|
|
|
|
MatchFound, ///< Any match was found
|
|
|
|
NoMatchFound, ///< No match was found
|
|
|
|
SearchCancelled ///< The search was cancelled
|
|
|
|
};
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Searches the given @p text in the document.
|
|
|
|
*
|
|
|
|
* @param searchID The unique id for this search request.
|
|
|
|
* @param fromStart Whether the search should be started at begin of the document.
|
|
|
|
* @param caseSensitivity Whether the search is case sensitive.
|
2007-01-13 22:55:00 +00:00
|
|
|
* @param type The type of the search. @ref SearchType
|
2007-01-02 22:37:55 +00:00
|
|
|
* @param moveViewport Whether the viewport shall be moved to the position of the matches.
|
|
|
|
* @param color The highlighting color of the matches.
|
|
|
|
* @param noDialogs Whether a search dialog shall be shown.
|
|
|
|
*/
|
2007-08-13 22:25:27 +00:00
|
|
|
void searchText( int searchID, const QString & text, bool fromStart, Qt::CaseSensitivity caseSensitivity,
|
2005-02-02 18:18:26 +00:00
|
|
|
SearchType type, bool moveViewport, const QColor & color, bool noDialogs = false );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Continues the search for the given @p searchID.
|
|
|
|
*/
|
2007-08-13 22:25:27 +00:00
|
|
|
void continueSearch( int searchID );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resets the search for the given @p searchID.
|
|
|
|
*/
|
2005-02-01 18:26:56 +00:00
|
|
|
void resetSearch( int searchID );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the bookmark manager of the document.
|
|
|
|
*/
|
2007-10-28 18:31:33 +00:00
|
|
|
BookmarkManager * bookmarkManager() const;
|
2006-12-27 16:04:49 +00:00
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Processes the given @p action.
|
2007-01-02 22:37:55 +00:00
|
|
|
*/
|
2007-04-20 12:49:17 +00:00
|
|
|
void processAction( const Action *action );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
2007-11-26 21:43:54 +00:00
|
|
|
/**
|
|
|
|
* Returns a list of the bookmarked.pages
|
|
|
|
*/
|
|
|
|
QList<int> bookmarkedPageList() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the range of the bookmarked.pages
|
|
|
|
*/
|
|
|
|
QString bookmarkedPageRange() const;
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Processes/Executes the given source @p reference.
|
|
|
|
*/
|
|
|
|
void processSourceReference( const SourceReference *reference );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document can configure the printer itself.
|
|
|
|
*/
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
bool canConfigurePrinter() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
2007-11-26 21:43:54 +00:00
|
|
|
/**
|
|
|
|
* What type of printing a document supports
|
|
|
|
*/
|
|
|
|
enum PrintingType
|
|
|
|
{
|
|
|
|
NoPrinting, ///< Printing Not Supported
|
|
|
|
NativePrinting, ///< Native Cross-Platform Printing
|
|
|
|
PostscriptPrinting ///< Postscript file printing
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns what sort of printing the document supports:
|
|
|
|
* Native, Postscript, None
|
|
|
|
*/
|
|
|
|
PrintingType printingSupport() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the document supports printing to both PDF and PS files.
|
|
|
|
*/
|
|
|
|
bool supportsPrintToFile() const;
|
|
|
|
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* Prints the document to the given @p printer.
|
|
|
|
*/
|
2007-10-15 23:01:27 +00:00
|
|
|
bool print( QPrinter &printer );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a custom printer configuration page or 0 if no
|
|
|
|
* custom printer configuration page is available.
|
|
|
|
*/
|
2007-10-15 23:01:27 +00:00
|
|
|
QWidget* printConfigurationWidget() const;
|
2007-01-02 22:37:55 +00:00
|
|
|
|
2007-01-28 15:46:10 +00:00
|
|
|
/**
|
|
|
|
* Fill the KConfigDialog @p dialog with the setting pages of the
|
|
|
|
* generators.
|
|
|
|
*/
|
|
|
|
void fillConfigDialog( KConfigDialog * dialog );
|
|
|
|
|
2007-07-12 17:52:14 +00:00
|
|
|
/**
|
|
|
|
* Returns the number of generators that have a configuration widget.
|
|
|
|
*/
|
|
|
|
int configurableGenerators() const;
|
|
|
|
|
2007-01-28 15:46:10 +00:00
|
|
|
/**
|
2007-02-05 13:50:36 +00:00
|
|
|
* Returns the list with the supported MIME types.
|
2007-01-28 15:46:10 +00:00
|
|
|
*/
|
|
|
|
QStringList supportedMimeTypes() const;
|
|
|
|
|
2007-03-07 18:15:00 +00:00
|
|
|
/**
|
|
|
|
* Returns the component data associated with the generator. May be null.
|
|
|
|
*/
|
|
|
|
const KComponentData* componentData() const;
|
|
|
|
|
2006-11-20 07:53:32 +00:00
|
|
|
public Q_SLOTS:
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
|
|
|
* This slot is called whenever the user changes the @p rotation of
|
|
|
|
* the document.
|
|
|
|
*/
|
2007-05-01 23:09:45 +00:00
|
|
|
void setRotation( int rotation );
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-01-05 23:12:06 +00:00
|
|
|
* This slot is called whenever the user changes the page @p size
|
2007-01-02 22:37:55 +00:00
|
|
|
* of the document.
|
|
|
|
*/
|
2007-05-01 23:21:29 +00:00
|
|
|
void setPageSize( const PageSize &size );
|
2005-07-20 22:28:23 +00:00
|
|
|
|
2007-08-13 22:25:27 +00:00
|
|
|
/**
|
|
|
|
* Cancels the current search
|
|
|
|
*/
|
|
|
|
void cancelSearch();
|
|
|
|
|
|
|
|
|
2006-11-20 07:53:32 +00:00
|
|
|
Q_SIGNALS:
|
2007-01-02 22:37:55 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests a
|
2007-01-02 22:37:55 +00:00
|
|
|
* document close operation.
|
|
|
|
*/
|
2005-11-04 11:59:51 +00:00
|
|
|
void close();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests an
|
2007-01-02 22:37:55 +00:00
|
|
|
* application quit operation.
|
|
|
|
*/
|
2005-11-04 11:59:51 +00:00
|
|
|
void quit();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests a
|
2007-01-02 22:37:55 +00:00
|
|
|
* find operation.
|
|
|
|
*/
|
2005-01-01 21:50:34 +00:00
|
|
|
void linkFind();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests a
|
2007-01-02 22:37:55 +00:00
|
|
|
* goto operation.
|
|
|
|
*/
|
2005-01-01 21:50:34 +00:00
|
|
|
void linkGoToPage();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests a
|
2007-01-02 22:37:55 +00:00
|
|
|
* start presentation operation.
|
|
|
|
*/
|
2005-04-07 09:53:15 +00:00
|
|
|
void linkPresentation();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests an
|
2007-01-02 22:37:55 +00:00
|
|
|
* end presentation operation.
|
|
|
|
*/
|
2005-04-07 09:53:15 +00:00
|
|
|
void linkEndPresentation();
|
2007-01-02 22:37:55 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* This signal is emitted whenever an action requests an
|
2007-01-02 22:37:55 +00:00
|
|
|
* open url operation for the given document @p url.
|
|
|
|
*/
|
|
|
|
void openUrl( const KUrl &url );
|
|
|
|
|
|
|
|
/**
|
2007-01-04 15:22:28 +00:00
|
|
|
* This signal is emitted whenever an error occurred.
|
2007-01-02 22:37:55 +00:00
|
|
|
*
|
|
|
|
* @param text The description of the error.
|
|
|
|
* @param duration The time in seconds the message should be shown to the user.
|
|
|
|
*/
|
|
|
|
void error( const QString &text, int duration );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This signal is emitted to signal a warning.
|
|
|
|
*
|
|
|
|
* @param text The description of the warning.
|
|
|
|
* @param duration The time in seconds the message should be shown to the user.
|
|
|
|
*/
|
|
|
|
void warning( const QString &text, int duration );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This signal is emitted to signal a notice.
|
|
|
|
*
|
|
|
|
* @param text The description of the notice.
|
|
|
|
* @param duration The time in seconds the message should be shown to the user.
|
|
|
|
*/
|
|
|
|
void notice( const QString &text, int duration );
|
2005-01-01 21:50:34 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
/**
|
|
|
|
* Emitted when a new font is found during the reading of the fonts of
|
|
|
|
* the document.
|
|
|
|
*/
|
|
|
|
void gotFont( const Okular::FontInfo& font );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reports the progress when reading the fonts in the document.
|
|
|
|
*
|
|
|
|
* \param page is the page that was just finished to scan for fonts
|
|
|
|
*/
|
|
|
|
void fontReadingProgress( int page );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reports that the reading of the fonts in the document is finished.
|
|
|
|
*/
|
|
|
|
void fontReadingEnded();
|
|
|
|
|
2007-08-13 22:25:27 +00:00
|
|
|
/**
|
|
|
|
* Reports that the current search finished
|
|
|
|
*/
|
2007-08-23 22:16:37 +00:00
|
|
|
void searchFinished( int id, Okular::Document::SearchStatus endStatus );
|
2007-08-13 22:25:27 +00:00
|
|
|
|
2004-11-09 17:20:19 +00:00
|
|
|
private:
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2007-04-14 19:44:07 +00:00
|
|
|
friend class DocumentPrivate;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2007-04-14 19:44:07 +00:00
|
|
|
DocumentPrivate *const d;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
|
|
|
Q_DISABLE_COPY( Document )
|
|
|
|
|
|
|
|
Q_PRIVATE_SLOT( d, void saveDocumentInfo() const )
|
|
|
|
Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() )
|
|
|
|
Q_PRIVATE_SLOT( d, void sendGeneratorRequest() )
|
|
|
|
Q_PRIVATE_SLOT( d, void rotationFinished( int page ) )
|
2007-07-07 20:35:01 +00:00
|
|
|
Q_PRIVATE_SLOT( d, void fontReadingProgress( int page ) )
|
|
|
|
Q_PRIVATE_SLOT( d, void fontReadingGotFont( const Okular::FontInfo& font ) )
|
2007-07-12 20:04:56 +00:00
|
|
|
Q_PRIVATE_SLOT( d, void slotGeneratorConfigChanged( const QString& ) )
|
2007-08-13 22:25:27 +00:00
|
|
|
|
|
|
|
// search thread simulators
|
|
|
|
Q_PRIVATE_SLOT( d, void doContinueNextMatchSearch(void *pagesToNotifySet, void * match, int currentPage, int searchID, const QString & text, int caseSensitivity, bool moveViewport, const QColor & color, bool noDialogs, int donePages) )
|
2007-08-14 00:15:50 +00:00
|
|
|
Q_PRIVATE_SLOT( d, void doContinueAllDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QString & text, int caseSensitivity, const QColor & color) )
|
|
|
|
Q_PRIVATE_SLOT( d, void doContinueGooglesDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QString & text, int caseSensitivity, const QColor & color, bool matchAll) )
|
2004-09-08 12:41:14 +00:00
|
|
|
};
|
|
|
|
|
2005-01-07 13:07:29 +00:00
|
|
|
|
2005-01-03 15:51:05 +00:00
|
|
|
/**
|
2005-01-09 23:37:07 +00:00
|
|
|
* @short A view on the document.
|
2005-01-03 15:51:05 +00:00
|
|
|
*
|
2005-01-09 23:37:07 +00:00
|
|
|
* The Viewport structure is the 'current view' over the document. Contained
|
2007-01-04 15:22:28 +00:00
|
|
|
* data is broadcasted between observers to synchronize their viewports to get
|
2005-01-09 23:37:07 +00:00
|
|
|
* the 'I scroll one view and others scroll too' views.
|
2005-01-03 15:51:05 +00:00
|
|
|
*/
|
2006-05-08 20:12:04 +00:00
|
|
|
class OKULAR_EXPORT DocumentViewport
|
2005-01-03 15:51:05 +00:00
|
|
|
{
|
2005-01-09 23:37:07 +00:00
|
|
|
public:
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Creates a new viewport for the given page @p number.
|
|
|
|
*/
|
|
|
|
DocumentViewport( int number = -1 );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new viewport from the given xml @p description.
|
|
|
|
*/
|
|
|
|
DocumentViewport( const QString &description );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the viewport as xml description.
|
|
|
|
*/
|
|
|
|
QString toString() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the viewport is valid.
|
|
|
|
*/
|
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
bool operator==( const DocumentViewport &other ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of the page nearest the center of the viewport.
|
|
|
|
*/
|
2005-01-09 23:37:07 +00:00
|
|
|
int pageNumber;
|
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Describes the relative position of the viewport.
|
|
|
|
*/
|
|
|
|
enum Position
|
|
|
|
{
|
|
|
|
Center = 1, ///< Relative to the center of the page.
|
|
|
|
TopLeft = 2 ///< Relative to the top left corner of the page.
|
|
|
|
};
|
2005-06-13 11:53:47 +00:00
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* If 'rePos.enabled == true' then this structure contains the
|
|
|
|
* viewport center.
|
|
|
|
*/
|
2005-01-09 23:37:07 +00:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
2005-06-13 11:53:47 +00:00
|
|
|
double normalizedX;
|
|
|
|
double normalizedY;
|
|
|
|
Position pos;
|
|
|
|
} rePos;
|
2005-01-09 23:37:07 +00:00
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* If 'autoFit.enabled == true' then the page must be autofitted in the viewport.
|
|
|
|
*/
|
2005-01-09 23:37:07 +00:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
|
|
|
bool width;
|
|
|
|
bool height;
|
|
|
|
} autoFit;
|
2005-01-03 15:51:05 +00:00
|
|
|
};
|
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
/**
|
2006-12-28 16:58:56 +00:00
|
|
|
* @short A DOM tree containing information about the document.
|
2004-12-11 17:25:03 +00:00
|
|
|
*
|
2006-12-28 16:58:56 +00:00
|
|
|
* The DocumentInfo structure can be filled in by generators to display
|
|
|
|
* metadata about the currently opened file.
|
2004-12-10 16:04:45 +00:00
|
|
|
*/
|
2006-05-08 20:12:04 +00:00
|
|
|
class OKULAR_EXPORT DocumentInfo : public QDomDocument
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
2005-01-02 22:37:52 +00:00
|
|
|
public:
|
2007-05-13 12:54:46 +00:00
|
|
|
/**
|
|
|
|
* The list of predefined keys.
|
|
|
|
*/
|
|
|
|
enum Key {
|
|
|
|
Title, ///< The title of the document
|
|
|
|
Subject, ///< The subject of the document
|
|
|
|
Description, ///< The description of the document
|
|
|
|
Author, ///< The author of the document
|
|
|
|
Creator, ///< The creator of the document (this can be different from the author)
|
|
|
|
Producer, ///< The producer of the document (e.g. some software)
|
|
|
|
Copyright, ///< The copyright of the document
|
|
|
|
Pages, ///< The number of pages of the document
|
|
|
|
CreationDate, ///< The date of creation of the document
|
|
|
|
ModificationDate, ///< The date of last modification of the document
|
|
|
|
MimeType, ///< The mime type of the document
|
|
|
|
Category, ///< The category of the document
|
|
|
|
Keywords ///< The keywords which describe the content of the document
|
|
|
|
};
|
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Creates a new document info.
|
|
|
|
*/
|
2005-01-02 22:37:52 +00:00
|
|
|
DocumentInfo();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a value for a special key. The title should be an i18n'ed
|
|
|
|
* string, since it's used in the document information dialog.
|
|
|
|
*/
|
|
|
|
void set( const QString &key, const QString &value,
|
|
|
|
const QString &title = QString() );
|
|
|
|
|
2007-05-13 12:54:46 +00:00
|
|
|
/**
|
|
|
|
* Sets the value for a predefined key. You should use this method
|
|
|
|
* whenever a predefined key exists for your value.
|
|
|
|
*/
|
|
|
|
void set( enum Key, const QString &value );
|
|
|
|
|
2005-01-02 22:37:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the value for a given key or an empty string when the
|
|
|
|
* key doesn't exist.
|
|
|
|
*/
|
|
|
|
QString get( const QString &key ) const;
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2005-06-13 15:46:23 +00:00
|
|
|
* @short A DOM tree that describes the Table of Contents.
|
2004-12-11 17:25:03 +00:00
|
|
|
*
|
|
|
|
* The Synopsis (TOC or Table Of Contents for friends) is represented via
|
2005-06-13 15:46:23 +00:00
|
|
|
* a dom tree where each node has an internal name (displayed in the listview)
|
2004-12-11 17:25:03 +00:00
|
|
|
* and one or more attributes.
|
|
|
|
*
|
2005-01-07 13:07:29 +00:00
|
|
|
* In the tree the tag name is the 'screen' name of the entry. A tag can have
|
|
|
|
* attributes. Here follows the list of tag attributes with meaning:
|
2005-08-31 18:13:59 +00:00
|
|
|
* - Icon: An icon to be set in the Lisview for the node
|
2005-01-09 23:37:07 +00:00
|
|
|
* - Viewport: A string description of the referred viewport
|
|
|
|
* - ViewportName: A 'named reference' to the viewport that must be converted
|
2007-01-02 22:37:55 +00:00
|
|
|
* using metaData( "NamedViewport", *viewport_name* )
|
2004-12-10 16:04:45 +00:00
|
|
|
*/
|
2006-05-08 20:12:04 +00:00
|
|
|
class OKULAR_EXPORT DocumentSynopsis : public QDomDocument
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Creates a new document synopsis object.
|
|
|
|
*/
|
2005-01-03 15:51:05 +00:00
|
|
|
DocumentSynopsis();
|
2007-01-02 19:05:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new document synopsis object with the given
|
|
|
|
* @p document as parent node.
|
|
|
|
*/
|
2006-09-20 11:44:58 +00:00
|
|
|
DocumentSynopsis( const QDomDocument &document );
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2006-05-28 16:54:54 +00:00
|
|
|
/**
|
2006-12-28 16:28:28 +00:00
|
|
|
* @short An embedded file into the document.
|
|
|
|
*
|
|
|
|
* This class represents a sort of interface of an embedded file in a document.
|
|
|
|
*
|
|
|
|
* Generators \b must re-implement its members to give the all the information
|
|
|
|
* about an embedded file, like its name, its description, the date of creation
|
|
|
|
* and modification, and the real data of the file.
|
2006-05-28 16:54:54 +00:00
|
|
|
*/
|
|
|
|
class OKULAR_EXPORT EmbeddedFile
|
|
|
|
{
|
|
|
|
public:
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Creates a new embedded file.
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
EmbeddedFile();
|
2007-01-02 19:05:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the embedded file.
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual ~EmbeddedFile();
|
2006-12-28 16:28:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the name of the file
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual QString name() const = 0;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
2006-12-28 16:28:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the description of the file, or an empty string if not
|
|
|
|
* available
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual QString description() const = 0;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
2006-12-28 16:28:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the real data representing the file contents
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual QByteArray data() const = 0;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
2007-07-03 14:47:16 +00:00
|
|
|
/**
|
|
|
|
* Returns the size (in bytes) of the file, if available, or -1 otherwise.
|
|
|
|
*
|
|
|
|
* @note this method should be a fast way to know the size of the file
|
|
|
|
* with no need to extract all the data from it
|
|
|
|
*/
|
|
|
|
virtual int size() const = 0;
|
|
|
|
|
2006-12-28 16:28:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the modification date of the file, or an invalid date
|
|
|
|
* if not available
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual QDateTime modificationDate() const = 0;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
2006-12-28 16:28:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the creation date of the file, or an invalid date
|
|
|
|
* if not available
|
|
|
|
*/
|
2006-05-28 16:54:54 +00:00
|
|
|
virtual QDateTime creationDate() const = 0;
|
2007-07-03 14:47:16 +00:00
|
|
|
|
2006-05-28 16:54:54 +00:00
|
|
|
};
|
|
|
|
|
2006-06-23 21:11:52 +00:00
|
|
|
/**
|
|
|
|
* @short An area of a specified page
|
|
|
|
*/
|
2007-01-02 19:05:49 +00:00
|
|
|
class OKULAR_EXPORT VisiblePageRect
|
2006-06-23 21:11:52 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Creates a new visible page rectangle.
|
|
|
|
*
|
|
|
|
* @param pageNumber The page number where the rectangle is located.
|
|
|
|
* @param rectangle The rectangle in normalized coordinates.
|
|
|
|
*/
|
2007-04-19 18:30:20 +00:00
|
|
|
explicit VisiblePageRect( int pageNumber = -1, const NormalizedRect &rectangle = NormalizedRect() );
|
2006-06-23 21:11:52 +00:00
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* The page number where the rectangle is located.
|
|
|
|
*/
|
2006-06-23 21:11:52 +00:00
|
|
|
int pageNumber;
|
2007-01-02 19:05:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The rectangle in normalized coordinates.
|
|
|
|
*/
|
2006-06-23 21:11:52 +00:00
|
|
|
NormalizedRect rect;
|
|
|
|
};
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
#endif
|