| 1 | // Aseprite |
| 2 | // Copyright (C) 2001-2016 David Capello |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifndef APP_UI_NEWS_LISTBOX_H_INCLUDED |
| 8 | #define APP_UI_NEWS_LISTBOX_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "ui/listbox.h" |
| 12 | #include "ui/timer.h" |
| 13 | |
| 14 | #include <string> |
| 15 | |
| 16 | namespace app { |
| 17 | |
| 18 | class HttpLoader; |
| 19 | |
| 20 | class NewsListBox : public ui::ListBox { |
| 21 | public: |
| 22 | NewsListBox(); |
| 23 | ~NewsListBox(); |
| 24 | |
| 25 | void reload(); |
| 26 | |
| 27 | private: |
| 28 | bool onProcessMessage(ui::Message* msg) override; |
| 29 | void onTick(); |
| 30 | void parseFile(const std::string& filename); |
| 31 | bool validCache(const std::string& filename); |
| 32 | |
| 33 | ui::Timer m_timer; |
| 34 | HttpLoader* m_loader; |
| 35 | }; |
| 36 | |
| 37 | } // namespace app |
| 38 | |
| 39 | #endif |
| 40 | |