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

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 //--------------------
00033 
00034 //=====================================
00047 //=====================================
00048 
00049 class Album
00050 {
00051 //------------------------------------------------------
00052 public:
00053 
00055   Album( QString tmpDir, bool createSubalbum = true );
00056 
00058   ~Album();
00059 
00061   void setName(QString val);
00062 
00064   QString getName();
00065 
00067   void setDescription(QString val);
00068 
00070   QString getDescription();
00071 
00073   void setAuthor(QString val);
00074 
00076   QString getAuthor();
00077 
00079   void setRepresentativeImages(QString imageFilename);
00080 
00082   QPixmap* getRepresentativeImage(int size);
00083 
00085   Subalbum* getFirstSubalbum();
00086 
00088   Subalbum* getLastSubalbum();
00089 
00091   void appendSubalbum(Subalbum* val);
00092 
00094   void removeSubalbum(Subalbum* val);
00095 
00097   int getModificationYear();
00098 
00100   int getModificationMonth();
00101 
00103   int getModificationDay();
00104 
00106   int getCreationYear();
00107 
00109   int getCreationMonth();
00110 
00112   int getCreationDay();
00113 
00115   void Album::updateCreationDate();
00116 
00118   void updateModificationDate();
00119 
00121   int importFromDisk(StatusWidget* status, QString fileName, bool disableCheckPhotoMods);
00122 
00124   int exportToDisk(StatusWidget* status, QString dirName, QString themeName);
00125 
00128   int exportToDisk(StatusWidget* status, bool forceSave=false);
00129 
00131   int exportCompressedWebAlbum(StatusWidget* status,
00132                                QString exportLocation,
00133                                QString exportMessage);
00134   
00137   int exportLargeImages(StatusWidget* status, QString exportPath, QString exportMessage);  
00138   
00140   bool prevSave();
00141 
00143   bool albumModified();
00144 
00146   void setModified(bool val=true);
00147 
00149   void syncSubalbumList(SubalbumPreviewWidget* item);
00150 
00152   QString getSaveLocation();
00153 
00155   int getNumPhotos();
00156   
00158   int getNumSubalbums();
00159   
00161   QString getTheme();
00162   
00164   QString getTmpDir();
00165   
00167   int getNextUniquePhotoID();
00168 //------------------------------------------------------
00169 private:        
00171   int exportToXML(StatusWidget* status, QString exportPath);
00172 
00174   void exportTopLevelImages();
00175 
00177   void exportSubalbumImages(StatusWidget* status, bool forceSave);
00178 
00181   void removeStagnantOrigFiles(StatusWidget* status);
00182   
00184   void reorderSubalbumImages(StatusWidget* status);
00185 
00187   void removeStagnantImages();
00188 
00190   void exportThemeResources( QString theme );
00191 
00193   QString name;
00194 
00196   QString description;
00197 
00199   QString author;
00200 
00202   QPixmap* smallRepresentativeImage;
00203   QPixmap* largeRepresentativeImage;
00204 
00206   Subalbum* firstSubalbum;
00207 
00209   Subalbum* lastSubalbum;
00210 
00212   int modificationYear;
00213 
00215   int modificationMonth;
00216 
00218   int modificationDay;
00219 
00221   int creationYear;
00222 
00224   int creationMonth;
00225 
00227   int creationDay;
00228 
00230   int numSubalbums;
00231 
00233   int numLoadedSubalbums;
00234 
00236   bool savedToDisk;
00237 
00239   QString saveLocation;
00240 
00242   QString theme;
00243 
00245   bool modified;
00246   
00248   QString tmpDir;
00249   
00253   int nextUniqueID;
00254 //------------------------------------------------------
00255 };
00256 
00257 #endif //BACKEND_ALBUM_H

Generated on Sat Apr 2 05:44:04 2005 for AlbumShaper by  doxygen 1.3.9.1