/****************************************************************************
**
** Copyright (C) 2012 Róbert Márki
**
** This file is part of Web Feeds.
**
** Web Feeds is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Web Feeds is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Web Feeds.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

#ifndef FOLDERITEM_H
#define FOLDERITEM_H
#include "newsbluritem.h"

namespace NewsBlur
{
class FolderItem : public NewsBlurItem
{
    Q_OBJECT
    Q_PROPERTY(int unreadCount READ unreadCount NOTIFY unreadCountChanged)
    Q_PROPERTY(int posUnreadCount READ posUnreadCount NOTIFY posUnreadCountChanged)
    Q_PROPERTY(int negUnreadCount READ negUnreadCount NOTIFY negUnreadCountChanged)
    Q_PROPERTY(QString unreadCountText READ unreadCountText NOTIFY unreadCountTextChanged)

public:
    explicit FolderItem(PageItemPtr parent = PageItemPtr(), AbstractFeedAggreagatorService* service = 0);
    NewsBlurItem::ItemType itemType() const;

    int unreadCount() const;
    void setUnreadCount(int unreadCount);
    int posUnreadCount() const;
    void setPosUnreadCount(int unreadCount);
    int negUnreadCount() const;
    void setNegUnreadCount(int unreadCount);    
    QString unreadCountText() const;
    void setUnreadCountText(const QString& text);

private:
    int m_unreadCount;
    int m_posUnreadCount;
    int m_negUnreadCount;    
    QString m_unreadCountText;
    void updateUnreadCountText();

signals:
    void unreadCountChanged();
    void unreadCountTextChanged();
    void negUnreadCountChanged();
    void posUnreadCountChanged();
};
typedef QSharedPointer<FolderItem> FolderItemPtr;
typedef QWeakPointer<FolderItem> FolderItemWeakRef;
} // namespace NewsBlur
#endif // FOLDERITEM_H
