00001 #ifndef RSSEDITOR_H 00002 #define RSSEDITOR_H 00003 00004 // Qt headers 00005 #include <QMutex> 00006 #include <QString> 00007 #include <QDomDocument> 00008 #include <QNetworkRequest> 00009 #include <QNetworkReply> 00010 #include <QNetworkAccessManager> 00011 00012 // MythTV headers 00013 #include <mythscreentype.h> 00014 00015 #include "mythrssmanager.h" 00016 00017 class MythUITextEdit; 00018 class MythUIButton; 00019 class MythUICheckBox; 00020 class RSSSite; 00021 00025 class RSSEditPopup : public MythScreenType 00026 { 00027 Q_OBJECT 00028 00029 public: 00030 RSSEditPopup(const QString &url, bool edit, MythScreenStack *parent, 00031 const QString &name = "RSSEditPopup"); 00032 ~RSSEditPopup(); 00033 00034 bool Create(void); 00035 bool keyPressEvent(QKeyEvent*); 00036 00037 private: 00038 QUrl redirectUrl(const QUrl& possibleRedirectUrl, 00039 const QUrl& oldRedirectUrl) const; 00040 00041 RSSSite *m_site; 00042 QString m_urlText; 00043 bool m_editing; 00044 00045 MythUIImage *m_thumbImage; 00046 MythUIButton *m_thumbButton; 00047 MythUITextEdit *m_urlEdit; 00048 MythUITextEdit *m_titleEdit; 00049 MythUITextEdit *m_descEdit; 00050 MythUITextEdit *m_authorEdit; 00051 00052 MythUIButton *m_okButton; 00053 MythUIButton *m_cancelButton; 00054 00055 MythUICheckBox *m_download; 00056 00057 QNetworkAccessManager *m_manager; 00058 QNetworkReply *m_reply; 00059 00060 signals: 00061 void saving(void); 00062 00063 private slots: 00064 void slotCheckRedirect(QNetworkReply* reply); 00065 void parseAndSave(void); 00066 void slotSave(QNetworkReply *reply); 00067 void doFileBrowser(void); 00068 void SelectImagePopup(const QString &prefix, 00069 QObject &inst, 00070 const QString &returnEvent); 00071 void customEvent(QEvent *levent); 00072 }; 00073 00074 class RSSEditor : public MythScreenType 00075 { 00076 Q_OBJECT 00077 00078 public: 00079 RSSEditor(MythScreenStack *parent, 00080 const QString &name = "RSSEditor"); 00081 ~RSSEditor(); 00082 00083 bool Create(void); 00084 bool keyPressEvent(QKeyEvent*); 00085 00086 private: 00087 void fillRSSButtonList(); 00088 mutable QMutex m_lock; 00089 bool m_changed; 00090 00091 RSSSite::rssList m_siteList; 00092 MythUIButtonList *m_sites; 00093 MythUIButton *m_new; 00094 MythUIButton *m_delete; 00095 MythUIButton *m_edit; 00096 00097 MythUIImage *m_image; 00098 MythUIText *m_title; 00099 MythUIText *m_url; 00100 MythUIText *m_desc; 00101 MythUIText *m_author; 00102 00103 signals: 00104 void itemsChanged(void); 00105 00106 public slots: 00107 void slotItemChanged(); 00108 void loadData(void); 00109 00110 void slotDeleteSite(void); 00111 void doDeleteSite(bool remove); 00112 void slotEditSite(void); 00113 void slotNewSite(void); 00114 void listChanged(void); 00115 }; 00116 00117 #endif /* RSSEDITOR_H */
1.6.3