photoboothwidget.h 2.14 KB
Newer Older
1
/***************************************************************************
Andreas Traczyk's avatar
Andreas Traczyk committed
2
 * Copyright (C) 2015-2019 by Savoir-faire Linux                           *
3
 * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com>          *
Andreas Traczyk's avatar
Andreas Traczyk committed
4
 * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>          *
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 3 of the License, or       *
 * (at your option) any later version.                                     *
 *                                                                         *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU General Public License for more details.                            *
 *                                                                         *
 * You should have received a copy of the GNU General Public License       *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 **************************************************************************/

Andreas Traczyk's avatar
Andreas Traczyk committed
20
#pragma once
21 22

#include <QWidget>
Andreas Traczyk's avatar
Andreas Traczyk committed
23 24
#include <QLabel>
#include <QPropertyAnimation>
25 26 27 28 29 30 31 32 33 34 35 36

namespace Ui {
class PhotoboothWidget;
}

class PhotoboothWidget : public QWidget
{
    Q_OBJECT

public:
    explicit PhotoboothWidget(QWidget *parent = 0);
    ~PhotoboothWidget();
Andreas Traczyk's avatar
Andreas Traczyk committed
37

38 39
    void startBooth();
    void stopBooth();
Andreas Traczyk's avatar
Andreas Traczyk committed
40
    void setAvatarPixmap(const QPixmap& avatarPixmap, bool default = false);
41 42
    const QPixmap& getAvatarPixmap();
    bool hasAvatar();
43 44 45 46 47 48 49 50 51

private slots:
    void on_importButton_clicked();
    void on_takePhotoButton_clicked();

private:
    QString fileName_;
    Ui::PhotoboothWidget *ui;

Andreas Traczyk's avatar
Andreas Traczyk committed
52 53
    QLabel* flashOverlay_;
    QPropertyAnimation *flashAnimation_;
54 55
    QPixmap avatarPixmap_;
    bool hasAvatar_;
Andreas Traczyk's avatar
Andreas Traczyk committed
56

Andreas Traczyk's avatar
Andreas Traczyk committed
57 58
    bool takePhotoState_;

59
signals:
Andreas Traczyk's avatar
Andreas Traczyk committed
60 61
    void photoTaken();
    void clearedPhoto();
62
};