Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 by Savoir-faire Linux |
| 3 | * Author: Mingrui Zhang <mingrui.zhang@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 "qmladapterbase.h" |
| 22 | |
| 23 | #include <QObject> |
| 24 | #include <QVariant> |
| 25 | #include <QString> |
| 26 | |
| 27 | class AvAdapter : public QmlAdapterBase |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | |
| 31 | public: |
| 32 | explicit AvAdapter(QObject *parent = nullptr); |
| 33 | ~AvAdapter(); |
| 34 | |
| 35 | /* |
| 36 | * Return needed info for populating video device context menu item. |
| 37 | */ |
| 38 | Q_INVOKABLE QVariantMap populateVideoDeviceContextMenuItem(); |
| 39 | |
| 40 | /* |
| 41 | * Preview video input switching. |
| 42 | */ |
| 43 | Q_INVOKABLE void onVideoContextMenuDeviceItemClicked(const QString &deviceName); |
| 44 | |
| 45 | /* |
| 46 | * Share the screen specificed by screen number. |
| 47 | */ |
| 48 | Q_INVOKABLE void shareEntireScreen(int screenNumber); |
| 49 | |
| 50 | /* |
| 51 | * Take snap shot of the screen by returning base64 image string. |
| 52 | */ |
| 53 | Q_INVOKABLE const QString captureScreen(int screenNumber); |
| 54 | |
| 55 | /* |
| 56 | * Share a media file. |
| 57 | */ |
| 58 | Q_INVOKABLE void shareFile(const QString &filePath); |
| 59 | |
| 60 | /* |
| 61 | * Select screen area to display. |
| 62 | */ |
| 63 | Q_INVOKABLE void shareScreenArea(int screenNumber, int x, int y, int width, int height); |
| 64 | |
| 65 | private: |
| 66 | void initQmlObject() override; |
| 67 | }; |