2004-08-26 21:17:24 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
|
|
|
|
* Copyright (C) 2003-2004 by Christophe Devriese *
|
|
|
|
* <Christophe.Devriese@student.kuleuven.ac.be> *
|
|
|
|
* Copyright (C) 2003 by Andy Goossens <andygoossens@telenet.be> *
|
|
|
|
* Copyright (C) 2003 by Laurent Montel <montel@kde.org> *
|
|
|
|
* Copyright (C) 2004 by Dominique Devriese <devriese@kde.org> *
|
|
|
|
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
#ifndef _KPDF_PART_H_
|
|
|
|
#define _KPDF_PART_H_
|
|
|
|
|
2002-09-02 21:56:00 +00:00
|
|
|
#include <kparts/browserextension.h>
|
2002-08-30 09:14:01 +00:00
|
|
|
#include <kparts/part.h>
|
|
|
|
|
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
class KAboutData;
|
|
|
|
class KAction;
|
2004-09-07 22:35:33 +00:00
|
|
|
class KPrinter;
|
2002-08-30 09:14:01 +00:00
|
|
|
class KURL;
|
|
|
|
class KToggleAction;
|
2003-09-15 21:57:19 +00:00
|
|
|
class KSelectAction;
|
2002-08-30 09:14:01 +00:00
|
|
|
|
|
|
|
class LinkAction;
|
|
|
|
class LinkDest;
|
|
|
|
class XOutputDev;
|
|
|
|
|
2004-09-07 22:35:33 +00:00
|
|
|
class ThumbnailList;
|
2003-06-28 01:59:03 +00:00
|
|
|
class PDFPartView;
|
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
class KPDFDocument;
|
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
namespace KPDF
|
|
|
|
{
|
2002-09-02 21:56:00 +00:00
|
|
|
class BrowserExtension;
|
2002-08-30 09:14:01 +00:00
|
|
|
class PageWidget;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a "Part". It that does all the real work in a KPart
|
|
|
|
* application.
|
|
|
|
*
|
|
|
|
* @short Main Part
|
|
|
|
* @author Wilco Greven <greven@kde.org>
|
2004-09-08 12:41:14 +00:00
|
|
|
* @version 0.2
|
2002-08-30 09:14:01 +00:00
|
|
|
*/
|
|
|
|
class Part : public KParts::ReadOnlyPart
|
|
|
|
{
|
2004-09-08 12:41:14 +00:00
|
|
|
Q_OBJECT
|
2002-08-30 09:14:01 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
/**
|
|
|
|
* Default constructor
|
|
|
|
*/
|
|
|
|
Part(QWidget* parentWidget, const char* widgetName,
|
|
|
|
QObject* parent, const char* name, const QStringList& args);
|
2002-08-30 09:14:01 +00:00
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
virtual ~Part();
|
2002-08-30 12:10:02 +00:00
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
static KAboutData* createAboutData();
|
2004-01-02 17:46:06 +00:00
|
|
|
|
2004-09-08 12:41:14 +00:00
|
|
|
// reimplemented from KParts::ReadOnlyPart
|
|
|
|
bool closeURL();
|
|
|
|
void displayPage(int pageNumber ); //TODO REMOVE ME!
|
2004-01-02 17:46:06 +00:00
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
protected:
|
2004-09-08 12:41:14 +00:00
|
|
|
// reimplemented from KParts::ReadOnlyPart
|
|
|
|
virtual bool openFile();
|
|
|
|
|
|
|
|
void readSettings();
|
|
|
|
void writeSettings();
|
|
|
|
void updateAction();
|
|
|
|
void doPrint( KPrinter& printer );
|
2003-09-15 09:35:55 +00:00
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
protected slots:
|
2004-09-08 12:41:14 +00:00
|
|
|
// connected to actions
|
|
|
|
void slotGoToPage();
|
|
|
|
void slotPreviousPage();
|
|
|
|
void slotNextPage();
|
|
|
|
void slotGotoStart();
|
|
|
|
void slotGotoEnd();
|
|
|
|
void slotFind();
|
|
|
|
void slotFindNext();
|
|
|
|
void slotZoom( const QString& );
|
|
|
|
void slotZoomIn();
|
|
|
|
void slotZoomOut();
|
|
|
|
void slotFitToWidthToggled( bool );
|
|
|
|
void slotPrintPreview();
|
|
|
|
void slotToggleScrollBars( bool );
|
|
|
|
void slotToggleThumbnails( bool );
|
|
|
|
void slotSaveFileAs();
|
|
|
|
// can be connected do widget elements
|
|
|
|
void updateActions();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
// connected to Shell action (and browserExtension), not local one
|
|
|
|
void slotPrint();
|
2003-09-15 21:57:19 +00:00
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
private:
|
2004-09-08 12:41:14 +00:00
|
|
|
// the document
|
|
|
|
KPDFDocument * document;
|
|
|
|
|
|
|
|
// main widgets
|
|
|
|
ThumbnailList *m_thumbnailList;
|
|
|
|
PageWidget *m_pageWidget;
|
|
|
|
|
|
|
|
// static instances counter
|
|
|
|
static unsigned int m_count;
|
|
|
|
|
|
|
|
// actions
|
|
|
|
KAction *m_gotoPage;
|
|
|
|
KAction *m_prevPage;
|
|
|
|
KAction *m_nextPage;
|
|
|
|
KAction *m_firstPage;
|
|
|
|
KAction *m_lastPage;
|
|
|
|
KToggleAction *m_showScrollBars;
|
|
|
|
KToggleAction *m_showPageList;
|
|
|
|
KSelectAction *m_zoomTo;
|
|
|
|
KToggleAction *m_fitToWidth;
|
|
|
|
KAction *m_find;
|
|
|
|
KAction *m_findNext;
|
2002-08-30 09:14:01 +00:00
|
|
|
};
|
2002-09-02 21:56:00 +00:00
|
|
|
|
|
|
|
class BrowserExtension : public KParts::BrowserExtension
|
|
|
|
{
|
2004-09-08 12:41:14 +00:00
|
|
|
Q_OBJECT
|
2003-09-14 14:22:37 +00:00
|
|
|
|
2002-09-02 21:56:00 +00:00
|
|
|
public:
|
2004-09-08 12:41:14 +00:00
|
|
|
BrowserExtension(Part*);
|
2002-09-02 21:56:00 +00:00
|
|
|
|
|
|
|
public slots:
|
2004-09-08 12:41:14 +00:00
|
|
|
// Automatically detected by the host.
|
|
|
|
void print();
|
2002-09-02 21:56:00 +00:00
|
|
|
};
|
2003-09-14 14:22:37 +00:00
|
|
|
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// vim:ts=2:sw=2:tw=78:et
|