2004-09-21 20:38:22 +00:00
|
|
|
/***************************************************************************
|
2013-03-14 22:09:07 +00:00
|
|
|
* Copyright (C) 2004-2006 by Albert Astals Cid <aacid@kde.org> *
|
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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_TOC_H_
|
|
|
|
#define _OKULAR_TOC_H_
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2006-05-28 17:27:24 +00:00
|
|
|
#include <qwidget.h>
|
2005-01-02 14:55:14 +00:00
|
|
|
#include "core/observer.h"
|
2017-03-23 00:22:08 +00:00
|
|
|
#include "core/document.h"
|
2013-01-09 22:31:23 +00:00
|
|
|
#include <QModelIndex>
|
2004-09-23 21:33:53 +00:00
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularpart_export.h"
|
2013-01-19 14:05:39 +00:00
|
|
|
|
2006-12-22 19:26:28 +00:00
|
|
|
class QDomNode;
|
2007-09-09 16:15:33 +00:00
|
|
|
class QModelIndex;
|
|
|
|
class QTreeView;
|
|
|
|
class KTreeViewSearchLine;
|
|
|
|
class TOCModel;
|
2005-01-02 15:18:50 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular {
|
|
|
|
class Document;
|
2013-01-19 14:05:39 +00:00
|
|
|
class PartTest;
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARPART_EXPORT TOC : public QWidget, public Okular::DocumentObserver
|
2004-09-21 20:38:22 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-01-19 14:05:39 +00:00
|
|
|
friend class Okular::PartTest;
|
|
|
|
|
2004-12-11 17:25:03 +00:00
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
TOC(QWidget *parent, Okular::Document *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
|
2017-03-02 19:39:24 +00:00
|
|
|
void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags ) override;
|
|
|
|
void notifyCurrentPageChanged( int previous, int current ) override;
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2006-12-22 20:42:36 +00:00
|
|
|
void reparseConfig();
|
|
|
|
|
2013-01-09 22:31:23 +00:00
|
|
|
void prepareForReload();
|
2013-01-18 17:02:07 +00:00
|
|
|
void rollbackReload();
|
|
|
|
void finishReload();
|
2013-01-09 22:31:23 +00:00
|
|
|
|
2016-07-11 17:30:31 +00:00
|
|
|
Q_SIGNALS:
|
2004-12-11 17:25:03 +00:00
|
|
|
void hasTOC(bool has);
|
2017-03-23 00:22:08 +00:00
|
|
|
void rightClick( const Okular::DocumentViewport &, const QPoint &, const QString & );
|
2004-09-23 21:33:53 +00:00
|
|
|
|
2016-07-11 17:30:31 +00:00
|
|
|
private Q_SLOTS:
|
2007-09-09 16:15:33 +00:00
|
|
|
void slotExecuted( const QModelIndex & );
|
2009-11-19 17:26:41 +00:00
|
|
|
void saveSearchOptions();
|
2004-09-21 20:38:22 +00:00
|
|
|
|
2017-03-23 00:22:08 +00:00
|
|
|
protected:
|
|
|
|
void contextMenuEvent( QContextMenuEvent * e ) override;
|
|
|
|
|
2004-12-11 17:25:03 +00:00
|
|
|
private:
|
2013-01-09 22:31:23 +00:00
|
|
|
QVector<QModelIndex> expandedNodes( const QModelIndex & parent=QModelIndex() ) const;
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::Document *m_document;
|
2007-09-09 16:15:33 +00:00
|
|
|
QTreeView *m_treeView;
|
|
|
|
KTreeViewSearchLine *m_searchLine;
|
|
|
|
TOCModel *m_model;
|
2004-09-21 20:38:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|