#ifndef OverbyteIcsSocksTst1H
#define OverbyteIcsSocksTst1H

#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>

#include "OverbyteIcsTypes.hpp"
#include "OverbyteIcsWSocket.hpp"
#include "OverbyteIcsWndControl.hpp"

class TSocksTestForm : public TForm
{
__published:
    TLabel *Label8;
    TMemo *DisplayMemo;
    TPanel *Panel1;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *Label3;
    TLabel *Label4;
    TLabel *Label5;
    TLabel *Label6;
    TLabel *Label7;
    TLabel *Label9;
    TLabel *Label10;
    TButton *ConnectButton;
    TButton *DisconnectButton;
    TEdit *TargetHostEdit;
    TEdit *TargetPortEdit;
    TEdit *SocksServerEdit;
    TEdit *SocksPortEdit;
    TEdit *SocksUsercodeEdit;
    TEdit *SocksPasswordEdit;
    TCheckBox *SocksAuthCheckBox;
    TButton *ClearButton;
    TRadioButton *Socks4RadioButton;
    TRadioButton *Socks5RadioButton;
    TRadioButton *HttpTunnelRadioButton;
    TEdit *ProxyUrlEdit;
    TEdit *CommandEdit;
    TButton *cmdButton;
    TCheckBox *SocksLogging;
    TWSocket *WSocket1;
    void __fastcall ConnectButtonClick(TObject *Sender);
    void __fastcall WSocket1SessionConnected(TObject *Sender, System::Word Error);
    void __fastcall WSocket1DataAvailable(TObject *Sender, System::Word Error);
    void __fastcall DisconnectButtonClick(TObject *Sender);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall FormShow(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall ClearButtonClick(TObject *Sender);
    void __fastcall cmdButtonClick(TObject *Sender);
    void __fastcall WSocket1DebugDisplay(TObject *Sender, const String Msg);

private:
    String FIniFileName;
    bool FInitialized = false;
    char FRcvBuf[2048];
    int FRcvCnt = 0;

public:
    __fastcall TSocksTestForm(TComponent *Owner);
};

extern PACKAGE TSocksTestForm *SocksTestForm;

#endif
