00001 //============================================== 00002 // copyright : (C) 2003 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 // As a special exception, Will Stokes gives permission to 00011 // link this program with Qt non-commercial edition, and 00012 // distribute the resulting executable, without including the 00013 // source code for the Qt non-commercial edition in the 00014 // source distribution. 00015 //============================================== 00016 00017 #ifndef BACKEND_PHOTO_H 00018 #define BACKEND_PHOTO_H 00019 00020 //define image sizes 00021 #define THUMBNAIL 1 00022 #define PADDED_THUMBNAIL 2 00023 #define SLIDESHOW 3 00024 #define IMAGE 4 00025 00026 //-------------------- 00027 //forward declarations 00028 class QString; 00029 class QPixmap; 00030 class QImage; 00031 class QDomNode; 00032 class QDateTime; 00033 class Subalbum; 00034 //-------------------- 00035 00036 //===================================== 00039 //===================================== 00040 00041 class Photo 00042 { 00043 //------------------------------------------------------ 00044 public: 00045 00047 Photo(Subalbum* subalbum, int number); 00048 00050 ~Photo(); 00051 //---------------------------- 00053 void setImageFilename(QString val); 00054 00056 void setSlideshowFilename(QString val); 00057 00059 void setThumbnailFilename(QString val); 00060 //---------------------------- 00062 QString getImageFilename(); 00063 00065 QString getSlideshowFilename(); 00066 00068 QString getThumbnailFilename(); 00069 //---------------------------- 00072 bool setImage(const QString &imageName); 00073 00077 bool setImage(const QString &imageName, 00078 const QString &slideshowName, 00079 const QString &thumbnailName); 00080 00083 bool setImage(QImage* fullImage); 00084 00086 void setDescription(QString val); 00087 00089 QString getDescription(); 00090 00092 Photo* getNext(); 00093 00095 void setNext(Photo* val); 00096 00098 QImage* getImage(int size); 00099 00101 QDateTime* importFromDisk(QDomNode* root); 00102 00104 void exportToXML(QTextStream& stream); 00105 00107 void exportThumbnailHTML(QTextStream& stream); 00108 00110 void exportSlideshowHTML(QTextStream& stream); 00111 00113 void rotate90(); 00114 00116 void rotate270(); 00117 00119 void flipHorizontally(); 00120 00122 void flipVertically(); 00123 00125 void setThumbnailChecksum(QString val); 00126 00128 void setSlideshowChecksum(QString val); 00129 00131 void setImageChecksum(QString val); 00132 00134 QString getThumbnailChecksum(); 00135 00137 QString getSlideshowChecksum(); 00138 00140 QString getImageChecksum(); 00141 00143 void deallocateLargeImages(); 00144 00146 void setNeedsSavingVal(bool val); 00147 00149 bool getNeedsSavingVal(); 00150 00152 int getInitialPhotoNumber(); 00153 00155 int getInitialSubalbumNumber(); 00156 00158 void setInitialPhotoNumber(int val); 00159 00161 void setInitialSubalbumNumber(int val); 00162 00164 int actualSlideshowWidth(); 00165 00167 int actualSlideshowHeight(); 00168 00170 void setActualSlideshowDimensions(int w, int h); 00171 //------------------------------------------------------ 00172 private: 00174 Subalbum* subalbum; 00175 00176 //Initial photo number (when first created) 00177 int initialNumber; 00178 00179 //Initial subalbum number of photo 00180 int initialSubalbumNumber; 00181 00183 Photo* next; 00184 00186 QString description; 00187 00189 QImage* thumbnailImage; 00190 00192 QImage* paddedThumbnailImage; 00193 00195 QImage* slideshowImage; 00196 00198 QImage* fullImage; 00199 00201 QString imageChecksum; 00202 QString slideshowChecksum; 00203 QString thumbnailChecksum; 00204 00206 QString imageLocation; 00207 00209 QString slideshowLocation; 00210 00212 QString thumbnailLocation; 00213 00215 bool needsSaving; 00216 00218 int slideshowWidth; 00219 00221 int slideshowHeight; 00222 00223 //------------------------------------------------------ 00224 }; 00225 00226 #endif //BACKEND_PHOTO_H
1.3.4