AlbumShaper
1.0a3
|
00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 #ifndef GUI_PHOTOSICONVIEW_H 00012 #define GUI_PHOTOSICONVIEW_H 00013 00014 //-------------------- 00015 //forward declarations 00016 class QPixmap; 00017 class QPainter; 00018 class PhotoPreviewWidget; 00019 class QPaintEvent; 00020 class PhotoDescEdit; 00021 //-------------------- 00022 00023 #include <qiconview.h> 00024 00025 //===================================== 00028 //===================================== 00029 class PhotosIconView : public QIconView 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 PhotosIconView( QWidget *parent ); 00035 00036 //returns the number of selected items 00037 int numSelected(); 00038 public slots: 00039 void clearPseudoSelection(); 00040 void repaintGroup( QIconViewItem* pseudoSelection); 00041 //---------------------- 00042 signals: 00043 void itemHasMoved(); 00044 void addPhotos(QStringList); 00045 00046 //the following signals are emitted in response to key events 00047 void removeSelectedPhotos(); 00048 void rotate90SelectedPhotos(); 00049 void rotate270SelectedPhotos(); 00050 void editSelectedPhoto(); 00051 //---------------------- 00052 protected: 00053 QDragObject *dragObject(); 00054 void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); 00055 void drawBackground( QPainter* p, const QRect& r); 00056 void contextMenuEvent ( QContextMenuEvent* e ); 00057 void contentsMouseMoveEvent( QMouseEvent *e); 00058 void contentsMousePressEvent ( QMouseEvent * e ); 00059 void keyPressEvent( QKeyEvent *e ); 00060 //---------------------- 00061 private slots: 00062 void setAlbumImage( ); 00063 void setSubalbumImage( ); 00064 void captureClick(QIconViewItem*, const QPoint&); 00065 //-- 00066 private: 00067 void contentsDropEvent( QDropEvent *e ); 00068 00069 bool findNearestUnselectedPhoto( const QPoint &pos, QIconViewItem** nearestItem, bool &posIsleftOfItem ); 00070 00071 PhotoPreviewWidget* rightClickedPhoto; 00072 QPixmap* backgroundImage; 00073 QPixmap bufferPixmap; 00074 QPixmap* dragIcon; 00075 PhotoPreviewWidget* currentPseudoSelection; 00076 bool handCursorShown; 00077 QPoint dragStartPos; 00078 00079 PhotoDescEdit* curPhotoDescEdit; 00080 //---------------------- 00081 }; 00082 //====================== 00083 00084 #endif //GUI_PHOTOSICONVIEW_H