overte/interface/src/ui/Snapshot.h
David Kelly c8f3a898d2 First cut of a snapshot uploader
Will need to test end-to-end shortly, etc...
2016-08-08 15:27:27 -07:00

58 lines
1.3 KiB
C++

//
// Snapshot.h
// interface/src/ui
//
// Created by Stojce Slavkovski on 1/26/14.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_Snapshot_h
#define hifi_Snapshot_h
#include <glm/glm.hpp>
#include <QString>
#include <QStandardPaths>
#include <SettingHandle.h>
class QFile;
class QTemporaryFile;
class SnapshotMetaData {
public:
QUrl getURL() { return _URL; }
void setURL(QUrl URL) { _URL = URL; }
private:
QUrl _URL;
};
class SnapshotUploader: public QObject {
Q_OBJECT
public slots:
void uploadSuccess(QNetworkReply& reply);
void uploadFailure(QNetworkReply& reply);
void createStorySuccess(QNetworkReply& reply);
void createStoryFailure(QNetworkReply& reply);
};
class Snapshot {
public:
static QString saveSnapshot(QImage image);
static QTemporaryFile* saveTempSnapshot(QImage image);
static SnapshotMetaData* parseSnapshotData(QString snapshotPath);
static Setting::Handle<QString> snapshotsLocation;
static Setting::Handle<bool> hasSetSnapshotsLocation;
static void uploadSnapshot(const QString& filename);
private:
static QFile* savedFileForSnapshot(QImage & image, bool isTemporary);
};
#endif // hifi_Snapshot_h