1
/****************************************************************************
2
* Copyright (C) 2012-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef VIDEOCODECMODEL_H
19
#define VIDEOCODECMODEL_H
22
#include <QtCore/QAbstractListModel>
31
typedef QHash<QString,VideoCodec*> CodecHash;
33
///Abstract model for managing account video codec list
34
class LIB_EXPORT VideoCodecModel : public QAbstractListModel {
35
#pragma GCC diagnostic push
36
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
38
#pragma GCC diagnostic pop
41
//Private constructor, can only be called by 'Account'
42
explicit VideoCodecModel(Account* account = nullptr);
45
static const int BITRATE_ROLE = 101;
48
QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
49
int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
50
Qt::ItemFlags flags ( const QModelIndex& index ) const;
51
virtual bool setData ( const QModelIndex& index, const QVariant &value, int role) ;
55
bool moveUp (QModelIndex idx);
56
bool moveDown(QModelIndex idx);
60
QList<VideoCodec*> m_lCodecs;
63
Q_DECLARE_METATYPE(VideoCodecModel*)