1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
13 #include <qabstractitemmodel.h>
17 class DocumentSynopsis
;
18 class DocumentViewport
;
21 class TOCModelPrivate
;
23 class TOCModel
: public QAbstractItemModel
28 TOCModel( Okular::Document
*document
, QObject
*parent
= 0 );
31 // reimplementations from QAbstractItemModel
32 virtual int columnCount( const QModelIndex
&parent
= QModelIndex() ) const;
33 virtual QVariant
data( const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
34 virtual bool hasChildren( const QModelIndex
&parent
= QModelIndex() ) const;
35 virtual QVariant
headerData( int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
36 virtual QModelIndex
index( int row
, int column
, const QModelIndex
&parent
= QModelIndex() ) const;
37 virtual QModelIndex
parent( const QModelIndex
&index
) const;
38 virtual int rowCount( const QModelIndex
&parent
= QModelIndex() ) const;
40 void fill( const Okular::DocumentSynopsis
*toc
);
42 void setCurrentViewport( const Okular::DocumentViewport
&viewport
);
46 QString
externalFileNameForIndex( const QModelIndex
&index
) const;
47 Okular::DocumentViewport
viewportForIndex( const QModelIndex
&index
) const;
51 friend class TOCModelPrivate
;
52 TOCModelPrivate
*const d
;