unit Chilkat.HtmlToXml;

{
  Pascal wrapper for Chilkat HtmlToXml.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { THtmlToXml wraps CkHtmlToXml via the C bridge layer. }
  THtmlToXml = class(TChilkatBase)
  private
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetDropCustomTags: Boolean;
    procedure SetDropCustomTags(AValue: Boolean);
    function  GetHtml: string;
    procedure SetHtml(AValue: string);
    function  GetNbsp: Integer;
    procedure SetNbsp(AValue: Integer);
    function  GetXmlCharset: string;
    procedure SetXmlCharset(AValue: string);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property DropCustomTags: Boolean read GetDropCustomTags write SetDropCustomTags;
    property Html: string read GetHtml write SetHtml;
    property Nbsp: Integer read GetNbsp write SetNbsp;
    property XmlCharset: string read GetXmlCharset write SetXmlCharset;

    function  ConvertFile(const inHtmlPath: string; const destXmlPath: string): Boolean;
    procedure DropTagType(const tagName: string);
    procedure DropTextFormattingTags;
    function  SetHtmlFromFile(const filename: string): Boolean;
    function  ToXml: string;
    procedure UndropTagType(const tagName: string);
    procedure UndropTextFormattingTags;
    function  Xml: string;
    function  SetHtmlBd(bd: TChilkatBase): Boolean;
    function  ToXmlSb(sb: TChilkatBase): Boolean;
    function  SetHtmlSb(sb: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkHtmlToXml_Create  = function(): Pointer; cdecl;
  TCkHtmlToXml_Dispose = procedure(handle: Pointer); cdecl;
  TCkHtmlToXml_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHtmlToXml_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkHtmlToXml_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHtmlToXml_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkHtmlToXml_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHtmlToXml_get_DropCustomTags = function(handle: Pointer): LongBool; cdecl;
  TCkHtmlToXml_put_DropCustomTags = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHtmlToXml_get_Html = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_put_Html = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHtmlToXml_get_Nbsp = function(handle: Pointer): Integer; cdecl;
  TCkHtmlToXml_put_Nbsp = procedure(handle: Pointer; value: Integer); cdecl;
  TCkHtmlToXml_get_XmlCharset = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_put_XmlCharset = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHtmlToXml_ConvertFile = function(handle: Pointer; inHtmlPath: PAnsiChar; destXmlPath: PAnsiChar): LongBool; cdecl;
  TCkHtmlToXml_DropTagType = procedure(handle: Pointer; tagName: PAnsiChar); cdecl;
  TCkHtmlToXml_DropTextFormattingTags = procedure(handle: Pointer); cdecl;
  TCkHtmlToXml_SetHtmlFromFile = function(handle: Pointer; filename: PAnsiChar): LongBool; cdecl;
  TCkHtmlToXml_ToXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_UndropTagType = procedure(handle: Pointer; tagName: PAnsiChar); cdecl;
  TCkHtmlToXml_UndropTextFormattingTags = procedure(handle: Pointer); cdecl;
  TCkHtmlToXml_Xml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHtmlToXml_SetHtmlBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkHtmlToXml_ToXmlSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;
  TCkHtmlToXml_SetHtmlSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkHtmlToXml_Create:  TCkHtmlToXml_Create  = nil;
  CkHtmlToXml_Dispose: TCkHtmlToXml_Dispose = nil;
  CkHtmlToXml_get_LastErrorHtml: TCkHtmlToXml_get_LastErrorHtml = nil;
  CkHtmlToXml_get_LastErrorText: TCkHtmlToXml_get_LastErrorText = nil;
  CkHtmlToXml_get_LastErrorXml: TCkHtmlToXml_get_LastErrorXml = nil;
  CkHtmlToXml_get_Version: TCkHtmlToXml_get_Version = nil;
  CkHtmlToXml_get_DebugLogFilePath: TCkHtmlToXml_get_DebugLogFilePath = nil;
  CkHtmlToXml_put_DebugLogFilePath: TCkHtmlToXml_put_DebugLogFilePath = nil;
  CkHtmlToXml_get_VerboseLogging: TCkHtmlToXml_get_VerboseLogging = nil;
  CkHtmlToXml_put_VerboseLogging: TCkHtmlToXml_put_VerboseLogging = nil;
  CkHtmlToXml_get_LastMethodSuccess: TCkHtmlToXml_get_LastMethodSuccess = nil;
  CkHtmlToXml_put_LastMethodSuccess: TCkHtmlToXml_put_LastMethodSuccess = nil;
  CkHtmlToXml_get_DropCustomTags: TCkHtmlToXml_get_DropCustomTags = nil;
  CkHtmlToXml_put_DropCustomTags: TCkHtmlToXml_put_DropCustomTags = nil;
  CkHtmlToXml_get_Html: TCkHtmlToXml_get_Html = nil;
  CkHtmlToXml_put_Html: TCkHtmlToXml_put_Html = nil;
  CkHtmlToXml_get_Nbsp: TCkHtmlToXml_get_Nbsp = nil;
  CkHtmlToXml_put_Nbsp: TCkHtmlToXml_put_Nbsp = nil;
  CkHtmlToXml_get_XmlCharset: TCkHtmlToXml_get_XmlCharset = nil;
  CkHtmlToXml_put_XmlCharset: TCkHtmlToXml_put_XmlCharset = nil;
  CkHtmlToXml_ConvertFile: TCkHtmlToXml_ConvertFile = nil;
  CkHtmlToXml_DropTagType: TCkHtmlToXml_DropTagType = nil;
  CkHtmlToXml_DropTextFormattingTags: TCkHtmlToXml_DropTextFormattingTags = nil;
  CkHtmlToXml_SetHtmlFromFile: TCkHtmlToXml_SetHtmlFromFile = nil;
  CkHtmlToXml_ToXml: TCkHtmlToXml_ToXml = nil;
  CkHtmlToXml_UndropTagType: TCkHtmlToXml_UndropTagType = nil;
  CkHtmlToXml_UndropTextFormattingTags: TCkHtmlToXml_UndropTextFormattingTags = nil;
  CkHtmlToXml_Xml: TCkHtmlToXml_Xml = nil;
  CkHtmlToXml_SetHtmlBd: TCkHtmlToXml_SetHtmlBd = nil;
  CkHtmlToXml_ToXmlSb: TCkHtmlToXml_ToXmlSb = nil;
  CkHtmlToXml_SetHtmlSb: TCkHtmlToXml_SetHtmlSb = nil;

constructor THtmlToXml.Create;
begin
  inherited Create;
  FHandle := CkHtmlToXml_Create();
end;

destructor THtmlToXml.Destroy;
begin
  if FHandle <> nil then
    CkHtmlToXml_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

function THtmlToXml.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkHtmlToXml_get_LastErrorHtml(FHandle));
end;

function THtmlToXml.GetLastErrorText: string;
begin
  Result := CkToStr(CkHtmlToXml_get_LastErrorText(FHandle));
end;

function THtmlToXml.GetLastErrorXml: string;
begin
  Result := CkToStr(CkHtmlToXml_get_LastErrorXml(FHandle));
end;

function THtmlToXml.GetVersion: string;
begin
  Result := CkToStr(CkHtmlToXml_get_Version(FHandle));
end;

function THtmlToXml.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkHtmlToXml_get_DebugLogFilePath(FHandle));
end;

procedure THtmlToXml.SetDebugLogFilePath(AValue: string);
begin
  CkHtmlToXml_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THtmlToXml.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkHtmlToXml_get_VerboseLogging(FHandle));
end;

procedure THtmlToXml.SetVerboseLogging(AValue: Boolean);
begin
  CkHtmlToXml_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function THtmlToXml.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkHtmlToXml_get_LastMethodSuccess(FHandle));
end;

procedure THtmlToXml.SetLastMethodSuccess(AValue: Boolean);
begin
  CkHtmlToXml_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function THtmlToXml.GetDropCustomTags: Boolean;
begin
  Result := Boolean(CkHtmlToXml_get_DropCustomTags(FHandle));
end;

procedure THtmlToXml.SetDropCustomTags(AValue: Boolean);
begin
  CkHtmlToXml_put_DropCustomTags(FHandle, LongBool(AValue));
end;

function THtmlToXml.GetHtml: string;
begin
  Result := CkToStr(CkHtmlToXml_get_Html(FHandle));
end;

procedure THtmlToXml.SetHtml(AValue: string);
begin
  CkHtmlToXml_put_Html(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THtmlToXml.GetNbsp: Integer;
begin
  Result := CkHtmlToXml_get_Nbsp(FHandle);
end;

procedure THtmlToXml.SetNbsp(AValue: Integer);
begin
  CkHtmlToXml_put_Nbsp(FHandle, AValue);
end;

function THtmlToXml.GetXmlCharset: string;
begin
  Result := CkToStr(CkHtmlToXml_get_XmlCharset(FHandle));
end;

procedure THtmlToXml.SetXmlCharset(AValue: string);
begin
  CkHtmlToXml_put_XmlCharset(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THtmlToXml.ConvertFile(const inHtmlPath: string; const destXmlPath: string): Boolean;
begin
  Result := Boolean(CkHtmlToXml_ConvertFile(FHandle, PAnsiChar(StrToCk(inHtmlPath)), PAnsiChar(StrToCk(destXmlPath))));
end;

procedure THtmlToXml.DropTagType(const tagName: string);
begin
  CkHtmlToXml_DropTagType(FHandle, PAnsiChar(StrToCk(tagName)));
end;

procedure THtmlToXml.DropTextFormattingTags;
begin
  CkHtmlToXml_DropTextFormattingTags(FHandle);
end;

function THtmlToXml.SetHtmlFromFile(const filename: string): Boolean;
begin
  Result := Boolean(CkHtmlToXml_SetHtmlFromFile(FHandle, PAnsiChar(StrToCk(filename))));
end;

function THtmlToXml.ToXml: string;
begin
  Result := CkToStr(CkHtmlToXml_ToXml(FHandle));
end;

procedure THtmlToXml.UndropTagType(const tagName: string);
begin
  CkHtmlToXml_UndropTagType(FHandle, PAnsiChar(StrToCk(tagName)));
end;

procedure THtmlToXml.UndropTextFormattingTags;
begin
  CkHtmlToXml_UndropTextFormattingTags(FHandle);
end;

function THtmlToXml.Xml: string;
begin
  Result := CkToStr(CkHtmlToXml_Xml(FHandle));
end;

function THtmlToXml.SetHtmlBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHtmlToXml_SetHtmlBd(FHandle, bd.Handle));
end;

function THtmlToXml.ToXmlSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHtmlToXml_ToXmlSb(FHandle, sb.Handle));
end;

function THtmlToXml.SetHtmlSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHtmlToXml_SetHtmlSb(FHandle, sb.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkHtmlToXml_Create,  'CkHtmlToXml_Create');
  Chilkat_GetProcedureAddress(CkHtmlToXml_Dispose, 'CkHtmlToXml_Dispose');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_LastErrorHtml, 'CkHtmlToXml_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_LastErrorText, 'CkHtmlToXml_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_LastErrorXml, 'CkHtmlToXml_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_Version, 'CkHtmlToXml_get_Version');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_DebugLogFilePath, 'CkHtmlToXml_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_DebugLogFilePath, 'CkHtmlToXml_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_VerboseLogging, 'CkHtmlToXml_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_VerboseLogging, 'CkHtmlToXml_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_LastMethodSuccess, 'CkHtmlToXml_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_LastMethodSuccess, 'CkHtmlToXml_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_DropCustomTags, 'CkHtmlToXml_get_DropCustomTags');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_DropCustomTags, 'CkHtmlToXml_put_DropCustomTags');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_Html, 'CkHtmlToXml_get_Html');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_Html, 'CkHtmlToXml_put_Html');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_Nbsp, 'CkHtmlToXml_get_Nbsp');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_Nbsp, 'CkHtmlToXml_put_Nbsp');
  Chilkat_GetProcedureAddress(CkHtmlToXml_get_XmlCharset, 'CkHtmlToXml_get_XmlCharset');
  Chilkat_GetProcedureAddress(CkHtmlToXml_put_XmlCharset, 'CkHtmlToXml_put_XmlCharset');
  Chilkat_GetProcedureAddress(CkHtmlToXml_ConvertFile, 'CkHtmlToXml_ConvertFile');
  Chilkat_GetProcedureAddress(CkHtmlToXml_DropTagType, 'CkHtmlToXml_DropTagType');
  Chilkat_GetProcedureAddress(CkHtmlToXml_DropTextFormattingTags, 'CkHtmlToXml_DropTextFormattingTags');
  Chilkat_GetProcedureAddress(CkHtmlToXml_SetHtmlFromFile, 'CkHtmlToXml_SetHtmlFromFile');
  Chilkat_GetProcedureAddress(CkHtmlToXml_ToXml, 'CkHtmlToXml_ToXml');
  Chilkat_GetProcedureAddress(CkHtmlToXml_UndropTagType, 'CkHtmlToXml_UndropTagType');
  Chilkat_GetProcedureAddress(CkHtmlToXml_UndropTextFormattingTags, 'CkHtmlToXml_UndropTextFormattingTags');
  Chilkat_GetProcedureAddress(CkHtmlToXml_Xml, 'CkHtmlToXml_Xml');
  Chilkat_GetProcedureAddress(CkHtmlToXml_SetHtmlBd, 'CkHtmlToXml_SetHtmlBd');
  Chilkat_GetProcedureAddress(CkHtmlToXml_ToXmlSb, 'CkHtmlToXml_ToXmlSb');
  Chilkat_GetProcedureAddress(CkHtmlToXml_SetHtmlSb, 'CkHtmlToXml_SetHtmlSb');

end.
