123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- /*
- * WeatherManager.h
- *
- * Created on: 2021年10月30日
- * Author: Administrator
- */
- #ifndef JNI_MANAGER_WEATHERMANAGER_H_
- #define JNI_MANAGER_WEATHERMANAGER_H_
- #include <string>
- #include <system/Thread.h>
- class WeatherManager : public Thread{
- private:
- //城市
- std::string m_city;
- //温度
- std::string m_temperature;
- //天气
- std::string m_weather;
- //天气图标
- std::string m_weaIcon;
- bool bforceSync;
- private:
- WeatherManager();
- virtual ~WeatherManager();
- public:
- /*
- * @brife 获取单例实例化对象
- * @return 类实例对象
- * */
- static WeatherManager* getInstance(void);
- /*
- * @brife 设置城市名称
- * @param city 城市名
- * */
- void setCityName(const std::string city);
- /*
- * @brife 获取城市名称
- * @return 城市名
- * */
- const std::string getCityName(void);
- /*
- * @brife 设置温度值
- * @param temperature 温度值
- * */
- void setTemperature(const std::string temperature);
- /*
- * @brife 获取温度值
- * @return 温度值
- * */
- const std::string getTemperature(void);
- /*
- * @brife 设置天气
- * @param weather 天气
- * */
- void setWeather(const std::string weather);
- /*
- * @brife 获取天气
- * @return 天气
- * */
- const std::string getWeather(void);
- /*
- * @brife 设置天气图标编号
- * @param weaIcon 图标编号
- * */
- void setWeaIcon(const std::string weaIcon);
- /*
- * @brife 获取天气图标编号
- * @return 图标编号
- * */
- const std::string getWeaIcon(void);
- /*
- * @brife 同步天气
- * */
- const int syncWeather(void);
- /**
- * @brife线程循环函数
- *
- * @return true 继续线程循环
- * false 推出线程
- */
- bool threadLoop();
- /*
- * @brife 天气同步UI刷新回调函数
- * */
- void (* updateUiCb)(void* args);
- void reqSyncWeather(){bforceSync = 1;}
- };
- #define WEATHERMANAGER WeatherManager::getInstance()
- #endif /* JNI_MANAGER_WEATHERMANAGER_H_ */
|