• 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
textpage.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Piotr Szymanski <niedakh@gmail.com> *
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_TEXTPAGE_H_
11 #define _OKULAR_TEXTPAGE_H_
12 
13 #include <QtCore/QList>
14 #include <QtCore/QString>
15 
16 #include "okular_export.h"
17 #include "global.h"
18 
19 class QTransform;
20 
21 namespace Okular {
22 
23 class NormalizedPoint;
24 class NormalizedRect;
25 class Page;
26 class PagePrivate;
27 class TextPagePrivate;
28 class TextSelection;
29 class RegularAreaRect;
30 
44 class OKULAR_EXPORT TextEntity
45 {
46  public:
47  typedef QList<TextEntity*> List;
48 
53  TextEntity( const QString &text, NormalizedRect *area );
54 
58  ~TextEntity();
59 
63  QString text() const;
64 
68  NormalizedRect* area() const;
69 
73  NormalizedRect transformedArea(const QTransform &matrix) const;
74 
75  private:
76  QString m_text;
77  NormalizedRect* m_area;
78 
79  class Private;
80  const Private *d;
81 
82  Q_DISABLE_COPY( TextEntity )
83 };
84 
90 class OKULAR_EXPORT TextPage
91 {
93  friend class Page;
94  friend class PagePrivate;
96 
97  public:
102  enum TextAreaInclusionBehaviour
103  {
104  AnyPixelTextAreaInclusionBehaviour,
105  CentralPixelTextAreaInclusionBehaviour
106  };
107 
111  TextPage();
112 
116  TextPage( const TextEntity::List &words );
117 
121  ~TextPage();
122 
127  void append( const QString &text, NormalizedRect *area );
128 
141  RegularAreaRect* findText( int id, const QString &text, SearchDirection direction,
142  Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect );
143 
153  QString text( const RegularAreaRect *rect = 0 ) const;
154 
164  QString text( const RegularAreaRect * rect, TextAreaInclusionBehaviour b ) const;
165 
173  TextEntity::List words( const RegularAreaRect * rect, TextAreaInclusionBehaviour b ) const;
174 
180  RegularAreaRect * wordAt( const NormalizedPoint &p, QString *word = 0 ) const;
181 
185  RegularAreaRect *textArea( TextSelection *selection ) const;
186 
187  private:
188  TextPagePrivate* const d;
189 
190  Q_DISABLE_COPY( TextPage )
191 };
192 
193 }
194 
195 #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::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
Okular::RegularAreaRect
Definition: area.h:860
global.h
okular_export.h
Okular::TextEntity
Abstract textentity of Okular.
Definition: textpage.h:44
Okular::Page
Collector for all the data belonging to a page.
Definition: page.h:49
Okular::TextPage::AnyPixelTextAreaInclusionBehaviour
A character is included into text() result if any pixel of his bounding box is in the given area...
Definition: textpage.h:104
Okular::TextPage::TextAreaInclusionBehaviour
TextAreaInclusionBehaviour
Defines the behaviour of adding characters to text() result.
Definition: textpage.h:102
Okular::TextPagePrivate
Definition: textpage_p.h:40
OKULAR_EXPORT
#define OKULAR_EXPORT
Definition: okular_export.h:30
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:03 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