00001 /* 00002 Copyright (c) 2004 Koninklijke Philips Electronics NV. All rights reserved. 00003 Based on "iconview.h" of MythGallery. 00004 00005 This is free software; you can redistribute it and/or modify it under the 00006 terms of version 2 of the GNU General Public License as published by the 00007 Free Software Foundation. 00008 00009 This program is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00012 */ 00013 00014 #ifndef VIDEOGALLERY_H_ 00015 #define VIDEOGALLERY_H_ 00016 00017 #include "videodlg.h" 00018 00019 class UIListBtnTypeItem; 00020 00021 class VideoGallery : public VideoDialog 00022 { 00023 Q_OBJECT 00024 00025 public: 00026 VideoGallery(MythMainWindow *lparent, const QString &lname, 00027 VideoList *video_list); 00028 00029 protected slots: 00030 void moveCursor(const QString& action); 00031 void exitWin(); 00032 void slotChangeView(); 00033 void handleVideoSelect(); 00034 00035 protected: 00036 ~VideoGallery() {} // use deleteLater instead for thread safety 00037 virtual void parseContainer(QDomElement &element); 00038 virtual void fetchVideos(); 00039 void doMenu(bool info = false); 00040 void paintEvent(QPaintEvent *e); 00041 void keyPressEvent(QKeyEvent *e); 00042 bool handleSelect(); 00043 void handleDirSelect(); 00044 void handleUpDirSelect(); 00045 bool goBack(); 00046 00047 private: 00048 void LoadIconWindow(); 00049 00050 void updateText(QPainter *p); 00051 void updateView(QPainter *p); 00052 void updateArrows(QPainter *p); 00053 void updateSingleIcon(QPainter *p, int lx, int ly); 00054 void drawIcon(QPainter *p, GenericTree *curTreePos, int curPos, int xpos, 00055 int ypos); 00056 00057 void positionIcon(); 00058 00059 void computeLastRowCol(int list_count); 00060 00061 private: 00062 bool subtitleOn; 00063 bool keepAspectRatio; 00064 00065 QRect textRect; 00066 QRect viewRect; 00067 QRect arrowsRect; 00068 00069 QPixmap backRegPix; 00070 QPixmap backSelPix; 00071 QPixmap folderRegPix; 00072 QPixmap folderSelPix; 00073 00074 int currRow; 00075 int currCol; 00076 int lastRow; 00077 int lastCol; 00078 int topRow; 00079 int nRows; 00080 int nCols; 00081 00082 int spaceW; 00083 int spaceH; 00084 int thumbW; 00085 int thumbH; 00086 00087 bool allowselect; 00088 00089 GenericTree *video_tree_root; 00090 GenericTree *where_we_are; 00091 }; 00092 00093 #endif
1.5.5