diff options
Diffstat (limited to 'xbmc/utils/RssReader.h')
| -rw-r--r-- | xbmc/utils/RssReader.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/xbmc/utils/RssReader.h b/xbmc/utils/RssReader.h new file mode 100644 index 0000000..6e259ff --- /dev/null +++ b/xbmc/utils/RssReader.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "XBDateTime.h" | ||
| 12 | #include "threads/CriticalSection.h" | ||
| 13 | #include "threads/Thread.h" | ||
| 14 | #include "utils/IRssObserver.h" | ||
| 15 | #include "utils/XBMCTinyXML.h" | ||
| 16 | |||
| 17 | #include <list> | ||
| 18 | #include <string> | ||
| 19 | #include <vector> | ||
| 20 | |||
| 21 | class CRssReader : public CThread | ||
| 22 | { | ||
| 23 | public: | ||
| 24 | CRssReader(); | ||
| 25 | ~CRssReader() override; | ||
| 26 | |||
| 27 | void Create(IRssObserver* aObserver, const std::vector<std::string>& aUrl, const std::vector<int>& times, int spacesBetweenFeeds, bool rtl); | ||
| 28 | bool Parse(const std::string& data, int iFeed, const std::string& charset); | ||
| 29 | void getFeed(vecText &text); | ||
| 30 | void AddTag(const std::string &addTag); | ||
| 31 | void AddToQueue(int iAdd); | ||
| 32 | void UpdateObserver(); | ||
| 33 | void SetObserver(IRssObserver* observer); | ||
| 34 | void CheckForUpdates(); | ||
| 35 | void requestRefresh(); | ||
| 36 | float m_savedScrollPixelPos; | ||
| 37 | |||
| 38 | private: | ||
| 39 | void Process() override; | ||
| 40 | bool Parse(int iFeed); | ||
| 41 | void GetNewsItems(TiXmlElement* channelXmlNode, int iFeed); | ||
| 42 | void AddString(std::wstring aString, int aColour, int iFeed); | ||
| 43 | void UpdateFeed(); | ||
| 44 | void OnExit() override; | ||
| 45 | int GetQueueSize(); | ||
| 46 | |||
| 47 | IRssObserver* m_pObserver; | ||
| 48 | |||
| 49 | std::vector<std::wstring> m_strFeed; | ||
| 50 | std::vector<std::wstring> m_strColors; | ||
| 51 | std::vector<KODI::TIME::SystemTime*> m_vecTimeStamps; | ||
| 52 | std::vector<int> m_vecUpdateTimes; | ||
| 53 | int m_spacesBetweenFeeds; | ||
| 54 | CXBMCTinyXML m_xml; | ||
| 55 | std::list<std::string> m_tagSet; | ||
| 56 | std::vector<std::string> m_vecUrls; | ||
| 57 | std::vector<int> m_vecQueue; | ||
| 58 | bool m_bIsRunning; | ||
| 59 | bool m_rtlText; | ||
| 60 | bool m_requestRefresh; | ||
| 61 | |||
| 62 | CCriticalSection m_critical; | ||
| 63 | }; | ||
