2 * Copyright (c) 2010 Mani Chandrasekar <maninc@gmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef GOOGLECONTENTHANDLER_H
20 #define GOOGLECONTENTHANDLER_H
22 #include <QXmlContentHandler>
25 class GoogleDocumentList;
28 class GoogleContentHandler : public QXmlContentHandler
31 GoogleContentHandler();
33 virtual bool characters ( const QString & ch );
34 virtual bool endDocument ();
35 virtual bool endElement ( const QString & namespaceURI, const QString & localName, const QString & qName );
36 virtual bool endPrefixMapping ( const QString & prefix );
37 virtual QString errorString () const;
38 virtual bool ignorableWhitespace ( const QString & ch );
39 virtual bool processingInstruction ( const QString & target, const QString & data );
40 virtual void setDocumentLocator ( QXmlLocator * locator );
41 virtual bool skippedEntity ( const QString & name );
42 virtual bool startDocument ();
43 virtual bool startElement ( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts );
44 virtual bool startPrefixMapping ( const QString & prefix, const QString & uri );
46 GoogleDocumentList *documentList() { return m_docList; }
49 QStack<QString> m_nodeStack;
51 GoogleDocumentList *m_docList;
52 GoogleDocument *m_docEntry;
54 void printName(const QString & name);
57 #endif // GOOGLECONTENTHANDLER_H