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.
22 #include <QStackedWidget>
25 #include "DB/ImageInfoPtr.h"
26 #include <config-kpa-exiv2.h>
31 class QContextMenuEvent
;
33 class KActionCollection
;
37 namespace DB
{ class ImageInfo
; class ResultId
; }
38 namespace MainWindow
{ class ExternalPopup
; class CategoryImagePopup
; }
49 class ViewerWidget
:public QStackedWidget
55 static ViewerWidget
* latest();
56 void load( const QStringList
& list
, int index
= 0 );
58 bool showingFullScreen() const;
59 void setShowFullScreen( bool on
);
60 void show( bool slideShow
);
61 KActionCollection
* actions();
64 virtual bool close(bool alsoDelete
= false );
67 void moveInfoBox( int );
71 void soughtTo( const DB::ResultId
& id
);
74 OVERRIDE
void contextMenuEvent ( QContextMenuEvent
* e
);
75 OVERRIDE
void resizeEvent( QResizeEvent
* );
76 OVERRIDE
void keyPressEvent( QKeyEvent
* );
77 OVERRIDE
void wheelEvent( QWheelEvent
* event
);
80 void setAsWallpaper(int mode
);
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;
114 void removeCurrent();
118 void toggleFullScreen();
119 void slotStartStopSlideShow();
120 void slotSlideShowNext();
121 void slotSlideShowNextFromTimer();
122 void slotSlideShowFaster();
123 void slotSlideShowSlower();
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();
137 void showExifViewer();
141 void zoomPixelForPixel();
143 /** Set the current window title (filename) and add the given detail */
144 void setCaptionWithDetail( const QString
& detail
);
147 static ViewerWidget
* _latest
;
149 QList
<KAction
*> _forwardActions
;
150 QList
<KAction
*> _backwardActions
;
152 KAction
* _startStopSlideShow
;
153 KAction
* _slideShowRunFaster
;
154 KAction
* _slideShowRunSlower
;
155 KAction
* _setStackHead
;
158 ImageDisplay
* _imageDisplay
;
159 VideoDisplay
* _videoDisplay
;
160 TextDisplay
* _textDisplay
;
167 QMenu
* _wallpaperMenu
;
168 MainWindow::ExternalPopup
* _externalPopup
;
169 MainWindow::CategoryImagePopup
* _categoryImagePopup
;
175 KAction
* _showExifViewer
;
179 QImage _currentImage
;
181 bool _showingFullScreen
;
184 SpeedDisplay
* _speedDisplay
;
185 KActionCollection
* _actions
;
187 QTimer
* _slideShowTimer
;
188 bool _isRunningSlideShow
;
190 QList
<QAction
*> _videoActions
;
193 bool _videoPlayerStoppedManually
;
198 #endif /* VIEWER_H */