aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/xml/rsslisting/handler.h
blob: 8e9fd9ad81640ed72ae81efb0fc19203e1cef975 (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef HANDLER_H
#define HANDLER_H

#include <QObject>
#include <QString>
#include <QXmlDefaultHandler>

/* Note that QObject must precede QXmlDefaultHandler in the following list. */

class Handler : public QObject, public QXmlDefaultHandler
{
    Q_OBJECT
public:
    bool startDocument();
    bool startElement(const QString &, const QString &, const QString &qName,
                       const QXmlAttributes &attr);
    bool endElement(const QString &, const QString &, const QString &qName);
    bool characters(const QString &chars);

    bool fatalError(const QXmlParseException &exception);

signals:
    void newItem(QString &title, QString &link);

private:
    QString titleString;
    QString linkString;
    bool inItem;
    bool inTitle;
    bool inLink;
};

#endif