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_SUBALBUM_H 00018 #define BACKEND_SUBALBUM_H 00019 00020 //define representative image sizes 00021 #define SMALL 1 00022 #define MEDIUM 2 00023 #define LARGE 3 00024 00025 //-------------------- 00026 //forward declarations 00027 class QString; 00028 class QPixmap; 00029 class QDomNode; 00030 class Album; 00031 class Photo; 00032 class StatusWidget; 00033 class PhotoWidget; 00034 //-------------------- 00035 00036 //===================================== 00049 //===================================== 00050 00051 class Subalbum 00052 { 00053 //------------------------------------------------------ 00054 public: 00055 00058 Subalbum(Album* albm, int number); 00059 00061 ~Subalbum(); 00062 00064 void setName(QString val); 00065 00067 QString getName(); 00068 00070 void setDescription(QString val); 00071 00073 QString getDescription(); 00074 00076 QPixmap* getRepresentativeImage(int size); 00077 00079 void setRepresentativeImages(QImage* val); 00080 00083 bool addPhoto(QString fileName, bool replaceDescription = false, Photo* newPhoto = NULL); 00084 00086 bool lazyAddPhoto(QString imageName, 00087 QString slideshowName, 00088 QString thumbnailName, 00089 Photo* newPhoto); 00090 00092 void addPhoto(Photo* newPhoto); 00093 00095 void photoMoved(Photo* val); 00096 00098 void removePhoto(Photo* val); 00099 00101 Subalbum* getNext(); 00102 00104 void setNext(Subalbum* val); 00105 00107 Photo* getFirst(); 00108 00110 Photo* getLast(); 00111 00113 void exportToXML(QTextStream& stream); 00114 00116 void importFromDisk(QDomNode* root, int subalbumNum, StatusWidget* status, QString dirName); 00117 00119 void syncPhotoList(PhotoWidget* item); 00120 00122 int getSubalbumNumber(); 00123 00125 int getNumPhotos(); 00126 00128 int getNumLoadedPhotos(); 00129 00130 //Resets the number of loaded photos in the subalbum to the number of photos in the subalbum 00131 void resetNumLoadedPhotos(); 00132 00133 //Sets the subalbum as modified 00134 void setModified(); 00135 //------------------------------------------------------ 00136 private: 00138 int number; 00139 00141 int numPhotos; 00142 00144 int loadedPhotos; 00145 00147 QString name; 00148 00150 QString description; 00151 00152 //Small, medium, and large representative images 00153 QPixmap* smallRepresentativeImage; 00154 QPixmap* mediumRepresentativeImage; 00155 QPixmap* largeRepresentativeImage; 00156 00158 Photo* firstPhoto; 00159 00161 Photo* lastPhoto; 00162 00164 Subalbum* nextSubalbum; 00165 00167 Album* albm; 00168 //------------------------------------------------------ 00169 }; 00170 00171 #endif //BACKEND_SUBALBUM_H
1.3.4