AlbumShaper
1.0a3
src
gui
presentation
presentationWidget.h
Go to the documentation of this file.
1
//==============================================
2
// copyright : (C) 2003-2005 by Will Stokes
3
//==============================================
4
// This program is free software; you can redistribute it
5
// and/or modify it under the terms of the GNU General
6
// Public License as published by the Free Software
7
// Foundation; either version 2 of the License, or
8
// (at your option) any later version.
9
//==============================================
10
11
#ifndef GUI_PRESENTATION_SLIDESHOWWIDGET_H
12
#define GUI_PRESENTATION_SLIDESHOWWIDGET_H
13
14
//--------------------
15
//forward declarations
16
//--------------------
17
class
Album
;
18
class
Subalbum
;
19
class
Photo
;
20
class
QTimer;
21
22
#include <qwidget.h>
23
#include <qimage.h>
24
#include <qpixmap.h>
25
#include <qdatetime.h>
26
#include <qmutex.h>
27
28
typedef
enum
29
{
30
AUTO_PLAY
,
31
IMMEDIATE
,
32
SCROLL_LEFT
,
33
SCROLL_RIGHT
,
34
SCROLL_UP
,
35
SCROLL_DOWN
36
}
ANIMATION_TYPE
;
37
38
//=====================================
39
class
SlideshowWidget
:
public
QWidget
40
{
41
Q_OBJECT
42
//----------------------
43
public
:
44
SlideshowWidget
(
QWidget
*parent=0,
const
char
* name=0, WFlags f=0 );
45
void
beginSlideshow
(
Album
* albm,
Subalbum
* startCollection=NULL,
Photo
* startPhoto=NULL);
46
48
Subalbum
*
getCurCollection
();
49
51
Photo
*
getCurPhoto
();
52
//----------------------
53
protected
:
54
void
paintEvent
( QPaintEvent* );
55
void
keyPressEvent
(QKeyEvent *e);
56
void
mousePressEvent
(QMouseEvent *e);
57
void
mouseMoveEvent
( QMouseEvent *e);
58
void
contextMenuEvent
( QContextMenuEvent* e );
59
60
void
showCoverPage
();
61
void
showCollectionPage
(
Subalbum
* subalbum);
62
void
loadPhoto
();
63
void
showPhoto
();
64
void
refreshScreen
();
65
void
paintOverlaidControls
();
66
void
exchangePhotos
();
67
//----------------------
68
signals:
69
void
endSlideshow
();
70
//----------------------
71
private
slots:
72
void
animate
();
73
74
//advance one photo
75
void
advancePhoto
();
76
77
//backup one photo
78
void
backupPhoto
();
79
80
//skip to first photo in collection
81
void
skipToFirstPhoto
();
82
83
//skip to last photo in collection
84
void
skipToLastPhoto
();
85
86
//advance one collection
87
void
advanceCollection
();
88
89
//backup one collection
90
void
backupCollection
();
91
92
//turn off mouse cursor
93
void
hideMouse
();
94
95
//toggle auto play
96
void
toggleAutoPlay
();
97
98
//end the slideshow
99
void
stop
();
100
101
//speed up presentation
102
void
speedUp
();
103
104
//slow down presentation
105
void
slowDown
();
106
107
//increse text font size
108
void
increaseTextSize
();
109
110
//decrease text font size
111
void
decreaseTextSize
();
112
113
//trap context menu hiding signals and store
114
//this info in a bool which disables moving on to the next phot in
115
//respone to a mouse press
116
void
contextMenuHiding
();
117
//----------------------
118
private
:
119
QString
themePath
;
120
Album
*
curAlbum
;
121
Subalbum
*
curCollection
;
122
Photo
*
curPhoto
;
123
124
int
photoNum
,
collectionNum
;
125
126
bool
photoLoaded
;
127
128
QImage
scaledImage1
,
scaledImage2
;
129
QImage*
currImage
;
130
QImage*
prevImage
;
131
132
QImage
Top_TextBorder
,
Bottom_TextBorder
,
133
Left_TextBorder
,
Right_TextBorder
,
134
TL_TextBorder
,
TR_TextBorder
,
135
BL_TextBorder
,
BR_TextBorder
;
136
137
//paint buffers
138
QPixmap *
paintBufferPrev
, *
paintBufferCurr
;
139
QPixmap
paintBuffer1
,
paintBuffer2
,
screenBuffer
;
140
141
//speed images
142
QImage
speed1
,
speed2
,
speed4
,
speed8
;
143
144
//control images
145
QImage
pauseInterface
,
playInterface
,
interfaceAlphaMask
;
146
147
//full screen size
148
int
screenWidth
,
screenHeight
;
149
150
//specs for ongoing animation
151
int
lastStep
,
step
;
152
double
initDelay
,
minDelay
,
delay
,
accel
;
153
154
//specs for autoplay
155
QTimer*
autoPlayTimer
;
156
int
autoPlayDelay
;
157
bool
autoPlay
;
158
bool
displayAutoPlayDelay
;
159
160
//timer and time variables for ongoing animation
161
QTimer *
animatingTimer
;
162
QTime
lastTime
,
currentTime
;
163
164
//animating variable and mutex
165
bool
animating
;
166
ANIMATION_TYPE
type
;
167
QMutex
animatingMutex
;
168
169
//display debug messages?
170
bool
displayDebugMessages
;
171
172
//font size
173
int
fontSize
;
174
175
//timer for turning off mouse cursor
176
QTimer *
mouseCursorTimer
;
177
bool
mouseShown
;
178
179
//right click context menu
180
bool
contextMenuShown
;
181
bool
contextMenuHidingBool
;
182
//----------------------
183
};
184
//======================
185
186
#endif
//GUI_PRESENTATION_SLIDESHOWWIDGET_H
Album
An album contains Subalbums.
Definition
album.h:53
Photo
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Definition
photo.h:45
QWidget
SlideshowWidget
Definition
presentationWidget.h:40
SlideshowWidget::collectionNum
int collectionNum
Definition
presentationWidget.h:124
SlideshowWidget::displayDebugMessages
bool displayDebugMessages
Definition
presentationWidget.h:170
SlideshowWidget::refreshScreen
void refreshScreen()
Definition
presentationWidget.cpp:961
SlideshowWidget::SlideshowWidget
SlideshowWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
Definition
presentationWidget.cpp:36
SlideshowWidget::showCoverPage
void showCoverPage()
Definition
presentationWidget.cpp:552
SlideshowWidget::mousePressEvent
void mousePressEvent(QMouseEvent *e)
Definition
presentationWidget.cpp:199
SlideshowWidget::animatingMutex
QMutex animatingMutex
Definition
presentationWidget.h:167
SlideshowWidget::stop
void stop()
Definition
presentationWidget.cpp:116
SlideshowWidget::backupCollection
void backupCollection()
Definition
presentationWidget.cpp:762
SlideshowWidget::endSlideshow
void endSlideshow()
SlideshowWidget::paintOverlaidControls
void paintOverlaidControls()
Definition
presentationWidget.cpp:976
SlideshowWidget::decreaseTextSize
void decreaseTextSize()
Definition
presentationWidget.cpp:604
SlideshowWidget::beginSlideshow
void beginSlideshow(Album *albm, Subalbum *startCollection=NULL, Photo *startPhoto=NULL)
Definition
presentationWidget.cpp:475
SlideshowWidget::toggleAutoPlay
void toggleAutoPlay()
Definition
presentationWidget.cpp:357
SlideshowWidget::loadPhoto
void loadPhoto()
Definition
presentationWidget.cpp:389
SlideshowWidget::screenWidth
int screenWidth
Definition
presentationWidget.h:148
SlideshowWidget::themePath
QString themePath
Definition
presentationWidget.h:119
SlideshowWidget::currentTime
QTime currentTime
Definition
presentationWidget.h:162
SlideshowWidget::Left_TextBorder
QImage Left_TextBorder
Definition
presentationWidget.h:133
SlideshowWidget::screenBuffer
QPixmap screenBuffer
Definition
presentationWidget.h:139
SlideshowWidget::interfaceAlphaMask
QImage interfaceAlphaMask
Definition
presentationWidget.h:145
SlideshowWidget::speed8
QImage speed8
Definition
presentationWidget.h:142
SlideshowWidget::autoPlay
bool autoPlay
Definition
presentationWidget.h:157
SlideshowWidget::playInterface
QImage playInterface
Definition
presentationWidget.h:145
SlideshowWidget::photoLoaded
bool photoLoaded
Definition
presentationWidget.h:126
SlideshowWidget::advanceCollection
void advanceCollection()
Definition
presentationWidget.cpp:728
SlideshowWidget::getCurCollection
Subalbum * getCurCollection()
returns a pointer to the currently visible collection
Definition
presentationWidget.cpp:1067
SlideshowWidget::animate
void animate()
Definition
presentationWidget.cpp:796
SlideshowWidget::slowDown
void slowDown()
Definition
presentationWidget.cpp:586
SlideshowWidget::Bottom_TextBorder
QImage Bottom_TextBorder
Definition
presentationWidget.h:132
SlideshowWidget::contextMenuHiding
void contextMenuHiding()
Definition
presentationWidget.cpp:345
SlideshowWidget::displayAutoPlayDelay
bool displayAutoPlayDelay
Definition
presentationWidget.h:158
SlideshowWidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *e)
Definition
presentationWidget.cpp:286
SlideshowWidget::paintBufferPrev
QPixmap * paintBufferPrev
Definition
presentationWidget.h:138
SlideshowWidget::BL_TextBorder
QImage BL_TextBorder
Definition
presentationWidget.h:135
SlideshowWidget::TL_TextBorder
QImage TL_TextBorder
Definition
presentationWidget.h:134
SlideshowWidget::showPhoto
void showPhoto()
Definition
presentationWidget.cpp:402
SlideshowWidget::speed4
QImage speed4
Definition
presentationWidget.h:142
SlideshowWidget::lastStep
int lastStep
Definition
presentationWidget.h:151
SlideshowWidget::minDelay
double minDelay
Definition
presentationWidget.h:152
SlideshowWidget::increaseTextSize
void increaseTextSize()
Definition
presentationWidget.cpp:598
SlideshowWidget::Top_TextBorder
QImage Top_TextBorder
Definition
presentationWidget.h:132
SlideshowWidget::lastTime
QTime lastTime
Definition
presentationWidget.h:162
SlideshowWidget::skipToLastPhoto
void skipToLastPhoto()
Definition
presentationWidget.cpp:699
SlideshowWidget::TR_TextBorder
QImage TR_TextBorder
Definition
presentationWidget.h:134
SlideshowWidget::backupPhoto
void backupPhoto()
Definition
presentationWidget.cpp:642
SlideshowWidget::mouseShown
bool mouseShown
Definition
presentationWidget.h:177
SlideshowWidget::autoPlayTimer
QTimer * autoPlayTimer
Definition
presentationWidget.h:155
SlideshowWidget::curCollection
Subalbum * curCollection
Definition
presentationWidget.h:121
SlideshowWidget::step
int step
Definition
presentationWidget.h:151
SlideshowWidget::getCurPhoto
Photo * getCurPhoto()
returns a pointer to the currently visible photo
Definition
presentationWidget.cpp:1069
SlideshowWidget::advancePhoto
void advancePhoto()
Definition
presentationWidget.cpp:610
SlideshowWidget::paintEvent
void paintEvent(QPaintEvent *)
Definition
presentationWidget.cpp:381
SlideshowWidget::mouseCursorTimer
QTimer * mouseCursorTimer
Definition
presentationWidget.h:176
SlideshowWidget::skipToFirstPhoto
void skipToFirstPhoto()
Definition
presentationWidget.cpp:671
SlideshowWidget::keyPressEvent
void keyPressEvent(QKeyEvent *e)
Definition
presentationWidget.cpp:140
SlideshowWidget::Right_TextBorder
QImage Right_TextBorder
Definition
presentationWidget.h:133
SlideshowWidget::animating
bool animating
Definition
presentationWidget.h:165
SlideshowWidget::prevImage
QImage * prevImage
Definition
presentationWidget.h:130
SlideshowWidget::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *e)
Definition
presentationWidget.cpp:264
SlideshowWidget::fontSize
int fontSize
Definition
presentationWidget.h:173
SlideshowWidget::paintBufferCurr
QPixmap * paintBufferCurr
Definition
presentationWidget.h:138
SlideshowWidget::currImage
QImage * currImage
Definition
presentationWidget.h:129
SlideshowWidget::speed2
QImage speed2
Definition
presentationWidget.h:142
SlideshowWidget::delay
double delay
Definition
presentationWidget.h:152
SlideshowWidget::curPhoto
Photo * curPhoto
Definition
presentationWidget.h:122
SlideshowWidget::hideMouse
void hideMouse()
Definition
presentationWidget.cpp:374
SlideshowWidget::autoPlayDelay
int autoPlayDelay
Definition
presentationWidget.h:156
SlideshowWidget::accel
double accel
Definition
presentationWidget.h:152
SlideshowWidget::contextMenuShown
bool contextMenuShown
Definition
presentationWidget.h:180
SlideshowWidget::speedUp
void speedUp()
Definition
presentationWidget.cpp:574
SlideshowWidget::exchangePhotos
void exchangePhotos()
Definition
presentationWidget.cpp:929
SlideshowWidget::pauseInterface
QImage pauseInterface
Definition
presentationWidget.h:145
SlideshowWidget::contextMenuHidingBool
bool contextMenuHidingBool
Definition
presentationWidget.h:181
SlideshowWidget::type
ANIMATION_TYPE type
Definition
presentationWidget.h:166
SlideshowWidget::initDelay
double initDelay
Definition
presentationWidget.h:152
SlideshowWidget::paintBuffer2
QPixmap paintBuffer2
Definition
presentationWidget.h:139
SlideshowWidget::scaledImage1
QImage scaledImage1
Definition
presentationWidget.h:128
SlideshowWidget::screenHeight
int screenHeight
Definition
presentationWidget.h:148
SlideshowWidget::paintBuffer1
QPixmap paintBuffer1
Definition
presentationWidget.h:139
SlideshowWidget::photoNum
int photoNum
Definition
presentationWidget.h:124
SlideshowWidget::showCollectionPage
void showCollectionPage(Subalbum *subalbum)
Definition
presentationWidget.cpp:559
SlideshowWidget::BR_TextBorder
QImage BR_TextBorder
Definition
presentationWidget.h:135
SlideshowWidget::speed1
QImage speed1
Definition
presentationWidget.h:142
SlideshowWidget::animatingTimer
QTimer * animatingTimer
Definition
presentationWidget.h:161
SlideshowWidget::curAlbum
Album * curAlbum
Definition
presentationWidget.h:120
SlideshowWidget::scaledImage2
QImage scaledImage2
Definition
presentationWidget.h:128
Subalbum
A subalbum contains photos.
Definition
subalbum.h:49
ANIMATION_TYPE
ANIMATION_TYPE
Definition
presentationWidget.h:29
AUTO_PLAY
@ AUTO_PLAY
Definition
presentationWidget.h:30
SCROLL_LEFT
@ SCROLL_LEFT
Definition
presentationWidget.h:32
IMMEDIATE
@ IMMEDIATE
Definition
presentationWidget.h:31
SCROLL_DOWN
@ SCROLL_DOWN
Definition
presentationWidget.h:35
SCROLL_RIGHT
@ SCROLL_RIGHT
Definition
presentationWidget.h:33
SCROLL_UP
@ SCROLL_UP
Definition
presentationWidget.h:34
Generated by
1.12.0