summaryrefslogtreecommitdiff
path: root/src/imports/location/declarativeplaces/qdeclarativeplacemanager_p.h
blob: cc1f5bdf3beddc7393bb84a8a2245c6a920fdc37 (plain)
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
#ifndef QDECLARATIVEPLACEMANAGER_P_H
#define QDECLARATIVEPLACEMANAGER_P_H

#include <QObject>

#include <qplacemanager.h>
#include <qplacedetailsreply.h>

#include "qdeclarativeplace_p.h"

QT_BEGIN_NAMESPACE

class QDeclarativePlaceManager : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QDeclarativePlace* place READ place NOTIFY placeChanged);

public:
    explicit QDeclarativePlaceManager(QObject *parent = 0);
    ~QDeclarativePlaceManager();

    QDeclarativePlace *place();

    Q_INVOKABLE void getPlaceDetails(QDeclarativePlace *place);
    Q_INVOKABLE void getPlaceMedia(QDeclarativePlace *place);
    Q_INVOKABLE void getPlaceMedia(QDeclarativePlace *place, int offset, int limit);
    Q_INVOKABLE void getPlaceReviews(QDeclarativePlace *place);
    Q_INVOKABLE void getPlaceReviews(QDeclarativePlace *place, int offset, int limit);

    Q_INVOKABLE void ratePlace(QDeclarativePlace *place, qreal rateValue, const QString &userName);

    Q_INVOKABLE void cancelRequest();

signals:
    void requestFinished(const int &error);
    void placeChanged();

private slots:
    void replyFinished();
    void replyError(QPlaceReply::Error error, const QString &errorString);

private:
    void cancelPreviousRequest();
    void connectNewResponse(QPlaceReply *newResponse);

private:
    QDeclarativePlace *m_place;

    QPlaceManager *m_manager;
    QPlaceReply *m_response;
};

QT_END_NAMESPACE

QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativePlaceManager));

#endif // QDECLARATIVETEXTPREDICTIONMODEL_P_H