AlbumShaper 1.0a3
subalbum.h
Go to the documentation of this file.
1//Added by qt3to4:
2#include <QPixmap>
3#include <Q3TextStream>
4//==============================================
5// copyright : (C) 2003-2005 by Will Stokes
6//==============================================
7// This program is free software; you can redistribute it
8// and/or modify it under the terms of the GNU General
9// Public License as published by the Free Software
10// Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//==============================================
13
14#ifndef BACKEND_SUBALBUM_H
15#define BACKEND_SUBALBUM_H
16
17//define representative image sizes
18#define SMALL 1
19#define MEDIUM 2
20#define LARGE 3
21
22//--------------------
23//forward declarations
24class QString;
25class QPixmap;
26class QDomNode;
27class Album;
28class Photo;
29class StatusWidget;
31//--------------------
32
33//=====================================
46//=====================================
47
49{
50//------------------------------------------------------
51public:
52
56
58 ~Subalbum();
59
61 void setName(QString val);
62
64 QString getName();
65
67 void setDescription(QString val);
68
70 QString getDescription();
71
73 QPixmap* getRepresentativeImage(int size);
74
76 void setRepresentativeImage(QString imageFilename);
77
80 bool addPhoto(QString fileName, bool replaceDescription = false, Photo* newPhoto = NULL);
81
83 bool lazyAddPhoto(QString imageName,
84 QString slideshowName,
85 QString thumbnailName,
86 Photo* newPhoto);
87
89 void addPhoto(Photo* newPhoto);
90
92 void photoMoved(Photo* val);
93
95 void removePhoto(Photo* val);
96
99
101 Subalbum* getNext();
102
104 void setPrev(Subalbum* val);
105
107 void setNext(Subalbum* val);
108
110 Photo* getFirst();
111
113 Photo* getLast();
114
116 void exportToXML(StatusWidget* status, Q3TextStream& stream);
117
119 void importFromDisk(QDomNode* root, int subalbumNum,
120 StatusWidget* status, QString dirName, bool disableCheckPhotoMods);
121
124
126 int getSubalbumNumber();
127
129 void setSubalbumNumber(int newVal);
130
132 int getNumPhotos();
133
135 int getNumLoadedPhotos();
136
137 //Resets the number of loaded photos in the subalbum to the number of photos in the subalbum
139
140 //Sets the subalbum as modified
141 void setModified();
142
144 Album* getAlbum();
145//------------------------------------------------------
146private:
149
152
155
157 QString name;
158
160 QString description;
161
162 //Small, medium, and large representative images
166
169
172
175
178
181//------------------------------------------------------
182};
183
184#endif //BACKEND_SUBALBUM_H
An album contains Subalbums.
Definition album.h:53
Displays photo thumbnail and description.
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Definition photo.h:45
A subalbum contains photos.
Definition subalbum.h:49
Subalbum * getPrev()
Returns pointer to prev subalbum.
Definition subalbum.cpp:97
int numPhotos
Number of photos in subalbum.
Definition subalbum.h:151
bool addPhoto(QString fileName, bool replaceDescription=false, Photo *newPhoto=NULL)
Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful.
Definition subalbum.cpp:198
int number
Subalbum Number.
Definition subalbum.h:148
int getNumPhotos()
Returns the number of photos in the subalbum.
Definition subalbum.cpp:104
Photo * getLast()
Returns last photo in subalbum.
Definition subalbum.cpp:101
QString name
Short Name for subalbum.
Definition subalbum.h:157
int getSubalbumNumber()
Returns subalbum number.
Definition subalbum.cpp:103
bool lazyAddPhoto(QString imageName, QString slideshowName, QString thumbnailName, Photo *newPhoto)
Lazily adds a new photo to the subalbum without rescaling from scrath, returns TRUE if successful.
Definition subalbum.cpp:252
void removePhoto(Photo *val)
Removes a specified photo.
Definition subalbum.cpp:281
void setSubalbumNumber(int newVal)
Sets the subalbum number to newVal.
Definition subalbum.cpp:170
Subalbum * getNext()
Returns pointer to next subalbum.
Definition subalbum.cpp:98
Subalbum * prevSubalbum
Pointer to prev subalbum.
Definition subalbum.h:174
void setRepresentativeImage(QString imageFilename)
sets a sized representative image
Definition subalbum.cpp:125
Album * albm
Pointer to album subalbum is in.
Definition subalbum.h:180
Subalbum * nextSubalbum
Pointer to next subalbum.
Definition subalbum.h:177
Photo * lastPhoto
Pointer to last photo.
Definition subalbum.h:171
void photoMoved(Photo *val)
Removes a specified photo without deleting the object.
Definition subalbum.cpp:484
QString getDescription()
Gets the Subalbum description.
Definition subalbum.cpp:85
void setName(QString val)
Sets the Subalbum Name.
Definition subalbum.cpp:107
Photo * firstPhoto
Pointer to first photo.
Definition subalbum.h:168
void setPrev(Subalbum *val)
Sets pointer of prev subalbum.
Definition subalbum.cpp:301
QString description
Longer description of subalbum.
Definition subalbum.h:160
QPixmap * getRepresentativeImage(int size)
gets a sized representative image
Definition subalbum.cpp:87
QString getName()
Gets the Subalbum Name.
Definition subalbum.cpp:84
void setModified()
Definition subalbum.cpp:172
Photo * getFirst()
Returns first photo in subalbum.
Definition subalbum.cpp:100
void resetNumLoadedPhotos()
Definition subalbum.cpp:171
Album * getAlbum()
returns the album pointer
Definition subalbum.cpp:95
void setNext(Subalbum *val)
Sets pointer of next subalbum.
Definition subalbum.cpp:307
int loadedPhotos
Number of photos in subalbum when last loaded.
Definition subalbum.h:154
void importFromDisk(QDomNode *root, int subalbumNum, StatusWidget *status, QString dirName, bool disableCheckPhotoMods)
Builds subalbum from XML DOM node.
Definition subalbum.cpp:350
QPixmap * largeRepresentativeImage
Definition subalbum.h:165
void setDescription(QString val)
Sets the Subalbum description.
Definition subalbum.cpp:116
QPixmap * mediumRepresentativeImage
Definition subalbum.h:164
int getNumLoadedPhotos()
Returns the number of loaded photos in subalbum.
Definition subalbum.cpp:105
~Subalbum()
Frees photos.
Definition subalbum.cpp:67
void exportToXML(StatusWidget *status, Q3TextStream &stream)
Exports subalbum to xml.
Definition subalbum.cpp:313
QPixmap * smallRepresentativeImage
Definition subalbum.h:163
void syncPhotoList(PhotoPreviewWidget *item)
Syncs photo ordering with front end gui ordering.
Definition subalbum.cpp:501
Subalbum(Album *albm, int number)
Sets default information.
Definition subalbum.cpp:36
StatusWidget * status