-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfirebaseexamples.h
74 lines (68 loc) · 1.83 KB
/
firebaseexamples.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef FIREBASEEXAMPLES_H
#define FIREBASEEXAMPLES_H
#include <QObject>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QUrl>
#include <QDebug>
#include <QString>
/*!
* \brief The ActionHandler Examples of using Firebase.
*
* You will probably want to edit this class and run under debug
* to see what happens.
*
* \see Firebase
*/
class FirebaseExamples:public QObject
{
Q_OBJECT
public:
/*!
* \brief ActionHandler
* \param action Id indicating which example you want to run
* \param firebaseURL URL of your Firebase Database
* \param authToken Your Secret.
*/
FirebaseExamples(int action
, const QString& firebaseURL = ""
, const QString& authToken = "");
/*!
* \brief patch Example of updating your database with PATCH request.
*/
void patch();
/*!
* \brief get Example of retrieving part of your database with GET request.
*/
void get();
/*!
* \brief useToken Example of updating your rules.
*
* Based on example in
* <a href="https://firebase.google.com/docs/database/rest/app-management">
* Firebase REST API Documentation </a>.
*/
void useToken();
/*!
* \brief listen Example of listing for database updates.
*/
void listen();
public slots:
/*!
* \brief onResponseReady Connect to Firebase replayFinished signal.
*
* \see Firebase::eventResponseReady(QByteArray replyData)
*/
void onResponseReady(QByteArray);
/*!
* \brief onDataChanged Connect to Firebase eventDataChanged signal
*
* \see Firebase::eventDataChanged(QString changedData)
*/
void onDataChanged(QString);
private:
QString fbUrl;
QString authToken;
};
#endif // FIREBASEEXAMPLES_H