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_ALBUM_H 00018 #define BACKEND_ALBUM_H 00019 00020 //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 Subalbum; 00030 class LoadDialog; 00031 class SaveDialog; 00032 class SubalbumPreviewWidget; 00033 //-------------------- 00034 00035 //===================================== 00048 //===================================== 00049 00050 class Album 00051 { 00052 //------------------------------------------------------ 00053 public: 00054 00056 Album(); 00057 00059 ~Album(); 00060 00062 void setName(QString val); 00063 00065 QString getName(); 00066 00068 void setDescription(QString val); 00069 00071 QString getDescription(); 00072 00074 void setAuthor(QString val); 00075 00077 QString getAuthor(); 00078 00080 void setRepresentativeImages(QImage* val); 00081 00083 QPixmap* getRepresentativeImage(int size); 00084 00086 Subalbum* getFirstSubalbum(); 00087 00089 Subalbum* getLastSubalbum(); 00090 00092 void appendSubalbum(Subalbum* val); 00093 00095 void removeSubalbum(Subalbum* val); 00096 00098 int getModificationYear(); 00099 00101 int getModificationMonth(); 00102 00104 int getModificationDay(); 00105 00107 void updateModificationDate(); 00108 00110 void importFromDisk(LoadDialog* dialog, QString fileName); 00111 00113 void exportToDisk(SaveDialog* dialog, QString dirName); 00114 00118 void exportToDisk(SaveDialog* dialog, bool forceSave = false); 00119 00121 bool prevSave(); 00122 00124 void syncSubalbumList(SubalbumPreviewWidget* item); 00125 00127 QString getSaveLocation(); 00128 00130 int getNumSubalbums(); 00131 00132 //------------------------------------------------------ 00133 private: 00135 void exportToXML(SaveDialog* dialog); 00136 00138 void exportToHTML(SaveDialog* dialog); 00139 00141 void exportSublabumsToHTML(SaveDialog* dialog); 00142 00144 void exportTopLevelImages(); 00145 00147 void exportSubalbumImages(SaveDialog* dialog, bool forceSave); 00148 00150 void reorderSubalbumImages(SaveDialog* dialog); 00151 00153 void removeStagnantImages(SaveDialog* dialog); 00154 00156 QString name; 00157 00159 QString description; 00160 00162 QString author; 00163 00165 QPixmap* smallRepresentativeImage; 00166 QPixmap* largeRepresentativeImage; 00167 00169 Subalbum* firstSubalbum; 00170 00172 Subalbum* lastSubalbum; 00173 00175 int modificationYear; 00176 00178 int modificationMonth; 00179 00181 int modificationDay; 00182 00184 int numSubalbums; 00185 00187 int numLoadedSubalbums; 00188 00190 bool savedToDisk; 00191 00193 QString saveLocation; 00194 //------------------------------------------------------ 00195 }; 00196 00197 #endif //BACKEND_ALBUM_H