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
21 class Q3GridLayout;
22 class QPixmap;
23 class Q3IconView;
24 class PhotosIconView;
25 class QToolButton;
26 class Q3Frame;
27 class Subalbum;
28 class LayoutWidget;
29 class Photo;
30 
31 class Q3IconViewItem;
32 //--------------------
33 
34 #include <qwidget.h>
35 
36 //=====================================
39 //=====================================
40 class SubalbumWidget : public QWidget
41 {
42 Q_OBJECT
43 
44 public:
46  SubalbumWidget(Subalbum* salbum,
47  QWidget *parent=0,
48  const char* name=0);
49 
51  void setSubalbum(Subalbum* salbum);
52 
55  void refreshPhotos();
56 
58  void refreshAllPhotos();
59 
61  void refreshSelectedPhotos();
62 
65 
68 
70  void setSelectedPhoto(Photo* selection);
71 
74 
76  bool anyPhotosSelected();
77 
80 
83 
85  void updateButtons(bool enable);
86 
89 
91  void revertSelectedPhotos();
92 //----------------------
93 signals:
94  //signal emitted when the selection or the state of the selection changes
96 //----------------------
97 private slots:
99  void setWallpaperAction();
100 
102  void selectionChangedEvent();
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 
118  void rotate270ImageAction();
119 
120  //Rearranges subalbums in grid
121  void reorder();
122 
123  //Deselect all photos
124  void deselectAll();
125  //----------------------
126 protected:
127  void resizeEvent( QResizeEvent * );
128  //----------------------
129 private:
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
void addImageAction()
Adds an image to the subalbum.
bool wallpaperButtonState
cached enabled/distable state of set wallpaper button
void refreshSelectedPhotos()
refreshes selected photos, selections are preserved
Q3Frame * buttonsFrame
void removeImageAction()
Remove an image from the subalbum.
QToolButton * addImage
"Add" button
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Definition: photo.h:44
void rotate270ImageAction()
Rotate counter-clockwise selected images.
bool anySelectedPhotosRevertable()
Returns true if any selected photos are revertable.
void refreshAllPhotos()
refreshes all photos, selections are preserved
void setWallpaperAction()
set desktop wallpaper
void stripDescriptionsFromSelectedPhotos()
Strip descriptions from selected photos.
void resizeEvent(QResizeEvent *)
Photo * getSelectedPhoto()
Returns currently selected photo. If no or multiple photos selected returns NULL. ...
SubalbumWidget(Subalbum *salbum, QWidget *parent=0, const char *name=0)
Creates layout based on backend object.
void revertSelectedPhotos()
Revert selected photos to their original form.
QToolButton * rotate270Image
"Rotate 270" button
Displays list of subalbums and a particular subalbum layout.
Definition: layoutWidget.h:39
void setSelectedPhoto(Photo *selection)
Sets the selected photo to selection and ensures it is visible.
Photo * getFirstSelectedPhoto()
Returns first selected photo.
void selectedPhotoStateChanged()
void setSubalbum(Subalbum *salbum)
Resets the subalbum this subalbum widget is displaying.
Q3GridLayout * mainGrid
Grids widgets are placed in.
A subalbum contains photos.
Definition: subalbum.h:48
Q3GridLayout * buttonsGrid
Extension of iconview, used to list all photos in a subalbum. supports drag-n-drop within iconview...
bool buttonsState
cached enabled/disabled state of buttons
void refreshPhotos()
clears and reinserts all photos for the current collection the current selection is cleared ...
void updateButtons()
Activates/Deactives remove/rotate buttons depending on if an image is selected.
Q3Frame * thumbnailFrame
Grid lower buttons are placed in.
QToolButton * removeImage
"Remove" button
Subalbum * getSubalbum()
returns a pointer to the backend subalbum
QToolButton * rotate90Image
"Rotate 90" button
Displays subalbum layout.
bool anyPhotosSelected()
Returns true if any phtos are selected.
void rotate90ImageAction()
Rotate clockwise selected images.
QToolButton * setDesktopBtn
Set desktop wallpaper button.
PhotosIconView * photos
Photos layout.
void selectionChangedEvent()
handles changing selections
Q3IconView * getPhotos()
Returns pointer to icon view.
Subalbum * subalbum
Pointer to backend subalbum.
LayoutWidget * layout
Pointer to the parent layout widget.