00001 /* ============================================================ 00002 * File : iconview.h 00003 * Description : 00004 * 00005 00006 * This program is free software; you can redistribute it 00007 * and/or modify it under the terms of the GNU General 00008 * Public License as published bythe Free Software Foundation; 00009 * either version 2, or (at your option) 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * ============================================================ */ 00018 00019 #ifndef ICONVIEW_H 00020 #define ICONVIEW_H 00021 00022 // Qt headers 00023 #include <qstringlist.h> 00024 00025 // MythTV plugin headers 00026 #include <mythtv/mythdialogs.h> 00027 #include <mythtv/mythmedia.h> 00028 00029 // MythGallery headers 00030 #include "thumbview.h" 00031 00032 class XMLParse; 00033 class UIListBtnType; 00034 class ThumbGenerator; 00035 class MediaMonitor; 00036 00037 class IconView : public MythDialog 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 IconView(const QString &galleryDir, 00043 MythMediaDevice *initialDevice, 00044 MythMainWindow *parent); 00045 ~IconView(); 00046 00047 QString GetError(void) { return m_errorStr; } 00048 00049 protected: 00050 void paintEvent(QPaintEvent *e); 00051 void keyPressEvent(QKeyEvent *e); 00052 void customEvent(QCustomEvent *e); 00053 00054 private: 00055 void SetupMediaMonitor(void); 00056 00057 bool LoadTheme(void); 00058 bool LoadMenuTheme(void); 00059 bool LoadViewTheme(void); 00060 bool LoadThemeImages(void); 00061 00062 void updateBackground(); 00063 00064 void LoadDirectory(const QString &dir, bool topleft); 00065 00066 void UpdateMenu(void); 00067 void UpdateText(void); 00068 void UpdateView(void); 00069 00070 bool MoveUp(void); 00071 bool MoveDown(void); 00072 bool MoveLeft(void); 00073 bool MoveRight(void); 00074 00075 bool HandleEscape(void); 00076 bool HandleMediaEscape(MediaMonitor*); 00077 bool HandleSubDirEscape(const QString &parent); 00078 00079 bool HandleItemSelect(const QString &action); 00080 bool HandleMediaDeviceSelect(ThumbItem *item); 00081 bool HandleImageSelect(const QString &action); 00082 00083 void HandleMainMenu(void); 00084 void HandleSubMenuMetadata(void); 00085 void HandleSubMenuMark(void); 00086 void HandleSubMenuFile(void); 00087 00088 void HandleRotateCW(void); 00089 void HandleRotateCCW(void); 00090 void HandleDeleteCurrent(void); 00091 void HandleSlideShow(void); 00092 void HandleRandomShow(void); 00093 void HandleSettings(void); 00094 void HandleEject(void); 00095 void HandleImport(void); 00096 void HandleShowDevices(void); 00097 void HandleCopyHere(void); 00098 void HandleMoveHere(void); 00099 void HandleDelete(void); 00100 void HandleDeleteMarked(void); 00101 void HandleClearMarked(void); 00102 void HandleSelectAll(void); 00103 void HandleMkDir(void); 00104 void HandleRename(void); 00105 00106 void HandleMenuButtonPress(void); 00107 00108 void LoadThumbnail(ThumbItem *item); 00109 void ImportFromDir(const QString &fromDir, const QString &toDir); 00110 void CopyMarkedFiles(bool move = false); 00111 00112 void ClearMenu(UIListBtnType *menu); 00113 00114 QPtrList<ThumbItem> m_itemList; 00115 QDict<ThumbItem> m_itemDict; 00116 QStringList m_itemMarked; 00117 QString m_galleryDir; 00118 00119 XMLParse *m_theme; 00120 QRect m_menuRect; 00121 QRect m_textRect; 00122 QRect m_viewRect; 00123 QRect m_iconRect; 00124 00125 bool m_inMenu; 00126 bool m_inSubMenu; 00127 UIListBtnType *m_menuType; 00128 UIListBtnType *m_submenuType; 00129 00130 QPixmap m_background; 00131 QPixmap m_backRegPix; 00132 QPixmap m_backSelPix; 00133 QPixmap m_folderRegPix; 00134 QPixmap m_folderSelPix; 00135 QPixmap m_MrkPix; 00136 00137 bool m_isGallery; 00138 bool m_showDevices; 00139 QString m_currDir; 00140 MythMediaDevice *m_currDevice; 00141 00142 int m_currRow; 00143 int m_currCol; 00144 int m_lastRow; 00145 int m_lastCol; 00146 int m_topRow; 00147 int m_nRows; 00148 int m_nCols; 00149 00150 int m_spaceW; 00151 int m_spaceH; 00152 int m_thumbW; 00153 int m_thumbH; 00154 00155 ThumbGenerator *m_thumbGen; 00156 00157 int m_showcaption; 00158 int m_sortorder; 00159 bool m_useOpenGL; 00160 bool m_recurse; 00161 QStringList m_paths; 00162 00163 QString m_errorStr; 00164 00165 typedef void (IconView::*MenuAction)(void); 00166 00167 public slots: 00168 void mediaStatusChanged(MediaStatus oldStatus, MythMediaDevice *pMedia); 00169 }; 00170 00171 00172 #endif /* ICONVIEW_H */
1.5.5