#ifndef __NOPACITY_RSSREADER_H #define __NOPACITY_RSSREADER_H #include #include #include #include #include #include #define NOPACITY_USERAGENT "libcurl-agent/1.0" struct XMLMemoryStruct { char *memory; size_t size; }; struct RssElement { std::string title; std::string content; int width; }; class cRssReader : public cThread{ public: cRssReader(cOsd *osd, cFont *font, cPoint position, cPoint size); ~cRssReader(); virtual void Action(void); void Stop(void) {Cancel(-1);}; void SetFeed(std::string feedUrl) {this->feedUrl = feedUrl;}; void SwitchNextMessage(void) {switchToNextMessage = true;}; private: cOsd *osd; cFont *font; cPixmap *pixmap; std::string feedUrl; int x, y; int width, height; void createPixmap(void); void drawText(void); int readRssURL(const char *url); void saveRss(void); void traverseTree(xmlNode * a_node, bool foundItem); void saveItem(void); void fadeInOut(bool fadeIn); XMLMemoryStruct xmlData; xmlDoc *doc; std::string title, content; std::vector rssElements; int currentElement; bool useProxy; std::string httpproxy; std::string separator; void DoSleep(int duration); bool switchToNextMessage; void debugRSS(void); }; class cRssStandaloneTicker { public: cRssStandaloneTicker(void); ~cRssStandaloneTicker(); void Start(void); void SetFeed(std::string feedName); void SwitchNextRssMessage(void); void SwitchNextRssFeed(void); private: int osdLeft; int osdTop; int osdWidth; int osdHeight; cRssReader *rssReader; cOsd *osd; cPixmap *pixmapFeed; cPixmap *pixmapBackground; cPixmap *pixmapIcon; cFont *font; int labelWidth; int currentFeed; void SetNextFeed(void); }; #endif //__NOPACITY_RSSREADER_H