SVN_SILENT made messages (.desktop file)
[kdegraphics.git] / okular / ui / annotationmodel.h
blobfd02fdec60d7b5aafbd1c088760394beed23e451
1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
3 * *
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>
15 namespace Okular {
16 class Annotation;
17 class Document;
20 class AnnotationModelPrivate;
22 class AnnotationModel : public QAbstractItemModel
24 Q_OBJECT
26 public:
27 enum {
28 AuthorRole = Qt::UserRole + 1000,
29 PageRole
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;
47 private:
48 // storage
49 friend class AnnotationModelPrivate;
50 AnnotationModelPrivate *const d;
55 #endif