📄 nmhtml.pas
字号:
unit NMHTML;
{wrapper and support classes for the NetManage/NetMasters HTML OCX}
interface
uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL, PSock, NMConst;
const
{ DocStateConstants }
icDocNone = 0;
icDocBegin = 1;
icDocHeaders = 2;
icDocData = 3;
icDocError = 4;
icDocEnd = 5;
const
{ Component class GUIDs }
Class_DocHeaderCls: TGUID = '{B7FC3591-8CE7-11CF-9754-00AA00C00908}';
Class_DocHeadersCls: TGUID = '{B7FC3593-8CE7-11CF-9754-00AA00C00908}';
Class_DocInputCls: TGUID = '{B7FC3596-8CE7-11CF-9754-00AA00C00908}';
Class_DocOutputCls: TGUID = '{B7FC3598-8CE7-11CF-9754-00AA00C00908}';
Class_icErrorCls: TGUID = '{B7FC35A1-8CE7-11CF-9754-00AA00C00908}';
Class_icErrorsCls: TGUID = '{B7FC35A3-8CE7-11CF-9754-00AA00C00908}';
const
LIBID_HTMLObjects: TGUID = '{B7FC354D-8CE7-11CF-9754-00AA00C00908}';
{ Component class GUIDs }
Class_HTMLElementCls: TGUID = '{B7FC3550-8CE7-11CF-9754-00AA00C00908}';
Class_HTMLFormCls: TGUID = '{B7FC3554-8CE7-11CF-9754-00AA00C00908}';
Class_HTMLFormsCls: TGUID = '{B7FC3557-8CE7-11CF-9754-00AA00C00908}';
Class_HTMLAttrCls: TGUID = '{B7FC3559-8CE7-11CF-9754-00AA00C00908}';
Class_HTMLAttrsCls: TGUID = '{B7FC355B-8CE7-11CF-9754-00AA00C00908}';
Class_HTML: TGUID = '{B7FC355E-8CE7-11CF-9754-00AA00C00908}';
type
{ Forward declarations }
{ Forward declarations: Interfaces }
DocHeader = interface;
DocHeaderDisp = dispinterface;
DocHeaders = interface;
DocHeadersDisp = dispinterface;
DocInput = interface;
DocInputDisp = dispinterface;
DocOutput = interface;
DocOutputDisp = dispinterface;
icError = interface;
icErrorDisp = dispinterface;
icErrors = interface;
icErrorsDisp = dispinterface;
{ Forward declarations: CoClasses }
DocHeaderCls = DocHeader;
DocHeadersCls = DocHeaders;
DocInputCls = DocInput;
DocOutputCls = DocOutput;
icErrorCls = icError;
icErrorsCls = icErrors;
{ Forward declarations: Enums }
DocStateConstants = TOleEnum;
HTMLElement = interface;
HTMLElementDisp = dispinterface;
HTMLForm = interface;
HTMLFormDisp = dispinterface;
HTMLForms = interface;
HTMLFormsDisp = dispinterface;
HTMLAttr = interface;
HTMLAttrDisp = dispinterface;
HTMLAttrs = interface;
HTMLAttrsDisp = dispinterface;
IHTML = interface;
IHTMLDisp = dispinterface;
DHTMLEvents = dispinterface;
{ Forward declarations: CoClasses }
HTMLElementCls = HTMLElement;
HTMLFormCls = HTMLForm;
HTMLFormsCls = HTMLForms;
HTMLAttrCls = HTMLAttr;
HTMLAttrsCls = HTMLAttrs;
HTML = IHTML;
{ NetManage Internet Control }
INMOleControl = interface(IDispatch)
['{B7FC35B6-8CE7-11CF-9754-00AA00C00908}']
function Get_Blocking: WordBool; safecall;
procedure Set_Blocking(Value: WordBool); safecall;
function Get_SleepTime: Integer; safecall;
procedure Set_SleepTime(Value: Integer); safecall;
function Get_BlockResult: Smallint; safecall;
procedure AboutBox; safecall;
property Blocking: WordBool read Get_Blocking write Set_Blocking;
property SleepTime: Integer read Get_SleepTime write Set_SleepTime;
property BlockResult: Smallint read Get_BlockResult;
end;
{ Internet DocHeader object properties and methods }
DocHeader = interface(IDispatch)
['{B7FC3590-8CE7-11CF-9754-00AA00C00908}']
function Get_Name: WideString; safecall;
procedure Set_Name(const Value: WideString); safecall;
function Get_Value: WideString; safecall;
procedure Set_Value(const Value: WideString); safecall;
procedure SetThisObject(var ThisObject: SYSINT); safecall;
property Name: WideString read Get_Name write Set_Name;
property Value: WideString read Get_Value write Set_Value;
end;
{ DispInterface declaration for Dual Interface DocHeader }
DocHeaderDisp = dispinterface
['{B7FC3590-8CE7-11CF-9754-00AA00C00908}']
property Name: WideString dispid 0;
property Value: WideString dispid 2;
procedure SetThisObject(var ThisObject: SYSINT); dispid 3;
end;
{ Internet DocHeaders collection properties and methods }
DocHeaders = interface(IDispatch)
['{B7FC3592-8CE7-11CF-9754-00AA00C00908}']
function Get_Count: Integer; safecall;
function Get_Text: WideString; safecall;
procedure Set_Text(const Value: WideString); safecall;
function Get__NewEnum: IUnknown; safecall;
function Item(Index: OleVariant): DocHeader; safecall;
function Add(const Name, Value: WideString): DocHeader; safecall;
procedure Remove(Index: OleVariant); safecall;
procedure Clear; safecall;
procedure SetThisObject(var ThisObject: SYSINT); safecall;
property Count: Integer read Get_Count;
property Text: WideString read Get_Text write Set_Text;
property _NewEnum: IUnknown read Get__NewEnum;
end;
{ DispInterface declaration for Dual Interface DocHeaders }
DocHeadersDisp = dispinterface
['{B7FC3592-8CE7-11CF-9754-00AA00C00908}']
property Count: Integer readonly dispid 1;
property Text: WideString dispid 2;
property _NewEnum: IUnknown readonly dispid -4;
function Item(Index: OleVariant): DocHeader; dispid 0;
function Add(const Name, Value: WideString): DocHeader; dispid 4;
procedure Remove(Index: OleVariant); dispid 5;
procedure Clear; dispid 6;
procedure SetThisObject(var ThisObject: SYSINT); dispid 7;
end;
{ Internet DocInput object properties and methods }
DocInput = interface(IDispatch)
['{B7FC3595-8CE7-11CF-9754-00AA00C00908}']
function Get_Headers: DocHeaders; safecall;
function Get_State: DocStateConstants; safecall;
function Get_BytesTotal: Integer; safecall;
function Get_BytesTransferred: Integer; safecall;
function Get_FileName: WideString; safecall;
procedure Set_FileName(const Value: WideString); safecall;
function Get_DocLink: IUnknown; safecall;
procedure Set_DocLink(Value: IUnknown); safecall;
function Get_Suspended: WordBool; safecall;
function Get_PushStreamMode: WordBool; safecall;
procedure Set_PushStreamMode(Value: WordBool); safecall;
procedure GetData(out Data: OleVariant; Type_: OleVariant); safecall;
procedure SetData(Data: OleVariant); safecall;
procedure Suspend(Suspend: WordBool); safecall;
function Get_CPPObject: SYSINT; safecall;
procedure Set_CPPObject(Value: SYSINT); safecall;
procedure PushStream; safecall;
function Get_Tag: OleVariant; safecall;
procedure Set_Tag(Value: OleVariant); safecall;
function Get_Errors: icErrors; safecall;
function Get_URL: WideString; safecall;
property Headers: DocHeaders read Get_Headers;
property State: DocStateConstants read Get_State;
property BytesTotal: Integer read Get_BytesTotal;
property BytesTransferred: Integer read Get_BytesTransferred;
property FileName: WideString read Get_FileName write Set_FileName;
property DocLink: IUnknown read Get_DocLink write Set_DocLink;
property Suspended: WordBool read Get_Suspended;
property PushStreamMode: WordBool read Get_PushStreamMode write Set_PushStreamMode;
property CPPObject: SYSINT read Get_CPPObject write Set_CPPObject;
property Tag: OleVariant read Get_Tag write Set_Tag;
property Errors: icErrors read Get_Errors;
property URL: WideString read Get_URL;
end;
{ DispInterface declaration for Dual Interface DocInput }
DocInputDisp = dispinterface
['{B7FC3595-8CE7-11CF-9754-00AA00C00908}']
property Headers: DocHeaders readonly dispid 2;
property State: DocStateConstants readonly dispid 3;
property BytesTotal: Integer readonly dispid 4;
property BytesTransferred: Integer readonly dispid 5;
property FileName: WideString dispid 6;
property DocLink: IUnknown dispid 7;
property Suspended: WordBool readonly dispid 11;
property PushStreamMode: WordBool dispid 12;
procedure GetData(out Data: OleVariant; Type_: OleVariant); dispid 9;
procedure SetData(Data: OleVariant); dispid 8;
procedure Suspend(Suspend: WordBool); dispid 10;
property CPPObject: SYSINT dispid 14;
procedure PushStream; dispid 13;
property Tag: OleVariant dispid 16;
property Errors: icErrors readonly dispid 17;
property URL: WideString readonly dispid 1;
end;
{ Internet DocOutput object properties and methods }
DocOutput = interface(IDispatch)
['{B7FC3597-8CE7-11CF-9754-00AA00C00908}']
function Get_Headers: DocHeaders; safecall;
function Get_State: DocStateConstants; safecall;
function Get_BytesTotal: Integer; safecall;
function Get_BytesTransferred: Integer; safecall;
function Get_FileName: WideString; safecall;
procedure Set_FileName(const Value: WideString); safecall;
function Get_DocLink: IUnknown; safecall;
function Get_Suspended: WordBool; safecall;
function Get_PushStreamMode: WordBool; safecall;
function Get_DataString: WideString; safecall;
function Get_DataBlock: OleVariant; safecall;
procedure GetData(out Data: OleVariant; Type_: OleVariant); safecall;
procedure SetData(Data: OleVariant); safecall;
procedure Suspend(Suspend: WordBool); safecall;
function Get_CPPObject: SYSINT; safecall;
procedure Set_CPPObject(Value: SYSINT); safecall;
function Get_AppendToFile: WordBool; safecall;
procedure Set_AppendToFile(Value: WordBool); safecall;
function Get_Tag: OleVariant; safecall;
procedure Set_Tag(Value: OleVariant); safecall;
function Get_Errors: icErrors; safecall;
function Get_URL: WideString; safecall;
property Headers: DocHeaders read Get_Headers;
property State: DocStateConstants read Get_State;
property BytesTotal: Integer read Get_BytesTotal;
property BytesTransferred: Integer read Get_BytesTransferred;
property FileName: WideString read Get_FileName write Set_FileName;
property DocLink: IUnknown read Get_DocLink;
property Suspended: WordBool read Get_Suspended;
property PushStreamMode: WordBool read Get_PushStreamMode;
property DataString: WideString read Get_DataString;
property DataBlock: OleVariant read Get_DataBlock;
property CPPObject: SYSINT read Get_CPPObject write Set_CPPObject;
property AppendToFile: WordBool read Get_AppendToFile write Set_AppendToFile;
property Tag: OleVariant read Get_Tag write Set_Tag;
property Errors: icErrors read Get_Errors;
property URL: WideString read Get_URL;
end;
{ DispInterface declaration for Dual Interface DocOutput }
DocOutputDisp = dispinterface
['{B7FC3597-8CE7-11CF-9754-00AA00C00908}']
property Headers: DocHeaders readonly dispid 2;
property State: DocStateConstants readonly dispid 3;
property BytesTotal: Integer readonly dispid 4;
property BytesTransferred: Integer readonly dispid 5;
property FileName: WideString dispid 6;
property DocLink: IUnknown readonly dispid 7;
property Suspended: WordBool readonly dispid 11;
property PushStreamMode: WordBool readonly dispid 12;
property DataString: WideString readonly dispid 19;
property DataBlock: OleVariant readonly dispid 18;
procedure GetData(out Data: OleVariant; Type_: OleVariant); dispid 9;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -