2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2004 Enrico Ros <eros.kde@email.it>
|
2021-06-03 18:33:18 +00:00
|
|
|
|
|
|
|
Work sponsored by the LiMux project of the city of Munich:
|
2021-05-24 11:41:08 +00:00
|
|
|
SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB a KDAB Group company <info@kdab.com>
|
2021-05-24 07:25:56 +00:00
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_PAGE_H_
|
|
|
|
#define _OKULAR_PAGE_H_
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "area.h"
|
|
|
|
#include "global.h"
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "textpage.h"
|
2005-07-15 18:20:57 +00:00
|
|
|
|
2007-03-25 22:36:41 +00:00
|
|
|
class QPixmap;
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
class PagePainter;
|
|
|
|
|
|
|
|
namespace Okular
|
|
|
|
{
|
2005-07-15 18:20:57 +00:00
|
|
|
class Annotation;
|
2007-04-17 20:01:42 +00:00
|
|
|
class Document;
|
2013-02-24 21:58:53 +00:00
|
|
|
class DocumentObserver;
|
2007-04-14 19:58:17 +00:00
|
|
|
class DocumentPrivate;
|
2007-02-25 00:07:59 +00:00
|
|
|
class FormField;
|
2007-03-24 00:18:54 +00:00
|
|
|
class PagePrivate;
|
2006-09-21 08:45:36 +00:00
|
|
|
class PageTransition;
|
2006-11-17 22:15:15 +00:00
|
|
|
class SourceReference;
|
- GIGANTIC 2700 line diff with LOTS OF FEATURES!
- 1. editor-like text selection, and I do mean it, its not pseudo-editor
(like the ones acroread and kviewshell have) it doesnt intersect the
selection area with words under it, no, it does a lot more, including
work on cursors and searching for the text area closest to the given
cursor
- 2. rotation support, change the orientation of the documents if
you need too :)
- 3. the kfaxview backend works beautifully, porting kviewshell backends
is damn easy ! djvu and dvi will be next!
- 4. Hardware Blending of selection rectangles! We now use XRender
instead of KImageEffect, makes a damn faster blend!
- 5. Overview mode - as seen in Kviewshell, but quite a bit extended,
the kviewshell is only one state, while we support it in both
continous and non-continous form
- BTW. I coded all those features myself, (apart from kfaxview backend library)
it is an impressive bit right? but oKular cant be run by only one person,
join in on the fun! i can introduce you into the code just mail niedakh@gmail.com
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=509871
2006-02-15 18:54:49 +00:00
|
|
|
class TextSelection;
|
2012-11-08 20:29:09 +00:00
|
|
|
class Tile;
|
- GIGANTIC 2700 line diff with LOTS OF FEATURES!
- 1. editor-like text selection, and I do mean it, its not pseudo-editor
(like the ones acroread and kviewshell have) it doesnt intersect the
selection area with words under it, no, it does a lot more, including
work on cursors and searching for the text area closest to the given
cursor
- 2. rotation support, change the orientation of the documents if
you need too :)
- 3. the kfaxview backend works beautifully, porting kviewshell backends
is damn easy ! djvu and dvi will be next!
- 4. Hardware Blending of selection rectangles! We now use XRender
instead of KImageEffect, makes a damn faster blend!
- 5. Overview mode - as seen in Kviewshell, but quite a bit extended,
the kviewshell is only one state, while we support it in both
continous and non-continous form
- BTW. I coded all those features myself, (apart from kfaxview backend library)
it is an impressive bit right? but oKular cant be run by only one person,
join in on the fun! i can introduce you into the code just mail niedakh@gmail.com
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=509871
2006-02-15 18:54:49 +00:00
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
/**
|
|
|
|
* @short Collector for all the data belonging to a page.
|
|
|
|
*
|
2006-09-21 08:45:36 +00:00
|
|
|
* The Page class contains pixmaps (referenced using observers id as key),
|
2005-01-07 13:03:10 +00:00
|
|
|
* a search page (a class used internally for retrieving text), rect classes
|
|
|
|
* (that describe links or other active areas in the current page) and more.
|
2004-09-15 20:45:00 +00:00
|
|
|
*
|
2005-02-08 15:24:23 +00:00
|
|
|
* All coordinates are normalized to the page, so {x,y} are valid in [0,1]
|
|
|
|
* range as long as NormalizedRect components.
|
|
|
|
*
|
|
|
|
* Note: The class takes ownership of all objects.
|
2004-09-08 12:41:14 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Page
|
2004-09-08 12:41:14 +00:00
|
|
|
{
|
2004-11-06 00:56:55 +00:00
|
|
|
public:
|
2007-01-20 14:51:43 +00:00
|
|
|
/**
|
|
|
|
* An action to be executed when particular events happen.
|
|
|
|
*/
|
2006-10-09 18:02:59 +00:00
|
|
|
enum PageAction {
|
2007-01-20 14:51:43 +00:00
|
|
|
Opening, ///< An action to be executed when the page is "opened".
|
|
|
|
Closing ///< An action to be executed when the page is "closed".
|
2006-10-09 18:02:59 +00:00
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:09:26 +00:00
|
|
|
/**
|
|
|
|
* Creates a new page.
|
|
|
|
*
|
2019-12-20 15:40:59 +00:00
|
|
|
* @param pageNumber The number of the page in the document.
|
2006-11-23 16:09:26 +00:00
|
|
|
* @param width The width of the page.
|
|
|
|
* @param height The height of the page.
|
2007-01-05 17:09:47 +00:00
|
|
|
* @param orientation The orientation of the page
|
2006-11-23 16:09:26 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
Page(uint pageNumber, double width, double height, Rotation orientation);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:09:26 +00:00
|
|
|
/**
|
|
|
|
* Destroys the page.
|
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
~Page();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the number of the page in the document.
|
|
|
|
*/
|
|
|
|
int number() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
2007-01-02 19:05:49 +00:00
|
|
|
* Returns the orientation of the page as defined by the document.
|
2006-11-23 19:25:52 +00:00
|
|
|
*/
|
2007-01-05 17:09:47 +00:00
|
|
|
Rotation orientation() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Returns the rotation of the page as defined by the user.
|
|
|
|
*/
|
2007-01-05 17:09:47 +00:00
|
|
|
Rotation rotation() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-01-02 19:05:49 +00:00
|
|
|
/**
|
|
|
|
* Returns the total orientation which is the original orientation plus
|
|
|
|
* the user defined rotation.
|
|
|
|
*/
|
2007-01-05 17:09:47 +00:00
|
|
|
Rotation totalOrientation() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the width of the page.
|
|
|
|
*/
|
|
|
|
double width() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the height of the page.
|
|
|
|
*/
|
|
|
|
double height() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the ration (height / width) of the page.
|
|
|
|
*/
|
|
|
|
double ratio() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-05-18 23:06:21 +00:00
|
|
|
/**
|
|
|
|
* Returns the bounding box of the page content in normalized [0,1] coordinates,
|
|
|
|
* in terms of the upright orientation (Rotation0).
|
|
|
|
* If it has not been computed yet, returns the full page (i.e., (0, 0, 1, 1)).
|
|
|
|
* Note that the bounding box may be null if the page is blank.
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
|
|
|
NormalizedRect boundingBox() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-05-18 23:06:21 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the bounding box of the page has been computed.
|
|
|
|
* Note that even if the bounding box is computed, it may be null if the page is blank.
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
|
|
|
bool isBoundingBoxKnown() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-05-18 23:06:21 +00:00
|
|
|
/**
|
|
|
|
* Sets the bounding box of the page content in normalized [0,1] coordinates,
|
|
|
|
* in terms of the upright orientation (Rotation0).
|
|
|
|
* (This does not inform the document's observers, call Document::SetPageBoundingBox
|
|
|
|
* instead if you want that.)
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
|
|
|
void setBoundingBox(const NormalizedRect &bbox);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:09:26 +00:00
|
|
|
/**
|
2020-02-23 23:12:53 +00:00
|
|
|
* Returns whether the page of size @p width x @p height has a @p pixmap
|
2013-02-24 21:58:53 +00:00
|
|
|
* in the region given by @p rect for the given @p observer
|
2020-02-23 23:12:53 +00:00
|
|
|
* If there is a partially rendered pixmap the answer is false.
|
2006-11-23 16:09:26 +00:00
|
|
|
*/
|
2013-02-24 21:58:53 +00:00
|
|
|
bool hasPixmap(DocumentObserver *observer, int width = -1, int height = -1, const NormalizedRect &rect = NormalizedRect()) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:09:26 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Returns whether the page provides a text page (@ref TextPage).
|
2006-11-23 16:09:26 +00:00
|
|
|
*/
|
|
|
|
bool hasTextPage() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:54:28 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the page has an object rect which includes the point (@p x, @p y)
|
|
|
|
* at scale (@p xScale, @p yScale).
|
|
|
|
*/
|
2006-09-19 17:17:29 +00:00
|
|
|
bool hasObjectRect(double x, double y, double xScale, double yScale) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:54:28 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the page provides highlighting for the observer with the
|
|
|
|
* given @p id.
|
|
|
|
*/
|
|
|
|
bool hasHighlights(int id = -1) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:54:28 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the page provides a transition effect.
|
|
|
|
*/
|
2005-02-08 15:24:23 +00:00
|
|
|
bool hasTransition() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the page provides annotations.
|
|
|
|
*/
|
|
|
|
bool hasAnnotations() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 16:54:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the bounding rect of the text which matches the following criteria
|
|
|
|
* or 0 if the search is not successful.
|
|
|
|
*
|
|
|
|
* @param id An unique id for this search.
|
|
|
|
* @param text The search text.
|
2007-01-13 22:55:00 +00:00
|
|
|
* @param direction The direction of the search (@ref SearchDirection)
|
2006-11-23 16:54:28 +00:00
|
|
|
* @param caseSensitivity If Qt::CaseSensitive, the search is case sensitive; otherwise
|
|
|
|
* the search is case insensitive.
|
|
|
|
* @param lastRect If 0 (default) the search starts at the beginning of the page, otherwise
|
2008-09-25 15:05:22 +00:00
|
|
|
* right/below the coordinates of the given rect.
|
2006-11-23 16:54:28 +00:00
|
|
|
*/
|
2017-09-05 21:27:18 +00:00
|
|
|
RegularAreaRect *findText(int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect = nullptr) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 17:11:04 +00:00
|
|
|
/**
|
2006-11-24 21:02:38 +00:00
|
|
|
* Returns the page text (or part of it).
|
|
|
|
* @see TextPage::text()
|
2006-11-23 17:11:04 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
QString text(const RegularAreaRect *area = nullptr) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2009-11-12 21:48:43 +00:00
|
|
|
/**
|
|
|
|
* Returns the page text (or part of it).
|
|
|
|
* @see TextPage::text()
|
|
|
|
* @since 0.10 (KDE 4.4)
|
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
QString text(const RegularAreaRect *area, TextPage::TextAreaInclusionBehaviour b) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2011-10-31 15:33:03 +00:00
|
|
|
/**
|
|
|
|
* Returns the page text (or part of it) including the bounding
|
|
|
|
* rectangles. Note that ownership of the contents of the returned
|
|
|
|
* list belongs to the caller.
|
|
|
|
* @see TextPage::words()
|
|
|
|
* @since 0.14 (KDE 4.8)
|
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
TextEntity::List words(const RegularAreaRect *area, TextPage::TextAreaInclusionBehaviour b) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-03-25 21:48:07 +00:00
|
|
|
/**
|
|
|
|
* Returns the area and text of the word at the given point
|
|
|
|
* Note that ownership of the returned area belongs to the caller.
|
|
|
|
* @see TextPage::wordAt()
|
|
|
|
* @since 0.15 (KDE 4.9)
|
|
|
|
*/
|
2017-09-05 21:27:18 +00:00
|
|
|
RegularAreaRect *wordAt(const NormalizedPoint &p, QString *word = nullptr) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 17:11:04 +00:00
|
|
|
/**
|
|
|
|
* Returns the rectangular area of the given @p selection.
|
|
|
|
*/
|
|
|
|
RegularAreaRect *textArea(TextSelection *selection) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 17:11:04 +00:00
|
|
|
/**
|
|
|
|
* Returns the object rect of the given @p type which is at point (@p x, @p y) at scale (@p xScale, @p yScale).
|
|
|
|
*/
|
|
|
|
const ObjectRect *objectRect(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-06-29 10:39:42 +00:00
|
|
|
/**
|
|
|
|
* Returns all object rects of the given @p type which are at point (@p x, @p y) at scale (@p xScale, @p yScale).
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
2022-03-19 18:14:39 +00:00
|
|
|
QList<const ObjectRect *> objectRects(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2009-03-23 12:05:00 +00:00
|
|
|
/**
|
|
|
|
* Returns the object rect of the given @p type which is nearest to the point (@p x, @p y) at scale (@p xScale, @p yScale).
|
|
|
|
*
|
|
|
|
* @since 0.8.2 (KDE 4.2.2)
|
|
|
|
*/
|
|
|
|
const ObjectRect *nearestObjectRect(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double *distance) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 17:11:04 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Returns the transition effect of the page or 0 if no transition
|
|
|
|
* effect is set (see hasTransition()).
|
2006-11-23 17:11:04 +00:00
|
|
|
*/
|
|
|
|
const PageTransition *transition() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of annotations of the page.
|
|
|
|
*/
|
2022-03-31 14:16:40 +00:00
|
|
|
QList<Annotation *> annotations() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2017-10-25 13:21:46 +00:00
|
|
|
/**
|
|
|
|
* Returns the annotation with the given unique name.
|
2017-11-06 05:10:13 +00:00
|
|
|
* @since 1.3
|
2017-10-25 13:21:46 +00:00
|
|
|
*/
|
|
|
|
Annotation *annotation(const QString &uniqueName) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 17:11:04 +00:00
|
|
|
/**
|
2007-05-27 09:59:52 +00:00
|
|
|
* Returns the @ref Action object which is associated with the given page @p action
|
2006-11-23 17:11:04 +00:00
|
|
|
* or 0 if no page action is set.
|
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
const Action *pageAction(PageAction action) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of FormField of the page.
|
|
|
|
*/
|
2022-03-21 23:59:42 +00:00
|
|
|
QList<FormField *> formFields() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
2013-02-24 21:58:53 +00:00
|
|
|
* Sets the region described by @p rect with @p pixmap for the
|
|
|
|
* given @p observer.
|
2012-08-19 23:31:32 +00:00
|
|
|
* If @p rect is not set (default) the @p pixmap is set to the entire
|
|
|
|
* page.
|
2006-11-23 19:25:52 +00:00
|
|
|
*/
|
2013-02-24 21:58:53 +00:00
|
|
|
void setPixmap(DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect = NormalizedRect());
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p text page.
|
|
|
|
*/
|
2006-11-23 16:09:26 +00:00
|
|
|
void setTextPage(TextPage *text);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the list of object @p rects of the page.
|
|
|
|
*/
|
2022-03-31 14:16:40 +00:00
|
|
|
void setObjectRects(const QList<ObjectRect *> &rects);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2021-12-29 08:55:56 +00:00
|
|
|
/**
|
|
|
|
* Gets the list of object rects of the page.
|
|
|
|
*
|
|
|
|
* @since 22.04
|
|
|
|
*/
|
2022-03-31 14:16:40 +00:00
|
|
|
const QList<ObjectRect *> &objectRects() const;
|
2021-12-29 08:55:56 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the list of source reference objects @p rects.
|
|
|
|
*/
|
2022-03-21 23:59:42 +00:00
|
|
|
void setSourceReferences(const QList<SourceRefObjectRect *> &rects);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-31 10:48:49 +00:00
|
|
|
/**
|
|
|
|
* Sets the duration of the page to @p seconds when displayed in presentation mode.
|
|
|
|
*
|
2006-12-31 14:41:34 +00:00
|
|
|
* Setting a negative number disables the duration.
|
2006-12-31 10:48:49 +00:00
|
|
|
*/
|
2006-12-31 14:41:34 +00:00
|
|
|
void setDuration(double seconds);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-31 10:48:49 +00:00
|
|
|
/**
|
|
|
|
* Returns the duration in seconds of the page when displayed in presentation mode.
|
|
|
|
*
|
2006-12-31 14:41:34 +00:00
|
|
|
* A negative number means that no time is set.
|
2006-12-31 10:48:49 +00:00
|
|
|
*/
|
2006-12-31 14:41:34 +00:00
|
|
|
double duration() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-01-19 23:30:32 +00:00
|
|
|
/**
|
|
|
|
* Sets the labels for the page to @p label .
|
|
|
|
*/
|
|
|
|
void setLabel(const QString &label);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-01-19 23:30:32 +00:00
|
|
|
/**
|
|
|
|
* Returns the label of the page, or a null string if not set.
|
|
|
|
*/
|
|
|
|
QString label() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-24 21:02:38 +00:00
|
|
|
/**
|
|
|
|
* Returns the current text selection.
|
|
|
|
*/
|
|
|
|
const RegularAreaRect *textSelection() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-03-30 14:08:20 +00:00
|
|
|
/**
|
|
|
|
* Returns the color of the current text selection, or an invalid color
|
|
|
|
* if no text selection has been set.
|
|
|
|
*/
|
|
|
|
QColor textSelectionColor() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Adds a new @p annotation to the page.
|
|
|
|
*/
|
2005-02-18 18:24:45 +00:00
|
|
|
void addAnnotation(Annotation *annotation);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Removes the @p annotation from the page.
|
|
|
|
*/
|
2006-09-14 18:42:28 +00:00
|
|
|
bool removeAnnotation(Annotation *annotation);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the page @p transition effect.
|
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
void setTransition(PageTransition *transition);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p link object for the given page @p action.
|
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
void setPageAction(PageAction action, Action *link);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Sets @p fields as list of FormField of the page.
|
|
|
|
*/
|
2022-03-21 23:59:42 +00:00
|
|
|
void setFormFields(const QList<FormField *> &fields);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
2013-02-24 21:58:53 +00:00
|
|
|
* Deletes the pixmap for the given @p observer
|
2006-11-23 19:25:52 +00:00
|
|
|
*/
|
2013-02-24 21:58:53 +00:00
|
|
|
void deletePixmap(DocumentObserver *observer);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Deletes all pixmaps of the page.
|
|
|
|
*/
|
2006-11-20 07:53:32 +00:00
|
|
|
void deletePixmaps();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Deletes all object rects of the page.
|
|
|
|
*/
|
2006-11-03 17:57:32 +00:00
|
|
|
void deleteRects();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Deletes all source reference objects of the page.
|
|
|
|
*/
|
2006-11-17 22:15:15 +00:00
|
|
|
void deleteSourceReferences();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* Deletes all annotations of the page.
|
|
|
|
*/
|
2005-02-18 18:24:45 +00:00
|
|
|
void deleteAnnotations();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-07-07 17:40:52 +00:00
|
|
|
/**
|
2013-02-24 21:58:53 +00:00
|
|
|
* Returns whether pixmaps for the tiled observer are handled by a
|
2012-11-08 20:29:09 +00:00
|
|
|
* tile manager.
|
2012-11-08 19:46:47 +00:00
|
|
|
*
|
2014-02-19 22:40:43 +00:00
|
|
|
* @since 0.19 (KDE 4.13)
|
2012-07-07 17:40:52 +00:00
|
|
|
*/
|
2014-02-19 22:40:43 +00:00
|
|
|
bool hasTilesManager(const DocumentObserver *observer) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-11-08 20:29:09 +00:00
|
|
|
/**
|
|
|
|
* Returns a list of all tiles intersecting with @p rect.
|
|
|
|
*
|
2012-11-12 14:55:13 +00:00
|
|
|
* The list contains only tiles with a pixmap
|
2012-11-08 20:29:09 +00:00
|
|
|
*
|
2014-02-19 22:40:43 +00:00
|
|
|
* @since 0.19 (KDE 4.13)
|
2012-11-08 20:29:09 +00:00
|
|
|
*/
|
2014-02-19 22:40:43 +00:00
|
|
|
QList<Tile> tilesAt(const DocumentObserver *observer, const NormalizedRect &rect) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2004-11-06 00:56:55 +00:00
|
|
|
private:
|
2017-10-26 07:47:18 +00:00
|
|
|
PagePrivate *d;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2007-03-24 00:18:54 +00:00
|
|
|
friend class PagePrivate;
|
2007-04-17 19:55:18 +00:00
|
|
|
friend class Document;
|
2007-04-14 19:58:17 +00:00
|
|
|
friend class DocumentPrivate;
|
2014-02-19 22:40:43 +00:00
|
|
|
friend class PixmapRequestPrivate;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
/**
|
|
|
|
* To improve performance PagePainter accesses the following
|
|
|
|
* member variables directly.
|
|
|
|
*/
|
|
|
|
friend class ::PagePainter;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2013-02-24 21:58:53 +00:00
|
|
|
const QPixmap *_o_nearestPixmap(DocumentObserver *, int, int) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2022-03-31 14:16:40 +00:00
|
|
|
QList<ObjectRect *> m_rects;
|
|
|
|
QList<HighlightAreaRect *> m_highlights;
|
|
|
|
QList<Annotation *> m_annotations;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-23 19:25:52 +00:00
|
|
|
Q_DISABLE_COPY(Page)
|
2004-09-08 12:41:14 +00:00
|
|
|
};
|
2004-10-02 14:30:30 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
#endif
|