/* -*- 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: ExportDialog.h,v 1.7 2003/06/19 18:19:14 rjesse Exp $
 */
 
#ifndef EXPORT_DIALOG_H
#define EXPORT_DIALOG_H

#include "ExportForm.h"
#include "Recipe.h"
#include "RecipeModel.h"
#include <qdict.h>

/*!
  Dialog for specifying export options.
*/
class ExportDialog : public ExportForm {
      Q_OBJECT
	  
   public:
	  enum What { UNDEF_WHAT, CURRENT_RECIPE, CURRENT_COOKBOOK,
                  MARKED_RECIPES, MARKED_COOKBOOKS };
	  
      enum Format { UNDEF_FORMAT, MANGO, MEALMASTER, COOKML, RECIPEML, REZKONV };

	  ExportDialog( QWidget* parent = 0, 
					const char* name = 0, 
					const What& = CURRENT_RECIPE);
	  ~ExportDialog();
	  
   public slots:
      void setCurrentRecipe( const Recipe&);
      void setCurrentCookbook( RecipeModel*);
      void setMarkedRecipes( RecipeModel*);
      void setMarkedCookbooks( const QDict<RecipeModel>);
      void startExport();

   private slots:
	  void enable( const What&);

   private:
      What getWhat() const;
      Format getFormat() const;
      void logError( const QString&);
      void logRecipesSaved( int, const QString&);
      void exportCookbook( RecipeModel*, const Format&);

      void exportCurrentRecipe( const Format&);
      void exportCurrentCookbook( const Format&);
      void exportMarkedRecipes( const Format&);
      void exportMarkedCookbooks( const Format&);

      Recipe m_currentRecipe;
      RecipeModel* m_currentCookbook;
      RecipeModel* m_markedRecipes;
      QDict<RecipeModel> m_markedCookbooks;
};
#endif // EXPORT_DIALOG_H

