/* -*- mode: c++; indent-tabs-mode: nil; -*-
 *
 * This file is part of the Mango recipe management distribution.
 * Copyright (c) 2000-2003, Roland Jesse
 * All rights reserved.
 *
 * For license and copyright information see the file COPYRIGHT or 
 * <http://www.opensource.org/licenses/bsd-license.html>.
 *
 * $Id: RecipeMLImportHandler.h,v 1.1 2003/02/22 18:13:34 rjesse Exp $
 */
 
#ifndef RECIPEML_IMPORT_HANDLER_H
#define RECIPEML_IMPORT_HANDLER_H

#include "Ingredient.h"
#include "Recipe.h"
#include <qxml.h>
class RecipeModel;

/*!
  This class handles the SAX2 reading of RecipeML documents. The content of
  such a document is stored in a RecipeModel instance.
*/
class RecipeMLImportHandler : public QXmlDefaultHandler {
   public:
      RecipeMLImportHandler( RecipeModel*);
      bool startElement( const QString&, const QString&, const QString&, const QXmlAttributes&);
      bool endElement( const QString&, const QString&, const QString&);
      bool characters( const QString&);

   private:
      RecipeModel* m_model;
      Ingredient m_curIngredient;
      Recipe m_curRecipe;
      QString m_curElement;     //!< Stores the name of the current element.
      QMap<QString, QString> m_data; //!< Stores the data of the currently active elements.
};
#endif // RECIPEML_IMPORT_HANDLER_H
