album.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_ALBUM_H
00012 #define BACKEND_ALBUM_H
00013 
00014 //representative image sizes
00015 #define SMALL 1
00016 #define MEDIUM 2
00017 #define LARGE 3
00018 
00019 //define loading success values
00020 #define ALBUM_LOADED 1
00021 #define ALBUM_READ_ERROR 2
00022 #define ALBUM_XML_ERROR 3
00023 #define ALBUM_EXPORTED 1
00024 #define ALBUM_ERROR_OPEN_FILE 2
00025 //--------------------
00026 //forward declarations
00027 class QString;
00028 class QPixmap;
00029 class Subalbum;
00030 class SubalbumPreviewWidget;
00031 class StatusWidget;
00032 class QStringList;
00033 //--------------------
00034 
00035 //=====================================
00048 //=====================================
00049 
00050 class Album
00051 {
00052 //------------------------------------------------------
00053 public:
00054 
00056   Album( QString tmpDir, bool createSubalbum = true );
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(QString imageFilename);
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   int getCreationYear();
00108 
00110   int getCreationMonth();
00111 
00113   int getCreationDay();
00114 
00116   void updateCreationDate();
00117 
00119   void updateModificationDate();
00120 
00122   int importFromDisk(StatusWidget* status, QString fileName, bool disableCheckPhotoMods);
00123 
00125   int exportToDisk(StatusWidget* status, QString dirName, QString themeName);
00126 
00129   int exportToDisk(StatusWidget* status, bool forceSave=false);
00130 
00132   int exportCompressedWebAlbum(StatusWidget* status,
00133                                QString exportLocation,
00134                                QString exportMessage);
00135   
00138   int exportLargeImages(StatusWidget* status, QString exportPath, QString exportMessage);  
00139   
00141   bool prevSave();
00142 
00144   bool albumModified();
00145 
00147   void setModified(bool val=true);
00148 
00150   void syncSubalbumList(SubalbumPreviewWidget* item);
00151 
00153   QString getSaveLocation();
00154 
00156   int getNumPhotos();
00157   
00159   int getNumSubalbums();
00160   
00162   QString getTheme();
00163   
00165   QString getTmpDir();
00166   
00168   int getNextUniquePhotoID();
00169   
00171   QStringList getThumbnailFilenames();
00172 //------------------------------------------------------
00173 private:        
00175   int exportToXML(StatusWidget* status, QString exportPath);
00176 
00178   void exportTopLevelImages();
00179 
00181   void exportSubalbumImages(StatusWidget* status, bool forceSave);
00182 
00185   void removeStagnantOrigFiles(StatusWidget* status);
00186   
00188   void reorderSubalbumImages(StatusWidget* status);
00189 
00191   void removeStagnantImages();
00192 
00194   void exportThemeResources( QString theme );
00195 
00197   QString name;
00198 
00200   QString description;
00201 
00203   QString author;
00204 
00206   QPixmap* smallRepresentativeImage;
00207   QPixmap* largeRepresentativeImage;
00208 
00210   Subalbum* firstSubalbum;
00211 
00213   Subalbum* lastSubalbum;
00214 
00216   int modificationYear;
00217 
00219   int modificationMonth;
00220 
00222   int modificationDay;
00223 
00225   int creationYear;
00226 
00228   int creationMonth;
00229 
00231   int creationDay;
00232 
00234   int numSubalbums;
00235 
00237   int numLoadedSubalbums;
00238 
00240   bool savedToDisk;
00241 
00243   QString saveLocation;
00244 
00245   //Last directory album was saved to
00246   QString oldSaveLocation;
00247   
00249   QString theme;
00250 
00252   bool modified;
00253   
00255   QString tmpDir;
00256   
00260   int nextUniqueID;
00261 //------------------------------------------------------
00262 };
00263 
00264 #endif //BACKEND_ALBUM_H

Generated on Thu Jan 3 10:54:40 2008 for AlbumShaper by  doxygen 1.5.4