2004-09-08 12:41:14 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _KPDF_PAGE_H_
|
|
|
|
#define _KPDF_PAGE_H_
|
|
|
|
|
2004-09-10 17:44:05 +00:00
|
|
|
class QPainter;
|
2004-09-15 20:45:00 +00:00
|
|
|
class QPixmap;
|
2004-09-10 17:44:05 +00:00
|
|
|
//class QString;
|
|
|
|
//class QRect;
|
2004-09-08 12:41:14 +00:00
|
|
|
class TextOutputDev;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short Collector for all the data belonging to a page.
|
|
|
|
*
|
2004-09-15 20:45:00 +00:00
|
|
|
* The KPDFPage class contains pixmaps (referenced using obsedvers id as key),
|
|
|
|
* a search page (a class used internally for searching data), link classes
|
|
|
|
* (that describe links in the current page) plus graphics overlays and more.
|
|
|
|
*
|
|
|
|
* Note: All objects passed to this class will be destoryed on class deletion.
|
2004-09-08 12:41:14 +00:00
|
|
|
*/
|
|
|
|
|
2004-09-15 20:45:00 +00:00
|
|
|
// ### HACK : this structure is under big changes ###
|
2004-09-10 17:44:05 +00:00
|
|
|
class KPDFPage
|
2004-09-08 12:41:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2004-09-15 20:45:00 +00:00
|
|
|
KPDFPage( int number, float width, float height, int rotation );
|
2004-09-08 12:41:14 +00:00
|
|
|
~KPDFPage();
|
|
|
|
|
2004-09-10 17:44:05 +00:00
|
|
|
// query properties (const read-only methods)
|
2004-09-08 12:41:14 +00:00
|
|
|
uint number() const { return m_number; }
|
|
|
|
float width() const { return m_width; }
|
|
|
|
float height() const { return m_height; }
|
|
|
|
float ratio() const { return m_height / m_width; }
|
2004-09-15 20:45:00 +00:00
|
|
|
float rotation() const { return m_rotation; }
|
|
|
|
bool hasPixmap( int id, int width, int height ) const;
|
2004-09-11 15:59:32 +00:00
|
|
|
bool hasLink( int mouseX, int mouseY ) const;
|
2004-09-15 20:45:00 +00:00
|
|
|
void drawPixmap( int id, QPainter * p, const QRect & rect, int width, int height ) const;
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2004-09-15 20:45:00 +00:00
|
|
|
// page contents setup *NOTE changes in progress*
|
|
|
|
void setPixmap( int id, QPixmap * pixmap );
|
2004-09-11 15:59:32 +00:00
|
|
|
/*void setTextPage( TextOutputDev * );*/
|
2004-09-13 17:30:19 +00:00
|
|
|
/*void setLinks( ..SomeStruct.. ); or (better): */
|
2004-09-15 20:45:00 +00:00
|
|
|
/*void setPixmapOverlaySelection( const QRect & normalizedRect );*/
|
|
|
|
/*void setPixmapOverlayNotations( ..DOMdescription.. );*/
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2004-09-10 17:44:05 +00:00
|
|
|
// FIND command
|
|
|
|
//bool hasText( QString & text );
|
|
|
|
//const QRect & textPosition();
|
2004-09-08 12:41:14 +00:00
|
|
|
|
|
|
|
private:
|
2004-09-15 20:45:00 +00:00
|
|
|
int m_number, m_rotation;
|
2004-09-08 12:41:14 +00:00
|
|
|
float m_width, m_height;
|
2004-09-15 20:45:00 +00:00
|
|
|
|
|
|
|
QMap<int,QPixmap *> m_pixmaps;
|
2004-09-08 12:41:14 +00:00
|
|
|
TextOutputDev * m_text;
|
|
|
|
};
|
2004-09-15 20:45:00 +00:00
|
|
|
/*
|
|
|
|
class KPDFLink
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum LinkType { Goto, Execute, Action, URI, Movie };
|
|
|
|
|
|
|
|
KPDFLink( LinkType type ) : m_type( type ) {};
|
2004-09-08 12:41:14 +00:00
|
|
|
|
2004-09-15 20:45:00 +00:00
|
|
|
void setType( LinkType type ) { m_type = type; }
|
|
|
|
LinkType type() { return m_type; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
LinkType m_type;
|
|
|
|
float x_min, x_max, y_min, y_max;
|
|
|
|
// [Goto] type
|
|
|
|
|
|
|
|
// []
|
|
|
|
};
|
|
|
|
*/
|
2004-09-08 12:41:14 +00:00
|
|
|
#endif
|