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
24 class QString;
25 class QPixmap;
26 class QDomNode;
27 class Album;
28 class Photo;
29 class StatusWidget;
30 class PhotoPreviewWidget;
31 //--------------------
32 
33 //=====================================
46 //=====================================
47 
48 class Subalbum
49 {
50 //------------------------------------------------------
51 public:
52 
55  Subalbum(Album* albm, int number);
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 
98  Subalbum* getPrev();
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 
123  void syncPhotoList(PhotoPreviewWidget* item);
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
138  void resetNumLoadedPhotos();
139 
140  //Sets the subalbum as modified
141  void setModified();
142 
144  Album* getAlbum();
145 //------------------------------------------------------
146 private:
148  int number;
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
void resetNumLoadedPhotos()
Definition: subalbum.cpp:171
Photo * firstPhoto
Pointer to first photo.
Definition: subalbum.h:168
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
void importFromDisk(QDomNode *root, int subalbumNum, StatusWidget *status, QString dirName, bool disableCheckPhotoMods)
Builds subalbum from XML DOM node.
Definition: subalbum.cpp:350
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Definition: photo.h:44
int number
Subalbum Number.
Definition: subalbum.h:148
void setRepresentativeImage(QString imageFilename)
sets a sized representative image
Definition: subalbum.cpp:125
Photo * lastPhoto
Pointer to last photo.
Definition: subalbum.h:171
Displays photo thumbnail and description.
void exportToXML(StatusWidget *status, Q3TextStream &stream)
Exports subalbum to xml.
Definition: subalbum.cpp:313
void setPrev(Subalbum *val)
Sets pointer of prev subalbum.
Definition: subalbum.cpp:301
QPixmap * mediumRepresentativeImage
Definition: subalbum.h:164
Album * getAlbum()
returns the album pointer
Definition: subalbum.cpp:95
QString description
Longer description of subalbum.
Definition: subalbum.h:160
int getNumLoadedPhotos()
Returns the number of loaded photos in subalbum.
Definition: subalbum.cpp:105
void setNext(Subalbum *val)
Sets pointer of next subalbum.
Definition: subalbum.cpp:307
StatusWidget * status
A subalbum contains photos.
Definition: subalbum.h:48
int numPhotos
Number of photos in subalbum.
Definition: subalbum.h:151
~Subalbum()
Frees photos.
Definition: subalbum.cpp:67
Subalbum * prevSubalbum
Pointer to prev subalbum.
Definition: subalbum.h:174
int getNumPhotos()
Returns the number of photos in the subalbum.
Definition: subalbum.cpp:104
Subalbum(Album *albm, int number)
Sets default information is the Subalbum number.
Definition: subalbum.cpp:36
QPixmap * getRepresentativeImage(int size)
gets a sized representative image
Definition: subalbum.cpp:87
Photo * getFirst()
Returns first photo in subalbum.
Definition: subalbum.cpp:100
Album * albm
Pointer to album subalbum is in.
Definition: subalbum.h:180
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
Subalbum * nextSubalbum
Pointer to next subalbum.
Definition: subalbum.h:177
QString getName()
Gets the Subalbum Name.
Definition: subalbum.cpp:84
void setName(QString val)
Sets the Subalbum Name.
Definition: subalbum.cpp:107
An album contains Subalbums.
Definition: album.h:52
Subalbum * getNext()
Returns pointer to next subalbum.
Definition: subalbum.cpp:98
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
QPixmap * largeRepresentativeImage
Definition: subalbum.h:165
int getSubalbumNumber()
Returns subalbum number.
Definition: subalbum.cpp:103
QString name
Short Name for subalbum.
Definition: subalbum.h:157
void setDescription(QString val)
Sets the Subalbum description.
Definition: subalbum.cpp:116
void setSubalbumNumber(int newVal)
Sets the subalbum number to newVal.
Definition: subalbum.cpp:170
QPixmap * smallRepresentativeImage
Definition: subalbum.h:163
void syncPhotoList(PhotoPreviewWidget *item)
Syncs photo ordering with front end gui ordering.
Definition: subalbum.cpp:501
void setModified()
Definition: subalbum.cpp:172
Subalbum * getPrev()
Returns pointer to prev subalbum.
Definition: subalbum.cpp:97
void removePhoto(Photo *val)
Removes a specified photo.
Definition: subalbum.cpp:281
Photo * getLast()
Returns last photo in subalbum.
Definition: subalbum.cpp:101
int loadedPhotos
Number of photos in subalbum when last loaded.
Definition: subalbum.h:154