rssguard/src/core/feedsmodelrootitem.h

44 lines
1.1 KiB
C
Raw Normal View History

2013-12-11 14:07:18 +01:00
#ifndef FEEDMODELROOTITEM_H
#define FEEDMODELROOTITEM_H
2013-12-12 08:27:05 +01:00
#include <QIcon>
2013-12-11 14:07:18 +01:00
// Represents ROOT item of FeedsModel.
// NOTE: This class is derived to add functionality for
2013-12-12 08:27:05 +01:00
// all other non-root items of FeedsModel.
class FeedsModelRootItem {
2013-12-14 11:45:43 +01:00
friend class FeedsModel;
2013-12-11 14:07:18 +01:00
public:
// Constructors and destructors.
2013-12-12 15:07:17 +01:00
explicit FeedsModelRootItem(FeedsModelRootItem *parent_item = NULL);
2013-12-11 14:07:18 +01:00
virtual ~FeedsModelRootItem();
2013-12-12 15:07:17 +01:00
virtual void setParent(FeedsModelRootItem *parent_item);
2013-12-12 08:27:05 +01:00
virtual FeedsModelRootItem *parent();
virtual FeedsModelRootItem *child(int row);
2013-12-12 10:10:17 +01:00
virtual void appendChild(FeedsModelRootItem *child);
2013-12-12 08:27:05 +01:00
virtual int childCount() const;
virtual int columnCount() const;
virtual int row() const;
virtual QVariant data(int column, int role) const;
2013-12-11 14:07:18 +01:00
2013-12-12 22:28:51 +01:00
virtual int countOfUnreadMessages() const;
virtual int countOfAllMessages() const;
2013-12-13 16:35:52 +01:00
void setIcon(const QIcon &icon);
2013-12-13 20:48:45 +01:00
int id() const;
void setId(int id);
2013-12-11 14:07:18 +01:00
protected:
2013-12-13 20:48:45 +01:00
int m_id;
2013-12-12 08:27:05 +01:00
QIcon m_icon;
QList<FeedsModelRootItem*> m_childItems;
2013-12-12 10:10:17 +01:00
FeedsModelRootItem *m_parentItem;
2013-12-11 14:07:18 +01:00
};
#endif // FEEDMODELROOTITEM_H