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

#include <qobject.h>

struct MeasurementData;

/*! \internal Class storing information about a measurement. That info
  is mainly restricted to the measurement's name and possible
  translations of it.

  The key id for each measurement is its Meal-Master abbreviation.
*/
class Measurement {
   public:
      Measurement();
      Measurement( const QString&);
      Measurement( const Measurement&);
      ~Measurement();
      Measurement& operator=( const Measurement&);

      void setName( const QString&);
      QString mmAbbrev() const;
      QString rkAbbrev() const;
      QString description() const;

      int contains( const QString&, bool cs = true) const;      
      bool isScaleable() const;
      
      static QStringList mmAbbrevs();
      
   protected:
      void detach();
      
   private:
      void initRezkonvAbbrevs();
      void initDescriptions();

      MeasurementData* d;
};

/*****************************************************************************
  Measurement non-member operators
 *****************************************************************************/

bool operator==( const Measurement&, const Measurement&);
bool operator!=( const Measurement&, const Measurement&);
#endif // MEASUREMENT_H
