summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/places/qplacecategoriesreplyimpl.h
blob: f770fde8b6bc8c7d10b7a137bf30d144dfe67ebc (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
#ifndef QPLACECATEGORIESREPLYIMPL_H
#define QPLACECATEGORIESREPLYIMPL_H

#include <QObject>
#include <QList>

#include <qplacereply.h>
#include "qplacerestreply.h"
#include "qplacejsoncategoriesparser.h"

class QPlaceCategoriesReplyImpl : public QPlaceReply
{
    Q_OBJECT
public:
    explicit QPlaceCategoriesReplyImpl(QPlaceRestReply *reply, QObject *parent = 0);
    ~QPlaceCategoriesReplyImpl();

    QPlaceCategoryTree categories() const;
    QList<QPlaceCategory> categoriesFlat() const;

    void abort();

Q_SIGNALS:
    void processingFinished(QPlaceReply *reply);
    void processingError(QPlaceReply *reply, const QPlaceReply::Error &error, const QString &errorMessage);

private slots:
    void restError(QPlaceRestReply::Error error);
    void resultReady(const QPlaceJSonParser::Error &error,
                          const QString &errorMessage);

private:
    QPlaceRestReply *restReply;
    QPlaceJSonCategoriesParser *parser;

    QPlaceCategoryTree m_categoryTree;
};

#endif // QPLACECATEGORIESREPLYIMPL_H