AlbumShaper 1.0a3
subalbumWidget.h
Go to the documentation of this file.
1//Added by qt3to4:
2#include <QPixmap>
3#include <QResizeEvent>
4#include <Q3GridLayout>
5#include <Q3Frame>
6//==============================================
7// copyright : (C) 2003-2005 by Will Stokes
8//==============================================
9// This program is free software; you can redistribute it
10// and/or modify it under the terms of the GNU General
11// Public License as published by the Free Software
12// Foundation; either version 2 of the License, or
13// (at your option) any later version.
14//==============================================
15
16#ifndef GUI_SUBALBUMWIDGET_H
17#define GUI_SUBALBUMWIDGET_H
18
19//--------------------
20//forward declarations
21class Q3GridLayout;
22class QPixmap;
23class Q3IconView;
24class PhotosIconView;
25class QToolButton;
26class Q3Frame;
27class Subalbum;
28class LayoutWidget;
29class Photo;
30
31class Q3IconViewItem;
32//--------------------
33
34#include <qwidget.h>
35
36//=====================================
39//=====================================
40class SubalbumWidget : public QWidget
41{
42Q_OBJECT
43
44public:
47 QWidget *parent=0,
48 const char* name=0);
49
51 void setSubalbum(Subalbum* salbum);
52
55 void refreshPhotos();
56
58 void refreshAllPhotos();
59
62
65
68
70 void setSelectedPhoto(Photo* selection);
71
74
76 bool anyPhotosSelected();
77
80
83
85 void updateButtons(bool enable);
86
89
92//----------------------
93signals:
94 //signal emitted when the selection or the state of the selection changes
96//----------------------
97private slots:
99 void setWallpaperAction();
100
103
105 void updateButtons();
106
108 void addImageAction();
109 void addImageAction(QStringList fileNames, bool setDescriptions=false);
110
112 void removeImageAction();
113
115 void rotate90ImageAction();
116
119
120 //Rearranges subalbums in grid
121 void reorder();
122
123 //Deselect all photos
124 void deselectAll();
125 //----------------------
126protected:
127 void resizeEvent( QResizeEvent * );
128 //----------------------
129private:
131 Q3GridLayout* mainGrid;
132 Q3GridLayout* buttonsGrid;
133
137
140
143
145 QToolButton* addImage;
146
148 QToolButton* removeImage;
149
151 QToolButton* rotate90Image;
152
154 QToolButton* rotate270Image;
155
157 QToolButton* setDesktopBtn;
158
161
164
167//----------------------
168};
169//======================
170
171#endif //GUI_SUBALBUMWIDGET_H
Displays list of subalbums and a particular subalbum layout.
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Definition photo.h:45
Extension of iconview, used to list all photos in a subalbum. supports drag-n-drop within iconview.
Displays subalbum layout.
void rotate90ImageAction()
Rotate clockwise selected images.
Q3Frame * thumbnailFrame
Grid lower buttons are placed in.
bool wallpaperButtonState
cached enabled/distable state of set wallpaper button
Photo * getSelectedPhoto()
Returns currently selected photo. If no or multiple photos selected returns NULL.
void refreshPhotos()
clears and reinserts all photos for the current collection the current selection is cleared
void setSubalbum(Subalbum *salbum)
Resets the subalbum this subalbum widget is displaying.
void selectedPhotoStateChanged()
QToolButton * rotate270Image
"Rotate 270" button
void updateButtons()
Activates/Deactives remove/rotate buttons depending on if an image is selected.
void rotate270ImageAction()
Rotate counter-clockwise selected images.
void refreshAllPhotos()
refreshes all photos, selections are preserved
QToolButton * removeImage
"Remove" button
void addImageAction()
Adds an image to the subalbum.
void refreshSelectedPhotos()
refreshes selected photos, selections are preserved
Q3GridLayout * buttonsGrid
void setSelectedPhoto(Photo *selection)
Sets the selected photo to selection and ensures it is visible.
bool anyPhotosSelected()
Returns true if any phtos are selected.
SubalbumWidget(Subalbum *salbum, QWidget *parent=0, const char *name=0)
Creates layout based on backend object.
Q3IconView * getPhotos()
Returns pointer to icon view.
void setWallpaperAction()
set desktop wallpaper
QToolButton * rotate90Image
"Rotate 90" button
bool buttonsState
cached enabled/disabled state of buttons
LayoutWidget * layout
Pointer to the parent layout widget.
QToolButton * setDesktopBtn
Set desktop wallpaper button.
PhotosIconView * photos
Photos layout.
Q3GridLayout * mainGrid
Grids widgets are placed in.
Subalbum * subalbum
Pointer to backend subalbum.
void stripDescriptionsFromSelectedPhotos()
Strip descriptions from selected photos.
Q3Frame * buttonsFrame
QToolButton * addImage
"Add" button
void resizeEvent(QResizeEvent *)
Subalbum * getSubalbum()
returns a pointer to the backend subalbum
Photo * getFirstSelectedPhoto()
Returns first selected photo.
void revertSelectedPhotos()
Revert selected photos to their original form.
void selectionChangedEvent()
handles changing selections
void removeImageAction()
Remove an image from the subalbum.
bool anySelectedPhotosRevertable()
Returns true if any selected photos are revertable.
A subalbum contains photos.
Definition subalbum.h:49