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

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

/*!
  Class for importing recipes in Rezkonv format.
  As the format is very German centric, most (if not all) strings
  are *not* subject to i18n.
*/
class RKImporter : public Importer {
      Q_OBJECT

   public:
      RKImporter();
      inline ~RKImporter() { }

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

   private:
      void readRecipeIngredients();
      void readRecipeReferences();
      void readRecipeSteps();
      bool mightBelong2Ingredients( const QString&) const;
      bool readIngredientLine( const QString&, Ingredient&);
      bool checkForRKspecificMeasurement( const QString&) const;
      QString convertMeasurement( const QString&) const;
      void stepOneLine( QStringList::const_iterator&, int*);

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