mainform.h

来自「著名的SecureBlackBox控件完整源码」· C头文件 代码 · 共 99 行

H
99
字号
#undef SetPort
//---------------------------------------------------------------------------

#ifndef MainFormH
#define MainFormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ActnList.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
#include <ToolWin.hpp>

#include "SBIdSSHClient.hpp"
#include "SBSSHCommon.hpp"
#include "SBSSHConstants.hpp"
#include "SBUtils.hpp"
#include "SBSSHKeyStorage.hpp"

#include "ConnectionPropertiesForm.h"
#include "AboutForm.h"

//---------------------------------------------------------------------------
class TfrmMain : public TForm
{
__published:	// IDE-managed Components
        TSplitter *spLog;
        TStatusBar *StatusBar1;
        TToolBar *tbToolbar;
        TToolButton *tbConnect;
        TToolButton *tbDisconnect;
        TListView *lvLog;
        TPanel *Panel1;
        TRichEdit *reTerminal;
        TMainMenu *MainMenu;
        TMenuItem *File1;
        TMenuItem *Connect1;
        TMenuItem *Disconnect1;
        TMenuItem *N1;
        TMenuItem *Exit1;
        TMenuItem *Help1;
        TMenuItem *About1;
        TActionList *ActionList;
        TAction *actConnect;
        TAction *actDisconnect;
        TAction *actExit;
        TAction *actAbout;
        TImageList *imgListViews;
        void __fastcall Exit1Click(TObject *Sender);
        void __fastcall actConnectExecute(TObject *Sender);
        void __fastcall actDisconnectExecute(TObject *Sender);
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall actAboutExecute(TObject *Sender);
        void __fastcall reTerminalKeyPress(TObject *Sender, char &Key);
private:	// User declarations
        TElIdSSHClient* FSSHClient;
        TElShellSSHTunnel* FShellSSHTunnel;
        TElSSHMemoryKeyStorage* FKeyStorage;
        TElSSHTunnelConnection* FSSHTunnelConnection;
protected:
        void Log(const AnsiString S, bool Error = false);

        void __fastcall SSHClientAuthenticationFailed(TObject* Sender, int AuthType);
        void __fastcall SSHClientAuthenticationSuccess(TObject* Sender);
        void __fastcall SSHClientAuthenticationKeyboard(TObject* Sender, TStringList* Prompts, TBits* Echo, TStringList* Responses);
        void __fastcall SSHClientCloseConnection(TObject* Sender);
        void __fastcall SSHClientOpenConnection(TObject* Sender);
        void __fastcall SSHClientBanner(TObject* Sender, const AnsiString Text, const AnsiString Language);
        void __fastcall SSHClientError(TObject* Sender, int ErrorCode);
        void __fastcall SSHKeyValidate(TObject* Sender, TElSSHKey* ServerKey, bool &Validate);

        void __fastcall ShellSSHTunnelOpen(TObject* Sender, TElSSHTunnelConnection* TunnelConnection);
        void __fastcall ShellSSHTunnelError(TObject* Sender, int ErrorCode, void* Data);
        void __fastcall SSHTunnelConnectionData(TObject* Sender, void* Buffer, int Size);
        void __fastcall SSHTunnelConnectionClose(TObject* Sender, TSSHCloseType CloseType);
        void __fastcall SSHTunnelConnectionError(TObject* Sender, int ErrorCode);

public:		// User declarations
        __fastcall TfrmMain(TComponent* Owner);

        void Connect(void);
        void Disconnect(void);

        __property TElIdSSHClient* SSHClient = {read = FSSHClient};
        __property TElShellSSHTunnel* ShellSSHTunnel = {read = FShellSSHTunnel};
        __property TElSSHMemoryKeyStorage* KeyStorage = {read = FKeyStorage};
        __property TElSSHTunnelConnection* SSHTunnelConnection = {read = FSSHTunnelConnection};

};
//---------------------------------------------------------------------------
extern PACKAGE TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?