AlbumShaper  1.0a3
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 {
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 
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;
123 
125 
127 
129  QImage* currImage;
130  QImage* prevImage;
131 
136 
137  //paint buffers
140 
141  //speed images
143 
144  //control images
146 
147  //full screen size
149 
150  //specs for ongoing animation
153 
154  //specs for autoplay
155  QTimer* autoPlayTimer;
157  bool autoPlay;
159 
160  //timer and time variables for ongoing animation
161  QTimer *animatingTimer;
163 
164  //animating variable and mutex
165  bool animating;
168 
169  //display debug messages?
171 
172  //font size
173  int fontSize;
174 
175  //timer for turning off mouse cursor
178 
179  //right click context menu
182 //----------------------
183 };
184 //======================
185 
186 #endif //GUI_PRESENTATION_SLIDESHOWWIDGET_H
ANIMATION_TYPE type
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Definition: photo.h:44
Subalbum * curCollection
SlideshowWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
void mouseMoveEvent(QMouseEvent *e)
void showCollectionPage(Subalbum *subalbum)
A subalbum contains photos.
Definition: subalbum.h:48
Photo * getCurPhoto()
returns a pointer to the currently visible photo
Subalbum * getCurCollection()
returns a pointer to the currently visible collection
void beginSlideshow(Album *albm, Subalbum *startCollection=NULL, Photo *startPhoto=NULL)
void contextMenuEvent(QContextMenuEvent *e)
An album contains Subalbums.
Definition: album.h:52
void keyPressEvent(QKeyEvent *e)
void mousePressEvent(QMouseEvent *e)
void paintEvent(QPaintEvent *)
ANIMATION_TYPE