00001 /* ============================================================ 00002 * File : mythflixconfig.h 00003 * Author: John Petrocik <john@petrocik.net> 00004 * Date : 2005-10-28 00005 * Description : 00006 * 00007 * Copyright 2005 by John Petrocik 00008 00009 * This program is free software; you can redistribute it 00010 * and/or modify it under the terms of the GNU General 00011 * Public License as published bythe Free Software Foundation; 00012 * either version 2, or (at your option) 00013 * any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * ============================================================ */ 00021 00022 #ifndef MYTHFLIXCONFIG_H 00023 #define MYTHFLIXCONFIG_H 00024 00025 #include <mythtv/uitypes.h> 00026 #include <mythtv/uilistbtntype.h> 00027 #include <mythtv/xmlparse.h> 00028 #include <mythtv/mythdialogs.h> 00029 00030 class QTimer; 00031 class QPixmap; 00032 00033 class MythFlixConfigPriv; 00034 class NewsSiteItem; 00035 class UIListBtnType; 00036 00037 class MythFlixSpinBox : public MythSpinBox 00038 { 00039 public: 00040 00041 MythFlixSpinBox(QWidget* parent = 0, const char* widgetName = 0); 00042 00043 protected: 00044 00045 virtual bool eventFilter(QObject* o, QEvent* e); 00046 00047 }; 00048 00049 class MythFlixConfig : public MythDialog 00050 { 00051 Q_OBJECT 00052 00053 public: 00054 00055 MythFlixConfig(MythMainWindow *parent, 00056 const char *name = 0); 00057 ~MythFlixConfig(); 00058 00059 private: 00060 void changeContext(); 00061 void paintEvent(QPaintEvent *e); 00062 void keyPressEvent(QKeyEvent *e); 00063 00064 void populateSites(); 00065 void loadTheme(); 00066 00067 void updateBackground(); 00068 void updateSites(); 00069 void updateFreq(); 00070 00071 void cursorUp(bool page=false); 00072 void cursorDown(bool page=false); 00073 void cursorLeft(); 00074 void cursorRight(); 00075 00076 void toggleItem(UIListBtnTypeItem* item); 00077 bool findInDB(const QString& name); 00078 bool insertInDB(NewsSiteItem* site); 00079 bool removeFromDB(NewsSiteItem* site); 00080 00081 MythFlixConfigPriv *m_priv; 00082 00083 XMLParse *m_Theme; 00084 uint m_Context; 00085 uint m_InColumn; 00086 00087 UIListBtnType *m_UICategory; 00088 UIListBtnType *m_UISite; 00089 00090 MythFlixSpinBox *m_SpinBox; 00091 00092 QPixmap m_background; 00093 00094 QRect m_SiteRect; 00095 QRect m_FreqRect; 00096 00097 QTimer *m_updateFreqTimer; 00098 int m_updateFreq; 00099 00100 private slots: 00101 00102 void slotUpdateFreqChanged(); 00103 void slotUpdateFreqTimerTimeout(); 00104 void slotCategoryChanged(UIListBtnTypeItem* item); 00105 }; 00106 00107 #endif /* MYTHNEWSCONFIG_H */
1.5.5