53 lines
916 B
C++
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
|