]> git.sur5r.net Git - minitube/blob - src/channelsmodel.h
Upload 3.9.3-2 to unstable
[minitube] / src / channelsmodel.h
1 #ifndef CHANNELSMODEL_H
2 #define CHANNELSMODEL_H
3
4 #include <QtSql>
5
6 class YTUser;
7
8 class ChannelsModel : public QSqlQueryModel {
9
10     Q_OBJECT
11
12 public:
13     ChannelsModel(QObject *parent = 0);
14     QVariant data(const QModelIndex &item, int role) const;
15     void setHoveredRow(int row);
16     YTUser* userForIndex(const QModelIndex &index) const;
17
18     enum DataRoles {
19         ItemTypeRole = Qt::UserRole,
20         DataObjectRole,
21         ActiveItemRole,
22         HoveredItemRole
23     };
24
25     enum ItemTypes {
26         ItemChannel = 1,
27         ItemFolder,
28         ItemAggregate
29     };
30
31 public slots:
32     void clearHover();
33
34 protected:
35     Qt::ItemFlags flags(const QModelIndex &index) const;
36     QStringList mimeTypes() const;
37     Qt::DropActions supportedDropActions() const;
38     Qt::DropActions supportedDragActions() const;
39     QMimeData* mimeData( const QModelIndexList &indexes ) const;
40
41 private:
42     int hoveredRow;
43 };
44
45 #endif // CHANNELSMODEL_H