00001 /* ============================================================ 00002 * File : mythnewsconfig.h 00003 * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu> 00004 * Date : 2003-09-02 00005 * Description : 00006 * 00007 * Copyright 2003 by Renchi Raju 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 MYTHNEWSCONFIG_H 00023 #define MYTHNEWSCONFIG_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 MythNewsConfigPriv; 00034 class NewsSiteItem; 00035 class UIListBtnType; 00036 00037 class MythNewsSpinBox : public MythSpinBox 00038 { 00039 public: 00040 00041 MythNewsSpinBox(QWidget* parent = 0, const char* widgetName = 0); 00042 00043 protected: 00044 00045 virtual bool eventFilter(QObject* o, QEvent* e); 00046 00047 }; 00048 00049 class MythNewsConfig : public MythDialog 00050 { 00051 Q_OBJECT 00052 00053 public: 00054 00055 MythNewsConfig(MythMainWindow *parent, 00056 const char *name = 0); 00057 ~MythNewsConfig(); 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 MythNewsConfigPriv *m_priv; 00082 00083 XMLParse *m_Theme; 00084 00085 QPixmap m_background; 00086 00087 uint m_Context; 00088 uint m_InColumn; 00089 00090 UIListBtnType *m_UICategory; 00091 UIListBtnType *m_UISite; 00092 00093 MythNewsSpinBox *m_SpinBox; 00094 00095 00096 QRect m_SiteRect; 00097 QRect m_FreqRect; 00098 00099 QTimer *m_updateFreqTimer; 00100 int m_updateFreq; 00101 00102 private slots: 00103 00104 void slotUpdateFreqChanged(); 00105 void slotUpdateFreqTimerTimeout(); 00106 void slotCategoryChanged(UIListBtnTypeItem* item); 00107 }; 00108 00109 #endif /* MYTHNEWSCONFIG_H */
1.5.5