-
Notifications
You must be signed in to change notification settings - Fork 24
/
weatherplugin.h
56 lines (43 loc) · 1.59 KB
/
weatherplugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef WEATHERPlugin_H
#define WEATHERPlugin_H
#include "dde-dock/pluginsiteminterface.h"
#include "weatherwidget.h"
#include "forcastwidget.h"
#include <QTimer>
#include <QLabel>
#include <QLineEdit>
class WeatherPlugin : public QObject, PluginsItemInterface
{
Q_OBJECT
Q_INTERFACES(PluginsItemInterface)
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "weather.json")
public:
explicit WeatherPlugin(QObject *parent = 0);
const QString pluginName() const override;
const QString pluginDisplayName() const override;
void init(PluginProxyInterface *proxyInter) override;
void pluginStateSwitched() override;
bool pluginIsAllowDisable() override { return true; }
bool pluginIsDisable() override;
int itemSortKey(const QString &itemKey);
void setSortKey(const QString &itemKey, const int order);
QWidget *itemWidget(const QString &itemKey) override;
QWidget *itemTipsWidget(const QString &itemKey) override;
QWidget *itemPopupApplet(const QString &itemKey);
const QString itemContextMenu(const QString &itemKey) override;
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
private slots:
void weatherNow(QString weather, QString temp, QString stip, QPixmap pixmap);
private:
QPointer<WeatherWidget> m_centralWidget;
QPointer<QLabel> m_tipsLabel;
QTimer *m_refershTimer;
QSettings m_settings;
ForcastWidget *forcastApplet;
QLineEdit *lineEdit_iconPath;
void MBAbout();
void showMap();
void showLog();
void set();
};
#endif // WEATHERPlugin_H