/*
 * ImageInfo.h
 *
 * (c) 2002 by Thorsten Scheuermann <tscheuermann@gmx.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#ifndef _IMAGEINFO_H
#define _IMAGEINFO_H

#include "ViewerGlobals.h"
#include <qstring.h>

class ImageInfo
{
public:
  ImageInfo(const char *fileName, bool createThumbnail = false);
  ~ImageInfo();

  int imageWidth() const { return width; }
  int imageHeight() const { return height; }

  QString fullFileName();
  QString fileName();
  QString pathName();

  RotationMode rotation() const { return theRotation; }
  void rotateCW();
  void rotateCCW();

  friend bool operator< (const ImageInfo&, const ImageInfo&);
  friend bool operator<= (const ImageInfo&, const ImageInfo&);
  friend bool operator> (const ImageInfo&, const ImageInfo&);
  friend bool operator>= (const ImageInfo&, const ImageInfo&);
  friend bool operator== (const ImageInfo&, const ImageInfo&);
  friend bool operator!= (const ImageInfo&, const ImageInfo&);

private:
  QString thePathName;
  QString theFileName;
  int width;
  int height;
  RotationMode theRotation;
};

inline bool operator< (const ImageInfo& a, const ImageInfo& b)
{
  return a.theFileName < b.theFileName;
}

inline bool operator> (const ImageInfo& a, const ImageInfo& b)
{
  return a.theFileName > b.theFileName;
}

inline bool operator<= (const ImageInfo& a, const ImageInfo& b)
{
  return !(a>b);
}

inline bool operator>= (const ImageInfo& a, const ImageInfo& b)
{
  return !(a<b);
}

inline bool operator== (const ImageInfo& a, const ImageInfo& b)
{
  return a.theFileName == b.theFileName;
}

inline bool operator!= (const ImageInfo& a, const ImageInfo& b)
{
  return !(a == b);
}

#endif
