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_SUBALBUMSICONVIEW_H 00012 #define GUI_SUBALBUMSICONVIEW_H 00013 00014 //-------------------- 00015 //forward declarations 00016 class QPixmap; 00017 class QPainter; 00018 class QDragObject; 00019 class SubalbumPreviewWidget; 00020 //-------------------- 00021 00022 #include <qiconview.h> 00023 #include <qapplication.h> 00024 00025 //===================================== 00030 //===================================== 00031 class SubalbumsIconView : public QIconView 00032 { 00033 Q_OBJECT 00034 00035 public: 00036 SubalbumsIconView( QWidget *parent ); 00037 int getTextWidth(); 00038 00039 QSize minimumSizeHint() const; 00040 QSize sizeHint() const; 00041 00042 //---------------------- 00043 signals: 00044 void itemHasMoved(); 00045 //---------------------- 00046 protected: 00047 void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); 00048 QDragObject *dragObject(); 00049 00050 void contentsMousePressEvent( QMouseEvent * e ); 00051 void contentsDragMoveEvent( QDragMoveEvent* e ); 00052 //---------------------- 00053 private slots: 00054 void repaintGroup( QIconViewItem* pseudoSelection); 00055 void clearPseudoSelection(); 00056 //-- 00057 private: 00058 void contentsDropEvent( QDropEvent *e ); 00059 QPixmap bufferPixmap; 00060 QPoint dragStartPos; 00061 SubalbumPreviewWidget* currentPseudoSelection; 00062 00063 //width allocated to iconview items text. 00064 //IconViewItems will request this value when running calcRect() 00065 int textWidth; 00066 //---------------------- 00067 }; 00068 //====================== 00069 00070 00071 #endif //GUI_SUBALBUMSICONVIEW_H