forked from neundorf/CuteCom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netproxyplugin.h
62 lines (53 loc) · 1.32 KB
/
netproxyplugin.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
57
58
59
60
61
62
#ifndef NETPROXYPLUGIN_H
#define NETPROXYPLUGIN_H
#include "netproxysettings.h"
#include "plugin.h"
#include "settings.h"
#include <QDebug>
#include <QFrame>
#include <QLabel>
namespace Ui
{
class NetProxyPlugin;
}
class NetActLed : public QObject
{
Q_OBJECT
public:
enum { LED_INTERVAL_MS = 250 };
NetActLed(NetProxySettings::en_led led_index, QLabel *led_icon, QTimer *tmr = 0)
: m_index(led_index)
, m_icon(led_icon)
, m_tmr(tmr)
{
}
NetProxySettings::en_led m_index;
QLabel *m_icon;
QTimer *m_tmr;
};
class NetProxyPlugin : public QFrame
{
Q_OBJECT
public:
explicit NetProxyPlugin(QFrame *parent = 0, Settings *settings = 0);
virtual ~NetProxyPlugin();
const Plugin *plugin();
int processCmd(const QString *text);
signals:
void sendCmd(QByteArray); /* netproxy -> plugin manager */
void proxyCmd(QByteArray); /* plugin manager -> netproxy */
void unload(Plugin *);
private slots:
void removePlugin(bool);
void ledSetValue(NetProxySettings::en_led, bool);
void tmrInterrupt(void);
void setUdpStatusText(bool, QString);
void setTcpStatusText(bool, QString);
private:
Settings *m_settings;
Ui::NetProxyPlugin *ui;
Plugin *m_plugin;
NetProxySettings *m_proxySettings;
NetActLed **m_leds;
};
#endif // NETPROXYPLUGIN_H