Okular::ObjectRect

Search for usage in LXR

#include <area.h>

Inheritance diagram for Okular::ObjectRect:

Public Types

enum  ObjectType { Action, Image, OAnnotation, SourceRef }
 

Public Member Functions

 ObjectRect (double left, double top, double right, double bottom, bool ellipse, ObjectType type, void *object)
 
 ObjectRect (const NormalizedRect &r, bool ellipse, ObjectType type, void *object)
 
 ObjectRect (const QPolygonF &poly, ObjectType type, void *object)
 
 ObjectRect (const ObjectRect &o)=delete
 
virtual ~ObjectRect ()
 
virtual QRect boundingRect (double xScale, double yScale) const
 
virtual bool contains (double x, double y, double xScale, double yScale) const
 
double distanceSqr (double x, double y, double xScale, double yScale) const
 
const void * object () const
 
ObjectType objectType () const
 
ObjectRectoperator= (const ObjectRect &o)=delete
 
const QPainterPathregion () const
 
virtual void transform (const QTransform &matrix)
 

Protected Attributes

void * m_object
 
ObjectType m_objectType
 
QPainterPath m_path
 
QPainterPath m_transformedPath
 

Detailed Description

An area with normalized coordinates that contains a reference to an object.

These areas ("rects") contain a pointer to a document object (such as a hyperlink, an action, or something like that). The pointer is read and stored as 'void pointer' so cast is performed by accessors based on the value returned by objectType(). Objects are reparented to this class.

Type / Class correspondence tab:

  • Action : class Action: description of an action
  • Image : class Image : description of an image (n/a)
  • Annotation: class Annotation: description of an annotation

For more information about the normalized coordinate system, see NormalizedPoint.

See also
NormalizedPoint

Definition at line 452 of file area.h.

Member Enumeration Documentation

Describes the type of storable object.

Enumerator
Action 

An action.

Image 

An image.

OAnnotation 

An annotation.

SourceRef 

A source reference.

Definition at line 458 of file area.h.

Constructor & Destructor Documentation

ObjectRect::ObjectRect ( double  left,
double  top,
double  right,
double  bottom,
bool  ellipse,
ObjectType  type,
void *  object 
)

Creates a new object rectangle.

class ObjectRect

Parameters
leftThe left coordinate of the rectangle.
topThe top coordinate of the rectangle.
rightThe right coordinate of the rectangle.
bottomThe bottom coordinate of the rectangle.
ellipseIf true the rectangle describes an ellipse.
typeThe type of the storable object
See also
ObjectType.
Parameters
objectThe pointer to the storable object.

Definition at line 309 of file area.cpp.

ObjectRect::ObjectRect ( const NormalizedRect r,
bool  ellipse,
ObjectType  type,
void *  object 
)

This is an overloaded member function, provided for convenience.

Definition at line 323 of file area.cpp.

ObjectRect::ObjectRect ( const QPolygonF poly,
ObjectType  type,
void *  object 
)

This is an overloaded member function, provided for convenience.

Definition at line 336 of file area.cpp.

ObjectRect::~ObjectRect ( )
virtual

Destroys the object rectangle.

Definition at line 403 of file area.cpp.

Member Function Documentation

QRect ObjectRect::boundingRect ( double  xScale,
double  yScale 
) const
virtual

Returns the bounding rect of the object rectangle for the scaling factor xScale and yScale.

Reimplemented in Okular::SourceRefObjectRect, and Okular::AnnotationObjectRect.

Definition at line 360 of file area.cpp.

bool ObjectRect::contains ( double  x,
double  y,
double  xScale,
double  yScale 
) const
virtual

Returns whether the object rectangle contains the point with absolute coordinates (x, y) at a page size of xScale x yScale.

Reimplemented in Okular::SourceRefObjectRect, and Okular::AnnotationObjectRect.

Definition at line 367 of file area.cpp.

double ObjectRect::distanceSqr ( double  x,
double  y,
double  xScale,
double  yScale 
) const

Returns the squared distance between the object and the point with normalized coordinates (x, y) at a page size of xScale x yScale.

Since
0.8.2 (KDE 4.2.2)

Definition at line 377 of file area.cpp.

const void * ObjectRect::object ( ) const

Returns the storable object of the object rectangle.

Definition at line 350 of file area.cpp.

ObjectRect::ObjectType ObjectRect::objectType ( ) const

Returns the object type of the object rectangle.

See also
ObjectType

Definition at line 345 of file area.cpp.

const QPainterPath & ObjectRect::region ( ) const

Returns the region that is covered by the object rectangle.

Definition at line 355 of file area.cpp.

void ObjectRect::transform ( const QTransform matrix)
virtual

Transforms the object rectangle with the operations defined by matrix.

Reimplemented in Okular::AnnotationObjectRect.

Definition at line 372 of file area.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Jun 18 2021 22:35:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.