Main Page   Compound List   File List   Compound Members   File Members  

subalbum.h

Go to the documentation of this file.
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 LoadDialog;
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, 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 exportThumbnailHTML(QTextStream& stream, int subalbumNumber);
00117   
00119   void exportSlideshowHTML(QTextStream& stream, int subalbumNumber);
00120   
00122   void importFromDisk(QDomNode* root, int subalbumNum, LoadDialog* dialog, QString dirName);
00123 
00125   void syncPhotoList(PhotoWidget* item);
00126   
00128   int getSubalbumNumber();
00129   
00131   int getNumPhotos();
00132 
00134   int getNumLoadedPhotos();  
00135 
00136   //Resets the number of loaded photos in the subalbum to the number of photos in the subalbum
00137   void resetNumLoadedPhotos();
00138 //------------------------------------------------------
00139 private:
00141   int number;
00142   
00144   int numPhotos;
00145   
00147   int loadedPhotos;
00148   
00150   QString name;
00151 
00153   QString description;
00154 
00155   //Small, medium, and large representative images
00156   QPixmap* smallRepresentativeImage;
00157   QPixmap* mediumRepresentativeImage;
00158   QPixmap* largeRepresentativeImage;
00159   
00161   Photo* firstPhoto;
00162 
00164   Photo* lastPhoto;
00165   
00167   Subalbum* nextSubalbum;
00168   
00170   Album* albm;
00171 //------------------------------------------------------
00172 };
00173 
00174 #endif //BACKEND_SUBALBUM_H

Generated on Tue Jun 10 23:41:21 2003 for AlbumShaper by doxygen 1.3.1