Sophie

Sophie

distrib > Mandriva > 2011.0 > i586 > media > contrib-release-debug > by-pkgid > 0b102c0e3d0c39a3855aaf976204ce5c > files > 41

associationsubscribersmanager-debug-3.2.0-2mdv2011.0.i586.rpm


//  Copyright (C) 2009 by Arnaud Dupuis
//  a.dupuis@infinityperl.org
//  http://www.infinityperl.org
// 
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 3 of the License, or
//  (at your option) any later version.
// 
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the
//  Free Software Foundation, Inc.,
//  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA

#ifndef ADDONXMLHANDLER_H
#define ADDONXMLHANDLER_H

#include <QXmlDefaultHandler>
#include <QString>
#include <QStringList>
#include <QMap>
/*! \class AddonXmlHandler
* \brief the XML handler for the addon description files.
*
* This class is the XML handler for the Association Subscribers Manager's addon description files.
* 
*/
class AddonXmlHandler : public QXmlDefaultHandler
{
	public:
		/*!
		Constructs a new handler.
		*/
		AddonXmlHandler();
		/*!
		The reader calls this function when it has parsed a start element tag.

		There is a corresponding endElement() call when the corresponding end element tag is read. The startElement() and endElement() calls are always nested correctly. Empty element tags (e.g. <x/>) cause a startElement() call to be immediately followed by an endElement() call.

		The attribute list provided only contains attributes with explicit values. The attribute list contains attributes used for namespace declaration (i.e. attributes starting with xmlns) only if the namespace-prefix property of the reader is true.

		The argument namespaceURI is the namespace URI, or an empty string if the element has no namespace URI or if no namespace processing is done. localName is the local name (without prefix), or an empty string if no namespace processing is done, qName is the qualified name (with prefix) and atts are the attributes attached to the element. If there are no attributes, atts is an empty attributes object.

		If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.
		\sa endElement
		*/
		bool startElement( const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attributes );
		/*!
		The reader calls this function when it has parsed an end element tag with the qualified name qName, the local name localName and the namespace URI namespaceURI.

		If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.
		*/
		bool endElement( const QString &namespaceURI, const QString &localName, const QString &qName );
		/*!
		The reader calls this function when it has parsed a chunk of character data (either normal character data or character data inside a CDATA section; if you need to distinguish between those two types you must use QXmlLexicalHandler::startCDATA() and QXmlLexicalHandler::endCDATA()). The character data is reported in ch.

		If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.
		*/
		bool characters(const QString &str);
		/*!
		A reader must use this function to report a non-recoverable error. Details of the error are stored in exception.

		If this function returns true the reader might try to go on parsing and reporting further errors, but no regular parsing events are reported.
		*/
		bool fatalError(const QXmlParseException &exception);
		/*!
		Returns a QMap filled with data parsed from the XML file.
		*/
		QMap<QString,QString> getData();
		/*!
		\deprecated this function is likely to be removed.
		*/
		void setLanguage(const QString&);
	private:
		QString currentText;
		QMap<QString,QString> _data;
		QString tmpLang;
		QString _lang;
};

#endif