blob: cd165ccf9adce8bbbb854e404bda8410d709df5e [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2019-2020 by Savoir-faire Linux
3 * Author: Yang Wang <yang.wang@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
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
19#pragma once
20
21#include <QAbstractItemModel>
22
23#include "api/account.h"
24#include "api/contact.h"
25#include "api/conversation.h"
26#include "api/newdevicemodel.h"
27
28#include "lrcinstance.h"
29
30class VideoFormatFpsModel : public QAbstractListModel
31{
32 Q_OBJECT
33 Q_PROPERTY(QString currentResolution READ getCurrentResolution WRITE setCurrentResolution NOTIFY
34 currentResolutionChanged);
35
36public:
37 enum Role { FPS = Qt::UserRole + 1, FPS_ToDisplay_UTF8 };
38 Q_ENUM(Role)
39
40 explicit VideoFormatFpsModel(QObject *parent = 0);
41 ~VideoFormatFpsModel();
42
43 /*
44 * QAbstractListModel override.
45 */
46 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
47 int columnCount(const QModelIndex &parent) const override;
48 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
49 /*
50 * Override role name as access point in qml.
51 */
52 QHash<int, QByteArray> roleNames() const override;
53 QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
54 QModelIndex parent(const QModelIndex &child) const;
55 Qt::ItemFlags flags(const QModelIndex &index) const;
56
57 /*
58 * This function is to reset the model when there's new account added.
59 */
60 Q_INVOKABLE void reset();
61 /*
62 * This function is to get the current device id in the demon.
63 */
64 Q_INVOKABLE int getCurrentSettingIndex();
65
66 /*
67 * Getters and setters
68 */
69 QString getCurrentResolution();
70 void setCurrentResolution(QString resNew);
71
72signals:
73 void currentResolutionChanged(QString resNew);
74
75private:
76 QString currentResolution_;
77};