#ifndef FRMUPLOAD_H
#define FRMUPLOAD_H

#include <QWidget>
#include <QMouseEvent>
#include <QEvent>
#include <QDropEvent>
#include <QMoveEvent>
#include <QFileDialog>
#include <QMimeData>
#include <QDragEnterEvent>
#include <tchttpservice.h>
#include <QFileInfo>
#include <QClipboard>
#include <QPixmap>
#include <QMimeData>
#include <QDebug>
#include <QBuffer>
#include <QDateTime>
#include <QInputDialog>
#include <QButtonGroup>
#include <QThread>
#include "fileconfigdecode.h"
#include "tchttpservice.h"

#define DEBUG   1

typedef enum{
    COPY_TYPE_MARKDOWN = 0,
    COPY_TYPE_URL,
    COPY_TYPE_UBB,
    COPY_TYPE_HTML
} CopyType;

namespace Ui {
class FrmUpload;
}

class FrmUpload : public QWidget
{
    Q_OBJECT

public:
    explicit FrmUpload(QWidget *parent = nullptr);
    ~FrmUpload();

public slots:
    void slot_uploadFileSec(QString url);

protected:
    virtual bool eventFilter(QObject* watched, QEvent* event);
    virtual void dragEnterEvent(QDragEnterEvent *event) override;
    virtual void dropEvent(QDropEvent *event) override;

private slots:
    void on_btnFastUpload_clicked();

    void on_btnMarkdown_clicked();

    void on_btnUrl_clicked();

    void on_btnHTML_clicked();

    void on_btnUBB_clicked();

private:
    void initFrom();
    void initWidget();
    void uploadFiles(QStringList fileList);
    // 0 md 1 url
    CopyType copyType = COPY_TYPE_MARKDOWN;

private:
    Ui::FrmUpload *ui;
};

#endif // FRMUPLOAD_H
