00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef BACKEND_SUBALBUM_H
00012
#define BACKEND_SUBALBUM_H
00013
00014
00015 #define SMALL 1
00016 #define MEDIUM 2
00017 #define LARGE 3
00018
00019
00020
00021
class QString;
00022
class QPixmap;
00023
class QDomNode;
00024
class Album;
00025
class Photo;
00026
class StatusWidget;
00027
class PhotoPreviewWidget;
00028
00029
00030
00043
00044
00045 class Subalbum
00046 {
00047
00048
public:
00049
00052
Subalbum(
Album*
albm,
int number);
00053
00055
~Subalbum();
00056
00058
void setName(QString val);
00059
00061 QString
getName();
00062
00064
void setDescription(QString val);
00065
00067 QString
getDescription();
00068
00070 QPixmap*
getRepresentativeImage(
int size);
00071
00073
void setRepresentativeImage(QString imageFilename);
00074
00077
bool addPhoto(QString fileName,
bool replaceDescription =
false,
Photo* newPhoto = NULL);
00078
00080
bool lazyAddPhoto(QString imageName,
00081 QString slideshowName,
00082 QString thumbnailName,
00083
Photo* newPhoto);
00084
00086
void addPhoto(
Photo* newPhoto);
00087
00089
void photoMoved(
Photo* val);
00090
00092
void removePhoto(
Photo* val);
00093
00095
Subalbum*
getPrev();
00096
00098
Subalbum*
getNext();
00099
00101
void setPrev(
Subalbum* val);
00102
00104
void setNext(
Subalbum* val);
00105
00107
Photo*
getFirst();
00108
00110
Photo*
getLast();
00111
00113
void exportToXML(
StatusWidget*
status, QTextStream& stream);
00114
00116
void importFromDisk(QDomNode* root,
int subalbumNum,
00117
StatusWidget*
status, QString dirName,
bool disableCheckPhotoMods);
00118
00120
void syncPhotoList(
PhotoPreviewWidget* item);
00121
00123
int getSubalbumNumber();
00124
00126
void setSubalbumNumber(
int newVal);
00127
00129
int getNumPhotos();
00130
00132
int getNumLoadedPhotos();
00133
00134
00135
void resetNumLoadedPhotos();
00136
00137
00138
void setModified();
00139
00141
Album*
getAlbum();
00142
00143
private:
00145 int number;
00146
00148 int numPhotos;
00149
00151 int loadedPhotos;
00152
00154 QString
name;
00155
00157 QString
description;
00158
00159
00160 QPixmap*
smallRepresentativeImage;
00161 QPixmap*
mediumRepresentativeImage;
00162 QPixmap*
largeRepresentativeImage;
00163
00165 Photo*
firstPhoto;
00166
00168 Photo*
lastPhoto;
00169
00171 Subalbum*
prevSubalbum;
00172
00174 Subalbum*
nextSubalbum;
00175
00177 Album* albm;
00178
00179 };
00180
00181
#endif //BACKEND_SUBALBUM_H