kylin-weather/controller/Interaction.h

282 lines
9.1 KiB
C
Raw Normal View History

2022-06-22 18:45:06 +08:00
#ifndef INTERACTION_H
#define INTERACTION_H
#include <QObject>
#include <QPixmap>
#include <QVariant>
#include <QFileInfo>
#include <QStandardItemModel>
#include "global/corevar.h"
#include <QPersistentModelIndex>
class coreinteraction;
class Interaction : public QObject
{
Q_OBJECT
signals:
/*
*
*
*
*
*
*/
void toStartView();
/*
* ui层传递无网络信息
*
*
* QString
*
*/
void netUiShow(QString);
/*
*
* 访--code值
*
* int
* 访
*/
void serverUiShow(QString);
/*
*
*
*
* QString
*
*/
void dataUiShow(QString);
/*
*
*
*
* QString
*
*/
void geoUiShow(QString);
/*
*
*
*
* bool
*
*/
void netTimeout(QString);
/*
*
*
*
* struct
*
*/
void showLifeStyle(LifeStyle m_lifeStyle); //发送信号,显示生活指数信息
/*
*
*
*
* struct
*
*/
void showCurrent(CurrentWeather m_currentWeather); //发送信号,显示当前城市信息
/*
*
*
*
* struct
*
*/
void showForcast(ForecastWeather forecastWeather); //发送信号,显示城市预测信息
/*
*
*
*
* QVariant
*
*/
void showHourly(QVariant var); //发送信号,显示逐小时信息
/*
* ui层传递无搜索结果信息
*
*
*
*
*/
void searchNull();
/*
* ui层传递搜索结果信息
* /
*
* bool
* /
*/
void searchUiShow(bool hasCity);
/*
*
*
*
*
*
*/
void collectNull();
/*
*
*
*
*
*
*/
void collectShow();
/*
*
* 退
*
*
*
*/
void closePro();
/*
*
*
*
*
*
*/
void showInCenter();
public:
/*
* UI层实例化接口对象
*
*
* Interaction
*
*/
static Interaction *getInstance();
/*
*
*
*
* QStringList
* QApplication::arguments()
*/
virtual void creatCore(const QStringList &list) = 0;
/*
*
*
*
*/
virtual void changeCity(QString cityCode) = 0; //切换到目标城市
/*
*
*
*
*/
virtual void searchResult(QString inputText) = 0; //切换到目标城市
/*
* model指针
*
*
* QTabelView
*/
virtual QStandardItemModel *getCityModel() = 0; //获取搜索model指针
/*
* model指针
*
*
* QTabelView
*/
virtual QStandardItemModel *getCollectModel() = 0; //获取收藏model指针
/*
*
*
*
*/
virtual void changeCityFromSearch(QModelIndex index) = 0; //切换到目标城市
/*
*
* +
*
*/
virtual void addCollectCity(QModelIndex index) = 0; //切换到目标城市
/*
*
*
*
*/
virtual void changeCityFromCollect(QModelIndex index) = 0; //切换到目标城市
/*
*
*
*
*/
virtual void delCollectCity(QModelIndex index) = 0; //切换到目标城市
/*
*
*
*
* QStringList
* QApplication::arguments()
*/
virtual void test() = 0;
/*
*
* show收藏城市列表时
*
*
*
*/
virtual void loadCollectCity() = 0;
/*
*
* show收藏城市列表时
*
*
*
*/
virtual void showCenterAfter() = 0;
/*
* 退
* 退
*
*
*
*/
virtual void closePrograme() = 0;
/*
*
*
*
*
*
*/
virtual void allowLocationYes() = 0;
/*
*
*
*
*
*
*/
virtual void allowLocationNo() = 0;
/*
*
*
*
*
*
*/
virtual void refresh() = 0;
private:
static Interaction *m_interaction; //单例指针
};
#endif // INTERACTION_H