Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

photo.h

Go to the documentation of this file.
00001 //==============================================
00002 //  copyright            : (C) 2003-2005 by Will Stokes
00003 //==============================================
00004 //  This program is free software; you can redistribute it 
00005 //  and/or modify it under the terms of the GNU General 
00006 //  Public License as published by the Free Software 
00007 //  Foundation; either version 2 of the License, or  
00008 //  (at your option) any later version.         
00009 //==============================================
00010 
00011 #ifndef BACKEND_PHOTO_H
00012 #define BACKEND_PHOTO_H
00013 
00014 //define image sizes
00015 #define THUMBNAIL 1
00016 #define SLIDESHOW 2
00017 #define IMAGE 3
00018 
00019 //TODO: remove this include
00020 //this is a temporary hack, I the enum for photo transofmrations need to be revealed
00021 //to all classes that include photo.h becaue one private function uses thsi enum, DAMN
00022 #include "tools/imageTools.h"
00023 
00024 //--------------------
00025 //forward declarations
00026 class QString;
00027 class QPixmap;
00028 class QImage;
00029 class QDomNode;
00030 class QDateTime;
00031 class Subalbum;
00032 //--------------------
00033 
00034 //=====================================
00039 //=====================================
00040 
00041 class Photo
00042 {
00043 //------------------------------------------------------
00044 public:
00046   Photo(Subalbum* subalbum, Photo* prev, int photoNumber);
00047   
00048   ~Photo();
00049   //----------------------------
00051   QImage* getThumbnailImage();
00052 
00056   bool constructSmallerImages();
00057   
00060   bool setImage(QString imageName,
00061                 QString slideshowName,
00062                 QString thumbnailName);
00063   
00065   bool setImage(QString imageName, int uniqueID);
00066 
00069   bool setImage(QString editedImageFilename);
00070   //------------------------------------------
00072   QString getImageFilename();
00073   
00075   QString getSlideshowFilename();
00076   
00078   QString getThumbnailFilename();
00079   //---------------------------- 
00081   void setImageFilename(QString val);
00082     
00084   void setSlideshowFilename(QString val);
00085   
00087   void setThumbnailFilename(QString val);  
00088   //---------------------------- 
00090   QString getImageChecksum();
00091   
00093   QString getThumbnailChecksum();
00094   
00096   QString getSlideshowChecksum();
00097     
00099   void setImageChecksum(QString val);
00100   
00102   void setThumbnailChecksum(QString val);
00103   
00105   void setSlideshowChecksum(QString val);  
00106   //------------------------------------------
00108   QString getDescription();
00109   
00111   void setDescription(QString val);
00112   //---------------------------- 
00114   Photo* getPrev();
00115   
00117   Photo* getNext();
00118   
00120   void setPrev(Photo* val);
00121   
00123   void setNext(Photo* val);
00124   //---------------------------- 
00126   QDateTime* importFromDisk(QDomNode* root);
00127   
00129   void exportToXML(QTextStream& stream);
00130   //------------------------------------------
00132   void rotate90();
00133   
00135   void rotate270();
00136   
00138   void flipHorizontally();
00139   
00141   void flipVertically();
00142   
00144   void applyTransformation(TRANSFORM_CODE transformation);
00145   //------------------------------------------
00147   bool getNeedsSavingVal();
00148   
00150   void setNeedsSavingVal(bool val);
00151   //------------------------------------------
00153   bool getEverSaved();
00154   
00156   void setEverSaved(bool val);
00157   //------------------------------------------
00159   void revertPhoto();
00160   
00162   bool revertPossible();
00163 
00165   bool getRecentlyReverted();
00166   
00168   void setRecentlyReverted(bool val);
00169 
00171   QString originalImageFilename();
00172   //------------------------------------------
00174   int getInitialPhotoNumber();
00175   
00177   void setInitialPhotoNumber(int val);
00178   
00180   int getInitialSubalbumNumber();
00181   
00183   void setInitialSubalbumNumber(int val);
00184 //------------------------------------------------------
00185 private:
00187   Subalbum* subalbum;
00188 
00190   Photo* prev;
00191   
00193   Photo* next;
00194   
00195   //Initial photo number
00196   int initialPhotoNumber;
00197   
00198   //Initial subalbum number
00199   int initialSubalbumNumber;
00200   
00202   QString description;
00203   
00205   QImage* thumbnailImage;
00206     
00208   QString imageLocation;
00209   QString slideshowLocation;
00210   QString thumbnailLocation;
00211   
00213   QString imageChecksum;
00214   QString slideshowChecksum;
00215   QString thumbnailChecksum;
00216   
00218   bool needsSaving;
00219   
00221   bool everSaved;
00222   
00225   bool recentlyReverted;
00226 //------------------------------------------------------
00227 };
00228 
00229 #endif //BACKEND_PHOTO_H

Generated on Wed May 4 11:10:13 2005 for AlbumShaper by  doxygen 1.3.9.1