-
Notifications
You must be signed in to change notification settings - Fork 3
/
Unit1.h
132 lines (124 loc) · 4.33 KB
/
Unit1.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// ---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
// ---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <IdBaseComponent.hpp>
#include <IdComponent.hpp>
#include <IdCustomTCPServer.hpp>
#include <IdTCPServer.hpp>
#include <IdUDPBase.hpp>
#include <IdUDPServer.hpp>
#include <Vcl.ComCtrls.hpp>
#include <IdContext.hpp>
#include <System.SysUtils.hpp>
#include <IdGlobal.hpp>
#include <IdSocketHandle.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <IdHTTP.hpp>
#include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp>
#include <Vcl.Menus.hpp>
#include <System.Actions.hpp>
#include <Vcl.ActnList.hpp>
#include <Vcl.ActnMan.hpp>
#include <Vcl.PlatformDefaultStyleActnCtrls.hpp>
// ---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TIdUDPServer *UDPServer;
TEdit *edtPort;
TUpDown *udPort;
TButton *btnStart;
TIdTCPServer *TCPServer;
TRadioButton *rdbTCP;
TRadioButton *rdbUDP;
TMemo *txtLog;
TTimer *Timer1;
TButton *btnStop;
TButton *btnGetPublicIP;
TEdit *edtPublicIP;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TLabel *Label4;
TLabel *Label5;
TLabel *lblScannerService;
TButton *btnOpenScanner;
TComboBox *cbPublicIPService;
TComboBox *cbScannerService;
TButton *btnCopyPort;
TButton *btnCopyPublicIP;
TCheckBox *chkAutoMode;
TTimer *tmrGetPublicIP;
TCheckBox *chkPortCheck;
TPanel *panelBottomMsg;
TRichEdit *reBottomMsg;
TButton *btnUpnp;
TPopupMenu *menuUpnp;
TMenuItem *OpenUPnPWizard1;
TMenuItem *Help1;
TButton *btnMap;
TTimer *tmrUI;
TLabel *Label6;
TLabel *Label7;
TCheckBox *chkPortSame;
TEdit *edtPortLocal;
TUpDown *udPortLocal;
TActionManager *ActionManager1;
TAction *ActionStop;
void __fastcall TCPServerAfterBind(TObject *Sender);
void __fastcall TCPServerConnect(TIdContext *AContext);
void __fastcall TCPServerDisconnect(TIdContext *AContext);
void __fastcall TCPServerStatus(TObject *ASender, const TIdStatus AStatus,
const UnicodeString AStatusText);
void __fastcall btnStartClick(TObject *Sender);
void __fastcall TCPServerExecute(TIdContext *AContext);
void __fastcall UDPServerAfterBind(TObject *Sender);
void __fastcall UDPServerStatus(TObject *ASender, const TIdStatus AStatus,
const UnicodeString AStatusText);
void __fastcall UDPServerUDPRead(TIdUDPListenerThread *AThread, const TIdBytes AData,
TIdSocketHandle *ABinding);
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall btnStopClick(TObject *Sender);
void __fastcall btnGetPublicIPClick(TObject *Sender);
void __fastcall btnOpenScannerClick(TObject *Sender);
void __fastcall btnCopyPortClick(TObject *Sender);
void __fastcall btnCopyPublicIPClick(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall rdbTCPClick(TObject *Sender);
void __fastcall edtPortChange(TObject *Sender);
void __fastcall edtPortExit(TObject *Sender);
void __fastcall cbPublicIPServiceEnter(TObject *Sender);
void __fastcall tmrGetPublicIPTimer(TObject *Sender);
void __fastcall chkAutoModeClick(TObject *Sender);
void __fastcall chkPortCheckClick(TObject *Sender);
void __fastcall Help1Click(TObject *Sender);
void __fastcall OpenUPnPWizard1Click(TObject *Sender);
void __fastcall btnUpnpClick(TObject *Sender);
void __fastcall btnMapClick(TObject *Sender);
void __fastcall tmrUITimer(TObject *Sender);
void __fastcall FormShow(TObject *Sender);
void __fastcall chkPortSameClick(TObject *Sender);
void __fastcall ActionStopExecute(TObject *Sender);
private: // User declarations
void __fastcall PortCheckThreadTerminated(TObject *Sender);
void AddToMemo(String msg);
void Stop();
String FormatScannerServiceURL(String url, String ip, String port);
void Load();
void Save();
void GetPublicIP();
void UpdateGUI();
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void Log(String msg);
};
// ---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
// ---------------------------------------------------------------------------
#endif