1 #ifndef _ENTRIES_WINDOW_H
2 #define _ENTRIES_WINDOW_H
6 #include <QStyledItemDelegate>
7 #include "googlereader.h"
9 class EntriesWindow : public QMainWindow {
13 EntriesWindow(QWidget *parent = 0, Feed *f = 0);
14 virtual ~EntriesWindow();
19 void entriesUpdated();
20 void entrySelected(const QModelIndex &);
25 QAction *show_updated;
29 class EntryListModel : public QAbstractListModel {
33 EntryListModel(QObject *parent = 0, QList<Entry *>list = QList<Entry *>(), bool updated = false)
34 : QAbstractListModel(parent) {
36 show_updated = updated;
39 int rowCount(const QModelIndex &model = QModelIndex()) const;
41 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
44 void showUpdated(bool);
47 QList<Entry *> entry_list;
51 class EntryListDelegate : public QStyledItemDelegate {
55 EntryListDelegate(QObject *parent = 0)
56 : QStyledItemDelegate(parent) {};
58 void paint(QPainter *painter, const QStyleOptionViewItem &option,
59 const QModelIndex &index) const;