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 (const NormalizedRect &r, bool ellipse, ObjectType type, void *object)
 
 ObjectRect (const ObjectRect &o)=delete
 
 ObjectRect (const QPolygonF &poly, ObjectType type, void *object)
 
 ObjectRect (double left, double top, double right, double bottom, bool ellipse, ObjectType type, void *object)
 
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 457 of file area.h.

Member Enumeration Documentation

◆ ObjectType

Describes the type of storable object.

Enumerator
Action 

An action.

Image 

An image.

OAnnotation 

An annotation.

SourceRef 

A source reference.

Definition at line 463 of file area.h.

Constructor & Destructor Documentation

◆ ObjectRect() [1/3]

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 314 of file area.cpp.

◆ ObjectRect() [2/3]

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

This is an overloaded member function, provided for convenience.

Definition at line 329 of file area.cpp.

◆ ObjectRect() [3/3]

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

This is an overloaded member function, provided for convenience.

Definition at line 343 of file area.cpp.

◆ ~ObjectRect()

ObjectRect::~ObjectRect ( )
virtual

Destroys the object rectangle.

Definition at line 410 of file area.cpp.

Member Function Documentation

◆ boundingRect()

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::AnnotationObjectRect, and Okular::SourceRefObjectRect.

Definition at line 367 of file area.cpp.

◆ contains()

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::AnnotationObjectRect, and Okular::SourceRefObjectRect.

Definition at line 374 of file area.cpp.

◆ distanceSqr()

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 384 of file area.cpp.

◆ object()

const void * ObjectRect::object ( ) const

Returns the storable object of the object rectangle.

Definition at line 357 of file area.cpp.

◆ objectType()

ObjectRect::ObjectType ObjectRect::objectType ( ) const

Returns the object type of the object rectangle.

See also
ObjectType

Definition at line 352 of file area.cpp.

◆ region()

const QPainterPath & ObjectRect::region ( ) const

Returns the region that is covered by the object rectangle.

Definition at line 362 of file area.cpp.

◆ transform()

void ObjectRect::transform ( const QTransform & matrix)
virtual

Transforms the object rectangle with the operations defined by matrix.

Reimplemented in Okular::AnnotationObjectRect.

Definition at line 379 of file area.cpp.

Member Data Documentation

◆ m_object

void* Okular::ObjectRect::m_object
protected

Definition at line 547 of file area.h.

◆ m_objectType

ObjectType Okular::ObjectRect::m_objectType
protected

Definition at line 546 of file area.h.

◆ m_path

QPainterPath Okular::ObjectRect::m_path
protected

Definition at line 548 of file area.h.

◆ m_transformedPath

QPainterPath Okular::ObjectRect::m_transformedPath
protected

Definition at line 549 of file area.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.