This repository has been archived on 2020-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
FediPotato/gui/src/channel.hpp

53 lines
916 B
C++

#ifndef FEDIPOTATO_GUI_CHANNEL_HPP
#define FEDIPOTATO_GUI_CHANNEL_HPP
#include <QStandardItem>
#include <QString>
#include <qstandarditemmodel.h>
namespace FediPotato
{
//! Identifier for ChannelItem.
enum class id_channel
{
none,
tl_home,
tl_instance,
tl_federated,
conversations,
hashtag,
filter
};
//! An Item for use with #treeview_channel.
class ChannelItem : public QStandardItem
{
public:
ChannelItem(const QString &text, id_channel identifier)
: _identifier{identifier}
{
setText(text);
}
public:
[[nodiscard]]
id_channel identifier() const
{
return _identifier;
}
[[nodiscard]]
int type() const override
{
return QStandardItem::UserType;
}
private:
const id_channel _identifier;
};
} // namespace FediPotato
#endif // FEDIPOTATO_GUI_CHANNEL_HPP