#ifndef MYNETWORKWIDGET_H
#define MYNETWORKWIDGET_H

#include <QWidget>
#include <QPluginLoader>

class Interface;
class MyTabWidget;
class MyNetworkWidget : public QWidget
{
    Q_OBJECT
public:
    explicit MyNetworkWidget(QWidget *parent = nullptr);

private Q_SLOTS:
    /**
         * @brief 网络窗口有线和无线弹窗切换事件，用于通知网络插件窗口切换
         * @param index   当前页面索引
         * @return
         */
    void onNetTabWidgetChanged(int index);
    void onUpdatePluginHidden();
    void showEvent(QShowEvent *event) ;
    void hideEvent(QHideEvent *event) ;
    void paintEvent(QPaintEvent *p1);

private:
    void loadNetPlugin();
    void unloadNetPlugin();
    void sendNetPluginVisible(bool visible);

    QPluginLoader netloader;
    QPluginLoader wlanloader;

    Interface          *netInterface = nullptr;
    Interface          *wlanInterface = nullptr;

    MyTabWidget        *tabWidget = nullptr;

    QWidget *netWidget = nullptr;
    QWidget *wlanWidget = nullptr;
    bool m_netTabShow = true;
    bool m_wlanTabShow = true;


};

#endif // WIDGET_H
