/* -*- 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: RecipeImageData.cpp,v 1.1 2003/06/19 17:54:18 rjesse Exp $
 */

#include "RecipeImageData.h"
#include "Recipe.h"

/*!
  Creates an empty RecipeImageData object.
*/
RecipeImageData::RecipeImageData()
{
}

/*!
  Creates a RecipeImageData object with label \a l.
  \sa setUri(), setPixmap()
*/
RecipeImageData::RecipeImageData( const QString& l)
   : m_label( l)
{
   m_uri.truncate( 0);
   m_pixmap.resize( 0, 0);
   m_type = INVALID;
}

QString
RecipeImageData::label() const
{
   return m_label;
}

QString
RecipeImageData::uri() const
{
   return m_uri;
}

QPixmap
RecipeImageData::pixmap() const
{
   return m_pixmap;
}

QString
RecipeImageData::pictureAsBase64() const
{
   return Recipe::encodeBase64( m_pixmap);
}

void
RecipeImageData::setLabel( const QString& s)
{
   m_label = s;
}

void
RecipeImageData::setUri( const QString& s)
{
   m_uri = s;
   m_type = URI;
}

void
RecipeImageData::setPixmap( const QPixmap& p)
{
   m_pixmap = p;
   m_type = EMBEDDED;
}
