• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
page.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 #ifndef _OKULAR_PAGE_H_
11 #define _OKULAR_PAGE_H_
12 
13 #include <QtCore/QLinkedList>
14 
15 #include "okular_export.h"
16 #include "area.h"
17 #include "global.h"
18 #include "textpage.h"
19 
20 class QPixmap;
21 
22 class PagePainter;
23 
24 namespace Okular {
25 
26 class Annotation;
27 class Document;
28 class DocumentObserver;
29 class DocumentPrivate;
30 class FormField;
31 class PagePrivate;
32 class PageTransition;
33 class SourceReference;
34 class TextSelection;
35 class Tile;
36 
49 class OKULAR_EXPORT Page
50 {
51  public:
55  enum PageAction
56  {
57  Opening,
58  Closing
59  };
60 
69  Page( uint number, double width, double height, Rotation orientation );
70 
74  ~Page();
75 
79  int number() const;
80 
84  Rotation orientation() const;
85 
89  Rotation rotation() const;
90 
95  Rotation totalOrientation() const;
96 
100  double width() const;
101 
105  double height() const;
106 
110  double ratio() const;
111 
120  NormalizedRect boundingBox() const;
121 
128  bool isBoundingBoxKnown() const;
129 
138  void setBoundingBox( const NormalizedRect& bbox );
139 
144  bool hasPixmap( DocumentObserver *observer, int width = -1, int height = -1, const NormalizedRect &rect = NormalizedRect() ) const;
145 
149  bool hasTextPage() const;
150 
155  bool hasObjectRect( double x, double y, double xScale, double yScale ) const;
156 
161  bool hasHighlights( int id = -1 ) const;
162 
166  bool hasTransition() const;
167 
171  bool hasAnnotations() const;
172 
185  RegularAreaRect* findText( int id, const QString & text, SearchDirection direction,
186  Qt::CaseSensitivity caseSensitivity, const RegularAreaRect * lastRect=0) const;
187 
192  QString text( const RegularAreaRect * rect = 0 ) const;
193 
199  QString text( const RegularAreaRect * rect, TextPage::TextAreaInclusionBehaviour b ) const;
200 
208  TextEntity::List words( const RegularAreaRect * rect, TextPage::TextAreaInclusionBehaviour b ) const;
209 
216  RegularAreaRect * wordAt( const NormalizedPoint &p, QString *word = 0 ) const;
217 
221  RegularAreaRect * textArea( TextSelection *selection ) const;
222 
226  const ObjectRect * objectRect( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale ) const;
227 
232  QLinkedList< const ObjectRect * > objectRects( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale ) const;
233 
239  const ObjectRect * nearestObjectRect( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double * distance ) const;
240 
245  const PageTransition * transition() const;
246 
250  QLinkedList< Annotation* > annotations() const;
251 
256  const Action * pageAction( PageAction action ) const;
257 
261  QLinkedList< FormField * > formFields() const;
262 
269  void setPixmap( DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect = NormalizedRect() );
270 
274  void setTextPage( TextPage * text );
275 
279  void setObjectRects( const QLinkedList< ObjectRect * > & rects );
280 
284  void setSourceReferences( const QLinkedList< SourceRefObjectRect * > & rects );
285 
291  void setDuration( double seconds );
292 
298  double duration() const;
299 
303  void setLabel( const QString& label );
304 
308  QString label() const;
309 
313  const RegularAreaRect * textSelection() const;
314 
319  QColor textSelectionColor() const;
320 
324  void addAnnotation( Annotation * annotation );
325 
329  bool removeAnnotation( Annotation * annotation );
330 
334  void setTransition( PageTransition * transition );
335 
339  void setPageAction( PageAction action, Action * link );
340 
344  void setFormFields( const QLinkedList< FormField * >& fields );
345 
349  void deletePixmap( DocumentObserver *observer );
350 
354  void deletePixmaps();
355 
359  void deleteRects();
360 
364  void deleteSourceReferences();
365 
369  void deleteAnnotations();
370 
377  bool hasTilesManager() const;
378 
386  QList<Tile> tilesAt( const NormalizedRect &rect ) const;
387 
388  private:
389  PagePrivate* const d;
391  friend class PagePrivate;
392  friend class Document;
393  friend class DocumentPrivate;
394 
399  friend class ::PagePainter;
401 
402  const QPixmap * _o_nearestPixmap( DocumentObserver *, int, int ) const;
403 
404  QLinkedList< ObjectRect* > m_rects;
405  QLinkedList< HighlightAreaRect* > m_highlights;
406  QLinkedList< Annotation* > m_annotations;
407 
408  Q_DISABLE_COPY( Page )
409 };
410 
411 }
412 
413 #endif
Okular::SearchDirection
SearchDirection
Describes the direction of searching.
Definition: global.h:33
Okular::NormalizedPoint
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
Okular::Rotation
Rotation
A rotation.
Definition: global.h:44
Okular::PagePrivate
Definition: page_p.h:55
Okular::TextPage
The TextPage class represents the text of a page by providing.
Definition: textpage.h:90
Okular::NormalizedRect
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
area.h
Okular::RegularAreaRect
Definition: area.h:860
global.h
okular_export.h
Okular::ObjectRect
NormalizedRect that contains a reference to an object.
Definition: area.h:337
Okular::Page::PageAction
PageAction
An action to be executed when particular events happen.
Definition: page.h:55
Okular::Document
The Document.
Definition: document.h:84
Okular::Page
Collector for all the data belonging to a page.
Definition: page.h:49
textpage.h
Okular::DocumentPrivate
Definition: document_p.h:83
Okular::Action
Encapsulates data that describes an action.
Definition: action.h:43
Okular::ObjectRect::ObjectType
ObjectType
Describes the type of storable object.
Definition: area.h:343
Okular::Page::Opening
An action to be executed when the page is "opened".
Definition: page.h:57
Okular::TextPage::TextAreaInclusionBehaviour
TextAreaInclusionBehaviour
Defines the behaviour of adding characters to text() result.
Definition: textpage.h:102
Okular::Annotation
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
Okular::DocumentObserver
Base class for objects being notified when something changes.
Definition: observer.h:28
OKULAR_EXPORT
#define OKULAR_EXPORT
Definition: okular_export.h:30
Okular::PageTransition
Information object for the transition effect of a page.
Definition: pagetransition.h:24
Okular::TextEntity::List
QList< TextEntity * > List
Definition: textpage.h:47
Okular::TextSelection
Wrapper around the information needed to generate the selection area There are two assumptions inside...
Definition: misc.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal