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

#include "Exporter.h"
#include <qstringlist.h>

/*!
  This class exports recipes and cookbooks in Meal-Master format.
*/
class MMExporter : public Exporter {
      Q_OBJECT

   public:
	  MMExporter( RecipeModel*); //!< Constructor.
	  MMExporter( const Recipe&); //!< Constructor.
	  inline ~MMExporter() {} //!< Destructor.

      QString getExtensions();
	  void apply() throw( Error);

   protected:
	  void createCookbookHeader();
	  void createRecipes();
	  void createRecipeHeader();
	  void createRecipeBody();

   private:
	  void buildStringList() throw( Error);
	  void convertCookbook();
	  void convertRecipe( const Recipe&);
      QStringList wrapText( const QString&, int) const;
      QStringList ingredientList2StringList( const Recipe::IngredientList&) const;
	  
	  /*! List storing a string for each line of output. */
	  QStringList m_lines;
};
#endif // MEALMASTER_EXPORTER_H
