Hydra 0.20
hydra.src/desktop/MainImageView.h
00001 
00002 /*
00003  * Copyright (c) 2010 Aleksander B. Demko
00004  * This source code is distributed under the MIT license.
00005  * See the accompanying file LICENSE.MIT.txt for details.
00006  */
00007 
00008 #ifndef __INCLUDED_HYDRADESKTOP_MAINIMAGEVIEW_H__
00009 #define __INCLUDED_HYDRADESKTOP_MAINIMAGEVIEW_H__
00010 
00011 #include <desktop/View.h>
00012 #include <desktop/ImageCache.h>
00013 
00014 namespace desktop
00015 {
00016   class MainWindow; // forward
00017 
00018   class MainImageView;
00019 }
00020 
00021 class desktop::MainImageView : public desktop::View
00022 {
00023     Q_OBJECT
00024   public:
00025     /// constructor
00026     MainImageView(MainWindow *mainwin, FileList *_filelist, ImageCache *_loader);
00027 
00028     virtual void onImageChange(FileList *fl, int fileIndex);
00029 
00030     void showFullScreenMode(void);
00031 
00032   protected:
00033     virtual void resizeEvent(QResizeEvent *event);
00034     virtual void paintEvent(QPaintEvent *event);
00035     virtual void mousePressEvent(QMouseEvent * event);
00036     virtual void mouseDoubleClickEvent(QMouseEvent *event);
00037     virtual void timerEvent(QTimerEvent * event);
00038     virtual void keyPressEvent(QKeyEvent * event);
00039     virtual void contextMenuEvent(QContextMenuEvent * event);
00040 
00041   private slots:
00042     void onCurrentChanged(void);
00043 
00044   private:
00045     ImageCache *dm_loader;
00046 
00047     // used for double click detection
00048     int dm_timerid; // 0 for none
00049 
00050     bool dm_dirty;
00051     bool dm_fullscreenmode;
00052 
00053     desktop::cache_ptr<QImage> dm_image;
00054     QPixmap dm_pixmap;
00055 };
00056 
00057 #endif
00058 
 All Classes Namespaces Functions Variables