Changed _optionList in AnnotationDialog/Dialog.cpp from Q3PtrList to QList
[kphotoalbum.git] / Viewer / ViewerWidget.h
blobfe123ccb0fa34b5406916862f3924d7cd61eec56
1 /* Copyright (C) 2003-2006 Jesper K. Pedersen <blackie@kde.org>
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public
5 License as published by the Free Software Foundation; either
6 version 2 of the License, or (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef VIEWER_H
20 #define VIEWER_H
22 #include <QStackedWidget>
23 #include <qimage.h>
24 #include <QPixmap>
25 #include "DB/ImageInfoPtr.h"
26 #include <config-kpa-exiv2.h>
28 class QKeyEvent;
29 class QResizeEvent;
30 class QWheelEvent;
31 class QContextMenuEvent;
32 class QStackedWidget;
33 class KActionCollection;
34 class QMenu;
35 class KAction;
37 namespace DB { class ImageInfo; class ResultId; }
38 namespace MainWindow { class ExternalPopup; class CategoryImagePopup; }
40 namespace Viewer
42 class VideoDisplay;
43 class ImageDisplay;
44 class TextDisplay;
45 class Display;
46 class SpeedDisplay;
47 class InfoBox;
49 class ViewerWidget :public QStackedWidget
51 Q_OBJECT
52 public:
53 ViewerWidget();
54 ~ViewerWidget();
55 static ViewerWidget* latest();
56 void load( const QStringList& list, int index = 0 );
57 void infoBoxMove();
58 bool showingFullScreen() const;
59 void setShowFullScreen( bool on );
60 void show( bool slideShow );
61 KActionCollection* actions();
63 public slots:
64 virtual bool close(bool alsoDelete = false );
65 void updateInfoBox();
66 void test();
67 void moveInfoBox( int );
69 signals:
70 void rotated();
71 void soughtTo( const DB::ResultId& id );
73 protected:
74 OVERRIDE void contextMenuEvent ( QContextMenuEvent * e );
75 OVERRIDE void resizeEvent( QResizeEvent* );
76 OVERRIDE void keyPressEvent( QKeyEvent* );
77 OVERRIDE void wheelEvent( QWheelEvent* event );
79 void moveInfoBox();
80 void setAsWallpaper(int mode);
82 void load();
83 void setupContextMenu();
84 void createShowContextMenu();
85 void createWallPaperMenu();
86 void createInvokeExternalMenu();
87 void createRotateMenu();
88 void createSkipMenu();
89 void createZoomMenu();
90 void createSlideShowMenu();
91 void createVideoMenu();
92 void createCategoryImageMenu();
93 void changeSlideShowInterval( int delta );
94 void createVideoViewer();
96 DB::ImageInfoPtr currentInfo() const;
97 friend class InfoBox;
99 private:
100 void showNextN(int);
101 void showPrevN(int);
103 protected slots:
104 void showNext();
105 void showNext10();
106 void showNext100();
107 void showNext1000();
108 void showPrev();
109 void showPrev10();
110 void showPrev100();
111 void showPrev1000();
112 void showFirst();
113 void showLast();
114 void removeCurrent();
115 void rotate90();
116 void rotate180();
117 void rotate270();
118 void toggleFullScreen();
119 void slotStartStopSlideShow();
120 void slotSlideShowNext();
121 void slotSlideShowNextFromTimer();
122 void slotSlideShowFaster();
123 void slotSlideShowSlower();
124 void editImage();
125 void slotSetStackHead();
126 void updateCategoryConfig();
127 void slotSetWallpaperC();
128 void slotSetWallpaperT();
129 void slotSetWallpaperCT();
130 void slotSetWallpaperCM();
131 void slotSetWallpaperTM();
132 void slotSetWallpaperS();
133 void slotSetWallpaperCAF();
134 void populateExternalPopup();
135 void populateCategoryImagePopup();
136 void videoStopped();
137 void showExifViewer();
138 void zoomIn();
139 void zoomOut();
140 void zoomFull();
141 void zoomPixelForPixel();
143 /** Set the current window title (filename) and add the given detail */
144 void setCaptionWithDetail( const QString& detail );
146 private:
147 static ViewerWidget* _latest;
149 QList<KAction*> _forwardActions;
150 QList<KAction*> _backwardActions;
152 KAction* _startStopSlideShow;
153 KAction* _slideShowRunFaster;
154 KAction* _slideShowRunSlower;
155 KAction* _setStackHead;
157 Display* _display;
158 ImageDisplay* _imageDisplay;
159 VideoDisplay* _videoDisplay;
160 TextDisplay* _textDisplay;
162 QStringList _list;
163 int _current;
164 QRect _textRect;
165 QMenu* _popup;
166 QMenu* _rotateMenu;
167 QMenu* _wallpaperMenu;
168 MainWindow::ExternalPopup* _externalPopup;
169 MainWindow::CategoryImagePopup* _categoryImagePopup;
170 int _width, _height;
171 QPixmap _pixmap;
173 KAction* _delete;
174 #ifdef HAVE_EXIV2
175 KAction* _showExifViewer;
176 #endif
178 InfoBox* _infoBox;
179 QImage _currentImage;
181 bool _showingFullScreen;
183 int _slideShowPause;
184 SpeedDisplay* _speedDisplay;
185 KActionCollection* _actions;
186 bool _forward;
187 QTimer* _slideShowTimer;
188 bool _isRunningSlideShow;
190 QList<QAction*> _videoActions;
191 KAction* _stop;
192 KAction* _playPause;
193 bool _videoPlayerStoppedManually;
198 #endif /* VIEWER_H */