1 /***************************************************************************
2 * Copyright (C) 2006 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 ***************************************************************************/
10 #ifndef ANNOTATIONMODEL_H
11 #define ANNOTATIONMODEL_H
13 #include <qabstractitemmodel.h>
20 class AnnotationModelPrivate
;
22 class AnnotationModel
: public QAbstractItemModel
28 AuthorRole
= Qt::UserRole
+ 1000,
32 AnnotationModel( Okular::Document
*document
, QObject
*parent
= 0 );
33 virtual ~AnnotationModel();
35 // reimplementations from QAbstractItemModel
36 virtual int columnCount( const QModelIndex
&parent
= QModelIndex() ) const;
37 virtual QVariant
data( const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
38 virtual bool hasChildren( const QModelIndex
&parent
= QModelIndex() ) const;
39 virtual QVariant
headerData( int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
40 virtual QModelIndex
index( int row
, int column
, const QModelIndex
&parent
= QModelIndex() ) const;
41 virtual QModelIndex
parent( const QModelIndex
&index
) const;
42 virtual int rowCount( const QModelIndex
&parent
= QModelIndex() ) const;
44 bool isAnnotation( const QModelIndex
&index
) const;
45 Okular::Annotation
* annotationForIndex( const QModelIndex
&index
) const;
49 friend class AnnotationModelPrivate
;
50 AnnotationModelPrivate
*const d
;