Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/vcs/models/vcsannotationmodel.h
Show All 29 Lines | |||||
30 | 30 | | |||
31 | class QUrl; | 31 | class QUrl; | ||
32 | template<typename T> class QList; | 32 | template<typename T> class QList; | ||
33 | 33 | | |||
34 | namespace KDevelop | 34 | namespace KDevelop | ||
35 | { | 35 | { | ||
36 | 36 | | |||
37 | class VcsJob; | 37 | class VcsJob; | ||
38 | class VcsAnnotationLine; | ||||
38 | 39 | | |||
39 | class KDEVPLATFORMVCS_EXPORT VcsAnnotationModel : public KTextEditor::AnnotationModel | 40 | class KDEVPLATFORMVCS_EXPORT VcsAnnotationModel : public KTextEditor::AnnotationModel | ||
40 | { | 41 | { | ||
41 | Q_OBJECT | 42 | Q_OBJECT | ||
42 | public: | 43 | public: | ||
43 | VcsAnnotationModel( VcsJob* job, const QUrl&, QObject*, | 44 | VcsAnnotationModel( VcsJob* job, const QUrl&, QObject*, | ||
44 | const QColor& foreground = QColor(Qt::black), const QColor& background = QColor(Qt::white) ); | 45 | const QColor& foreground = QColor(Qt::black), const QColor& background = QColor(Qt::white) ); | ||
45 | ~VcsAnnotationModel() override; | 46 | ~VcsAnnotationModel() override; | ||
46 | 47 | | |||
47 | VcsRevision revisionForLine(int line) const; | 48 | VcsRevision revisionForLine(int line) const; | ||
48 | 49 | | |||
49 | QVariant data( int line, Qt::ItemDataRole role = Qt::DisplayRole ) const override; | 50 | QVariant data( int line, Qt::ItemDataRole role = Qt::DisplayRole ) const override; | ||
50 | 51 | | |||
52 | // given "role" argument is of type Qt::ItemDataRole and not int, we cannot use custom roles | ||||
53 | // to access custom data, so providing a custom API instead | ||||
54 | VcsAnnotationLine annotationLine(int line) const; | ||||
55 | | ||||
51 | private: | 56 | private: | ||
52 | const QScopedPointer<class VcsAnnotationModelPrivate> d; | 57 | const QScopedPointer<class VcsAnnotationModelPrivate> d; | ||
53 | friend class VcsAnnotationModelPrivate; | 58 | friend class VcsAnnotationModelPrivate; | ||
54 | }; | 59 | }; | ||
55 | 60 | | |||
56 | } | 61 | } | ||
57 | 62 | | |||
58 | #endif | 63 | #endif |