2004-09-21 20:38:22 +00:00
|
|
|
/***************************************************************************
|
2006-02-18 12:06:52 +00:00
|
|
|
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
|
2004-09-21 20:38:22 +00:00
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2005-01-02 14:55:14 +00:00
|
|
|
#ifndef _KPDF_TOC_H_
|
|
|
|
#define _KPDF_TOC_H_
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2005-01-02 15:18:50 +00:00
|
|
|
#include <qdom.h>
|
2006-05-28 17:27:24 +00:00
|
|
|
#include <qwidget.h>
|
2005-11-04 11:59:51 +00:00
|
|
|
#include "core/document.h"
|
2005-01-02 14:55:14 +00:00
|
|
|
#include "core/observer.h"
|
2004-09-23 21:33:53 +00:00
|
|
|
|
2006-05-28 17:27:24 +00:00
|
|
|
class QTreeWidget;
|
2006-06-13 08:44:08 +00:00
|
|
|
class QTreeWidgetItem;
|
2006-05-28 17:27:24 +00:00
|
|
|
class KTreeWidgetSearchLine;
|
2005-01-02 15:18:50 +00:00
|
|
|
class KPDFDocument;
|
2006-06-20 13:59:08 +00:00
|
|
|
class TOCItem;
|
2005-01-02 15:18:50 +00:00
|
|
|
|
2006-05-28 17:27:24 +00:00
|
|
|
class TOC : public QWidget, public DocumentObserver
|
2004-09-21 20:38:22 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2004-12-11 17:25:03 +00:00
|
|
|
public:
|
|
|
|
TOC(QWidget *parent, KPDFDocument *document);
|
2006-02-18 12:06:52 +00:00
|
|
|
~TOC();
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2005-01-09 23:37:07 +00:00
|
|
|
// inherited from DocumentObserver
|
2004-12-11 17:25:03 +00:00
|
|
|
uint observerId() const;
|
2006-03-23 20:43:38 +00:00
|
|
|
void notifySetup( const QVector< KPDFPage * > & pages, bool documentChanged );
|
2006-06-20 13:59:08 +00:00
|
|
|
void notifyViewportChanged( bool smoothMove );
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2004-12-11 17:25:03 +00:00
|
|
|
signals:
|
|
|
|
void hasTOC(bool has);
|
2004-09-23 21:33:53 +00:00
|
|
|
|
2004-12-11 17:25:03 +00:00
|
|
|
private slots:
|
2006-05-19 11:32:08 +00:00
|
|
|
void slotExecuted(QTreeWidgetItem *i);
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2004-12-11 17:25:03 +00:00
|
|
|
private:
|
2006-05-19 11:32:08 +00:00
|
|
|
void addChildren( const QDomNode & parentNode, QTreeWidgetItem * parentItem = 0 );
|
2005-11-04 11:59:51 +00:00
|
|
|
DocumentViewport getViewport( const QDomElement &e ) const;
|
2004-12-11 17:25:03 +00:00
|
|
|
KPDFDocument *m_document;
|
2006-05-28 17:27:24 +00:00
|
|
|
QTreeWidget *m_treeView;
|
|
|
|
KTreeWidgetSearchLine *m_searchLine;
|
2006-06-20 13:59:08 +00:00
|
|
|
TOCItem *m_current;
|
|
|
|
int m_currentPage;
|
2004-09-21 20:38:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|