/***************************************************************************
 *   Copyright (C) 2004 by Stefano                                         *
 *   stefano@xiaprojects.com                                               *
 *                                                                         *
 *   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 2 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 XEPLUGIN_XMLCONF_H
#define XEPLUGIN_XMLCONF_H

#include <qobject.h>
#include <qxml.h>
#include <qfile.h>
#include <qxml.h>
#include <qdom.h>

/**
@author Stefano
*/
class XEPlugin_XMLConf : public QObject, public QXmlDefaultHandler
{
Q_OBJECT

public:
    XEPlugin_XMLConf(QObject *parent = 0, const char *name = 0);

    ~XEPlugin_XMLConf();
    bool startDocument();
    bool startElement( const QString&, const QString&, const QString& ,const QXmlAttributes& );
    bool endElement( const QString&, const QString&, const QString& );
    void xmlFetchPlugins(QDomNodeList &xmlIcons);
    static void xmlFetch(const QString &tagName,int &retValue,QDomNodeList &xmlEngine);
    void xXMLExplode();
    void xImportXMLs();
protected:
    QFile 	xmlFile;
    int		xmlLevel;
    class XSConfigurations *ActiveConfiguration;


public slots:
    void xStart();
    void xStop();
    void xSetup();
    void xXMLStore(const QString &);
    void xXMLStore();
    void xLoadXML(const QString);
protected:
    void xmlFetchObjectsIcons(QDomNodeList &xmlIcons,class XSGObjectIcon *storageIcon=NULL);
    void xmlFetchObjectsPlugins(QDomNodeList &xmlIcons);
protected:
    void xmlFetchPathsIcons(QDomNodeList &xmlIcons);
    void xmlFetchPathsPlugins(QDomNodeList &xmlIcons);
    void xmlStoreObjectsIcons(QDomDocument &doc, QDomElement &root, class XSGObjectIcon *icon);
    void xCfgStore(QDomDocument &doc, QDomElement &root);
    QDomNodeList makeNodeList(QObject *);
signals:
    void clientGetParameterList(QStringList *);
    void clientGetParameter(const QString,QString&);
};

#endif
