unit Chilkat.MessageSet;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TMessageSet wraps CkMessageSet via the C bridge layer. }
  TMessageSet = 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  GetCount: Integer;
    function  GetHasUids: Boolean;
    procedure SetHasUids(AValue: Boolean);
  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 Count: Integer read GetCount;
    property HasUids: Boolean read GetHasUids write SetHasUids;

    function  ContainsId(msgId: LongWord): Boolean;
    function  FromCompactString(const str: string): Boolean;
    function  GetId(index: Integer): LongWord;
    procedure InsertId(id: LongWord);
    procedure RemoveId(id: LongWord);
    function  ToCommaSeparatedStr: string;
    function  ToCompactString: string;
    procedure Subtract(msgSet: TChilkatBase);
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkMessageSet_Create  = function(): Pointer; cdecl;
  TCkMessageSet_Dispose = procedure(handle: Pointer); cdecl;
  TCkMessageSet_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkMessageSet_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkMessageSet_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkMessageSet_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkMessageSet_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkMessageSet_get_Count = function(handle: Pointer): Integer; cdecl;
  TCkMessageSet_get_HasUids = function(handle: Pointer): LongBool; cdecl;
  TCkMessageSet_put_HasUids = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkMessageSet_ContainsId = function(handle: Pointer; msgId: LongWord): LongBool; cdecl;
  TCkMessageSet_FromCompactString = function(handle: Pointer; str: PAnsiChar): LongBool; cdecl;
  TCkMessageSet_GetId = function(handle: Pointer; index: Integer): LongWord; cdecl;
  TCkMessageSet_InsertId = procedure(handle: Pointer; id: LongWord); cdecl;
  TCkMessageSet_RemoveId = procedure(handle: Pointer; id: LongWord); cdecl;
  TCkMessageSet_ToCommaSeparatedStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_ToCompactString = function(handle: Pointer): PAnsiChar; cdecl;
  TCkMessageSet_Subtract = procedure(handle: Pointer; msgSet: Pointer); cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkMessageSet_Create:  TCkMessageSet_Create  = nil;
  CkMessageSet_Dispose: TCkMessageSet_Dispose = nil;
  CkMessageSet_get_LastErrorHtml: TCkMessageSet_get_LastErrorHtml = nil;
  CkMessageSet_get_LastErrorText: TCkMessageSet_get_LastErrorText = nil;
  CkMessageSet_get_LastErrorXml: TCkMessageSet_get_LastErrorXml = nil;
  CkMessageSet_get_Version: TCkMessageSet_get_Version = nil;
  CkMessageSet_get_DebugLogFilePath: TCkMessageSet_get_DebugLogFilePath = nil;
  CkMessageSet_put_DebugLogFilePath: TCkMessageSet_put_DebugLogFilePath = nil;
  CkMessageSet_get_VerboseLogging: TCkMessageSet_get_VerboseLogging = nil;
  CkMessageSet_put_VerboseLogging: TCkMessageSet_put_VerboseLogging = nil;
  CkMessageSet_get_LastMethodSuccess: TCkMessageSet_get_LastMethodSuccess = nil;
  CkMessageSet_put_LastMethodSuccess: TCkMessageSet_put_LastMethodSuccess = nil;
  CkMessageSet_get_Count: TCkMessageSet_get_Count = nil;
  CkMessageSet_get_HasUids: TCkMessageSet_get_HasUids = nil;
  CkMessageSet_put_HasUids: TCkMessageSet_put_HasUids = nil;
  CkMessageSet_ContainsId: TCkMessageSet_ContainsId = nil;
  CkMessageSet_FromCompactString: TCkMessageSet_FromCompactString = nil;
  CkMessageSet_GetId: TCkMessageSet_GetId = nil;
  CkMessageSet_InsertId: TCkMessageSet_InsertId = nil;
  CkMessageSet_RemoveId: TCkMessageSet_RemoveId = nil;
  CkMessageSet_ToCommaSeparatedStr: TCkMessageSet_ToCommaSeparatedStr = nil;
  CkMessageSet_ToCompactString: TCkMessageSet_ToCompactString = nil;
  CkMessageSet_Subtract: TCkMessageSet_Subtract = nil;

constructor TMessageSet.Create;
begin
  inherited Create;
  FHandle := CkMessageSet_Create();
end;

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

function TMessageSet.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkMessageSet_get_LastErrorHtml(FHandle));
end;

function TMessageSet.GetLastErrorText: string;
begin
  Result := CkToStr(CkMessageSet_get_LastErrorText(FHandle));
end;

function TMessageSet.GetLastErrorXml: string;
begin
  Result := CkToStr(CkMessageSet_get_LastErrorXml(FHandle));
end;

function TMessageSet.GetVersion: string;
begin
  Result := CkToStr(CkMessageSet_get_Version(FHandle));
end;

function TMessageSet.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkMessageSet_get_DebugLogFilePath(FHandle));
end;

procedure TMessageSet.SetDebugLogFilePath(AValue: string);
begin
  CkMessageSet_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TMessageSet.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkMessageSet_get_VerboseLogging(FHandle));
end;

procedure TMessageSet.SetVerboseLogging(AValue: Boolean);
begin
  CkMessageSet_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TMessageSet.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkMessageSet_get_LastMethodSuccess(FHandle));
end;

procedure TMessageSet.SetLastMethodSuccess(AValue: Boolean);
begin
  CkMessageSet_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TMessageSet.GetCount: Integer;
begin
  Result := CkMessageSet_get_Count(FHandle);
end;

function TMessageSet.GetHasUids: Boolean;
begin
  Result := Boolean(CkMessageSet_get_HasUids(FHandle));
end;

procedure TMessageSet.SetHasUids(AValue: Boolean);
begin
  CkMessageSet_put_HasUids(FHandle, LongBool(AValue));
end;

function TMessageSet.ContainsId(msgId: LongWord): Boolean;
begin
  Result := Boolean(CkMessageSet_ContainsId(FHandle, msgId));
end;

function TMessageSet.FromCompactString(const str: string): Boolean;
begin
  Result := Boolean(CkMessageSet_FromCompactString(FHandle, PAnsiChar(StrToCk(str))));
end;

function TMessageSet.GetId(index: Integer): LongWord;
begin
  Result := CkMessageSet_GetId(FHandle, index);
end;

procedure TMessageSet.InsertId(id: LongWord);
begin
  CkMessageSet_InsertId(FHandle, id);
end;

procedure TMessageSet.RemoveId(id: LongWord);
begin
  CkMessageSet_RemoveId(FHandle, id);
end;

function TMessageSet.ToCommaSeparatedStr: string;
begin
  Result := CkToStr(CkMessageSet_ToCommaSeparatedStr(FHandle));
end;

function TMessageSet.ToCompactString: string;
begin
  Result := CkToStr(CkMessageSet_ToCompactString(FHandle));
end;

procedure TMessageSet.Subtract(msgSet: TChilkatBase);
begin
  CkMessageSet_Subtract(FHandle, msgSet.Handle);
end;

initialization
  Chilkat_GetProcedureAddress(CkMessageSet_Create,  'CkMessageSet_Create');
  Chilkat_GetProcedureAddress(CkMessageSet_Dispose, 'CkMessageSet_Dispose');
  Chilkat_GetProcedureAddress(CkMessageSet_get_LastErrorHtml, 'CkMessageSet_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkMessageSet_get_LastErrorText, 'CkMessageSet_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkMessageSet_get_LastErrorXml, 'CkMessageSet_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkMessageSet_get_Version, 'CkMessageSet_get_Version');
  Chilkat_GetProcedureAddress(CkMessageSet_get_DebugLogFilePath, 'CkMessageSet_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkMessageSet_put_DebugLogFilePath, 'CkMessageSet_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkMessageSet_get_VerboseLogging, 'CkMessageSet_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkMessageSet_put_VerboseLogging, 'CkMessageSet_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkMessageSet_get_LastMethodSuccess, 'CkMessageSet_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkMessageSet_put_LastMethodSuccess, 'CkMessageSet_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkMessageSet_get_Count, 'CkMessageSet_get_Count');
  Chilkat_GetProcedureAddress(CkMessageSet_get_HasUids, 'CkMessageSet_get_HasUids');
  Chilkat_GetProcedureAddress(CkMessageSet_put_HasUids, 'CkMessageSet_put_HasUids');
  Chilkat_GetProcedureAddress(CkMessageSet_ContainsId, 'CkMessageSet_ContainsId');
  Chilkat_GetProcedureAddress(CkMessageSet_FromCompactString, 'CkMessageSet_FromCompactString');
  Chilkat_GetProcedureAddress(CkMessageSet_GetId, 'CkMessageSet_GetId');
  Chilkat_GetProcedureAddress(CkMessageSet_InsertId, 'CkMessageSet_InsertId');
  Chilkat_GetProcedureAddress(CkMessageSet_RemoveId, 'CkMessageSet_RemoveId');
  Chilkat_GetProcedureAddress(CkMessageSet_ToCommaSeparatedStr, 'CkMessageSet_ToCommaSeparatedStr');
  Chilkat_GetProcedureAddress(CkMessageSet_ToCompactString, 'CkMessageSet_ToCompactString');
  Chilkat_GetProcedureAddress(CkMessageSet_Subtract, 'CkMessageSet_Subtract');

end.
