/* -*- 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: MMImporter.h,v 1.8 2003/01/12 16:19:56 rjesse Exp $
 */
 
#ifndef MM_IMPORTER_HPP
#define MM_IMPORTER_HPP

#include "Importer.h"
#include "Recipe.h"

/*!
  Class for importing recipes in MealMaster format.
*/
class MMImporter : public Importer {
      Q_OBJECT

   public:
	  MMImporter();             //!< Constructor.
	  inline ~MMImporter() {}	//!< Destructor.

	  RecipeModel& apply() throw(Error);
	  
   protected:
	  void readCookbookHeader();
	  void readAllRecipes();
	  void readRecipe();
	  void readRecipeHeader();
	  void readRecipeBody();

   private:
      void readRecipeIngredients();
      bool readIngredientLine( const QString&, Ingredient&);
      bool mightBelong2Ingredients( const QString&) const;

      void readRecipeReferences();
      void readRecipeSteps();

      void stepOneLine( QStringList::const_iterator&, int*);

      QStringList m_curRecipeStringL;
      QStringList::const_iterator m_it;
      Recipe m_curRecipe;
};
#endif // MM_IMPORTER_HPP
