unit Chilkat.DtObj;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TDtObj wraps CkDtObj via the C bridge layer. }
  TDtObj = 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  GetDay: Integer;
    procedure SetDay(AValue: Integer);
    function  GetHour: Integer;
    procedure SetHour(AValue: Integer);
    function  GetMinute: Integer;
    procedure SetMinute(AValue: Integer);
    function  GetMonth: Integer;
    procedure SetMonth(AValue: Integer);
    function  GetSecond: Integer;
    procedure SetSecond(AValue: Integer);
    function  GetStructTmMonth: Integer;
    procedure SetStructTmMonth(AValue: Integer);
    function  GetStructTmYear: Integer;
    procedure SetStructTmYear(AValue: Integer);
    function  GetUtc: Boolean;
    procedure SetUtc(AValue: Boolean);
    function  GetYear: Integer;
    procedure SetYear(AValue: Integer);
  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 Day: Integer read GetDay write SetDay;
    property Hour: Integer read GetHour write SetHour;
    property Minute: Integer read GetMinute write SetMinute;
    property Month: Integer read GetMonth write SetMonth;
    property Second: Integer read GetSecond write SetSecond;
    property StructTmMonth: Integer read GetStructTmMonth write SetStructTmMonth;
    property StructTmYear: Integer read GetStructTmYear write SetStructTmYear;
    property Utc: Boolean read GetUtc write SetUtc;
    property Year: Integer read GetYear write SetYear;

    procedure DeSerialize(const serializedDtObj: string);
    function  Serialize: string;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkDtObj_Create  = function(): Pointer; cdecl;
  TCkDtObj_Dispose = procedure(handle: Pointer); cdecl;
  TCkDtObj_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDtObj_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDtObj_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDtObj_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDtObj_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDtObj_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkDtObj_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkDtObj_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDtObj_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkDtObj_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDtObj_get_Day = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Day = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_Hour = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Hour = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_Minute = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Minute = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_Month = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Month = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_Second = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Second = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_StructTmMonth = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_StructTmMonth = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_StructTmYear = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_StructTmYear = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_get_Utc = function(handle: Pointer): LongBool; cdecl;
  TCkDtObj_put_Utc = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDtObj_get_Year = function(handle: Pointer): Integer; cdecl;
  TCkDtObj_put_Year = procedure(handle: Pointer; value: Integer); cdecl;
  TCkDtObj_DeSerialize = procedure(handle: Pointer; serializedDtObj: PAnsiChar); cdecl;
  TCkDtObj_Serialize = function(handle: Pointer): PAnsiChar; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkDtObj_Create:  TCkDtObj_Create  = nil;
  CkDtObj_Dispose: TCkDtObj_Dispose = nil;
  CkDtObj_get_LastErrorHtml: TCkDtObj_get_LastErrorHtml = nil;
  CkDtObj_get_LastErrorText: TCkDtObj_get_LastErrorText = nil;
  CkDtObj_get_LastErrorXml: TCkDtObj_get_LastErrorXml = nil;
  CkDtObj_get_Version: TCkDtObj_get_Version = nil;
  CkDtObj_get_DebugLogFilePath: TCkDtObj_get_DebugLogFilePath = nil;
  CkDtObj_put_DebugLogFilePath: TCkDtObj_put_DebugLogFilePath = nil;
  CkDtObj_get_VerboseLogging: TCkDtObj_get_VerboseLogging = nil;
  CkDtObj_put_VerboseLogging: TCkDtObj_put_VerboseLogging = nil;
  CkDtObj_get_LastMethodSuccess: TCkDtObj_get_LastMethodSuccess = nil;
  CkDtObj_put_LastMethodSuccess: TCkDtObj_put_LastMethodSuccess = nil;
  CkDtObj_get_Day: TCkDtObj_get_Day = nil;
  CkDtObj_put_Day: TCkDtObj_put_Day = nil;
  CkDtObj_get_Hour: TCkDtObj_get_Hour = nil;
  CkDtObj_put_Hour: TCkDtObj_put_Hour = nil;
  CkDtObj_get_Minute: TCkDtObj_get_Minute = nil;
  CkDtObj_put_Minute: TCkDtObj_put_Minute = nil;
  CkDtObj_get_Month: TCkDtObj_get_Month = nil;
  CkDtObj_put_Month: TCkDtObj_put_Month = nil;
  CkDtObj_get_Second: TCkDtObj_get_Second = nil;
  CkDtObj_put_Second: TCkDtObj_put_Second = nil;
  CkDtObj_get_StructTmMonth: TCkDtObj_get_StructTmMonth = nil;
  CkDtObj_put_StructTmMonth: TCkDtObj_put_StructTmMonth = nil;
  CkDtObj_get_StructTmYear: TCkDtObj_get_StructTmYear = nil;
  CkDtObj_put_StructTmYear: TCkDtObj_put_StructTmYear = nil;
  CkDtObj_get_Utc: TCkDtObj_get_Utc = nil;
  CkDtObj_put_Utc: TCkDtObj_put_Utc = nil;
  CkDtObj_get_Year: TCkDtObj_get_Year = nil;
  CkDtObj_put_Year: TCkDtObj_put_Year = nil;
  CkDtObj_DeSerialize: TCkDtObj_DeSerialize = nil;
  CkDtObj_Serialize: TCkDtObj_Serialize = nil;

constructor TDtObj.Create;
begin
  inherited Create;
  FHandle := CkDtObj_Create();
end;

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

function TDtObj.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkDtObj_get_LastErrorHtml(FHandle));
end;

function TDtObj.GetLastErrorText: string;
begin
  Result := CkToStr(CkDtObj_get_LastErrorText(FHandle));
end;

function TDtObj.GetLastErrorXml: string;
begin
  Result := CkToStr(CkDtObj_get_LastErrorXml(FHandle));
end;

function TDtObj.GetVersion: string;
begin
  Result := CkToStr(CkDtObj_get_Version(FHandle));
end;

function TDtObj.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkDtObj_get_DebugLogFilePath(FHandle));
end;

procedure TDtObj.SetDebugLogFilePath(AValue: string);
begin
  CkDtObj_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TDtObj.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkDtObj_get_VerboseLogging(FHandle));
end;

procedure TDtObj.SetVerboseLogging(AValue: Boolean);
begin
  CkDtObj_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TDtObj.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkDtObj_get_LastMethodSuccess(FHandle));
end;

procedure TDtObj.SetLastMethodSuccess(AValue: Boolean);
begin
  CkDtObj_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TDtObj.GetDay: Integer;
begin
  Result := CkDtObj_get_Day(FHandle);
end;

procedure TDtObj.SetDay(AValue: Integer);
begin
  CkDtObj_put_Day(FHandle, AValue);
end;

function TDtObj.GetHour: Integer;
begin
  Result := CkDtObj_get_Hour(FHandle);
end;

procedure TDtObj.SetHour(AValue: Integer);
begin
  CkDtObj_put_Hour(FHandle, AValue);
end;

function TDtObj.GetMinute: Integer;
begin
  Result := CkDtObj_get_Minute(FHandle);
end;

procedure TDtObj.SetMinute(AValue: Integer);
begin
  CkDtObj_put_Minute(FHandle, AValue);
end;

function TDtObj.GetMonth: Integer;
begin
  Result := CkDtObj_get_Month(FHandle);
end;

procedure TDtObj.SetMonth(AValue: Integer);
begin
  CkDtObj_put_Month(FHandle, AValue);
end;

function TDtObj.GetSecond: Integer;
begin
  Result := CkDtObj_get_Second(FHandle);
end;

procedure TDtObj.SetSecond(AValue: Integer);
begin
  CkDtObj_put_Second(FHandle, AValue);
end;

function TDtObj.GetStructTmMonth: Integer;
begin
  Result := CkDtObj_get_StructTmMonth(FHandle);
end;

procedure TDtObj.SetStructTmMonth(AValue: Integer);
begin
  CkDtObj_put_StructTmMonth(FHandle, AValue);
end;

function TDtObj.GetStructTmYear: Integer;
begin
  Result := CkDtObj_get_StructTmYear(FHandle);
end;

procedure TDtObj.SetStructTmYear(AValue: Integer);
begin
  CkDtObj_put_StructTmYear(FHandle, AValue);
end;

function TDtObj.GetUtc: Boolean;
begin
  Result := Boolean(CkDtObj_get_Utc(FHandle));
end;

procedure TDtObj.SetUtc(AValue: Boolean);
begin
  CkDtObj_put_Utc(FHandle, LongBool(AValue));
end;

function TDtObj.GetYear: Integer;
begin
  Result := CkDtObj_get_Year(FHandle);
end;

procedure TDtObj.SetYear(AValue: Integer);
begin
  CkDtObj_put_Year(FHandle, AValue);
end;

procedure TDtObj.DeSerialize(const serializedDtObj: string);
begin
  CkDtObj_DeSerialize(FHandle, PAnsiChar(StrToCk(serializedDtObj)));
end;

function TDtObj.Serialize: string;
begin
  Result := CkToStr(CkDtObj_Serialize(FHandle));
end;

initialization
  Chilkat_GetProcedureAddress(CkDtObj_Create,  'CkDtObj_Create');
  Chilkat_GetProcedureAddress(CkDtObj_Dispose, 'CkDtObj_Dispose');
  Chilkat_GetProcedureAddress(CkDtObj_get_LastErrorHtml, 'CkDtObj_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkDtObj_get_LastErrorText, 'CkDtObj_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkDtObj_get_LastErrorXml, 'CkDtObj_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkDtObj_get_Version, 'CkDtObj_get_Version');
  Chilkat_GetProcedureAddress(CkDtObj_get_DebugLogFilePath, 'CkDtObj_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkDtObj_put_DebugLogFilePath, 'CkDtObj_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkDtObj_get_VerboseLogging, 'CkDtObj_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkDtObj_put_VerboseLogging, 'CkDtObj_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkDtObj_get_LastMethodSuccess, 'CkDtObj_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkDtObj_put_LastMethodSuccess, 'CkDtObj_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkDtObj_get_Day, 'CkDtObj_get_Day');
  Chilkat_GetProcedureAddress(CkDtObj_put_Day, 'CkDtObj_put_Day');
  Chilkat_GetProcedureAddress(CkDtObj_get_Hour, 'CkDtObj_get_Hour');
  Chilkat_GetProcedureAddress(CkDtObj_put_Hour, 'CkDtObj_put_Hour');
  Chilkat_GetProcedureAddress(CkDtObj_get_Minute, 'CkDtObj_get_Minute');
  Chilkat_GetProcedureAddress(CkDtObj_put_Minute, 'CkDtObj_put_Minute');
  Chilkat_GetProcedureAddress(CkDtObj_get_Month, 'CkDtObj_get_Month');
  Chilkat_GetProcedureAddress(CkDtObj_put_Month, 'CkDtObj_put_Month');
  Chilkat_GetProcedureAddress(CkDtObj_get_Second, 'CkDtObj_get_Second');
  Chilkat_GetProcedureAddress(CkDtObj_put_Second, 'CkDtObj_put_Second');
  Chilkat_GetProcedureAddress(CkDtObj_get_StructTmMonth, 'CkDtObj_get_StructTmMonth');
  Chilkat_GetProcedureAddress(CkDtObj_put_StructTmMonth, 'CkDtObj_put_StructTmMonth');
  Chilkat_GetProcedureAddress(CkDtObj_get_StructTmYear, 'CkDtObj_get_StructTmYear');
  Chilkat_GetProcedureAddress(CkDtObj_put_StructTmYear, 'CkDtObj_put_StructTmYear');
  Chilkat_GetProcedureAddress(CkDtObj_get_Utc, 'CkDtObj_get_Utc');
  Chilkat_GetProcedureAddress(CkDtObj_put_Utc, 'CkDtObj_put_Utc');
  Chilkat_GetProcedureAddress(CkDtObj_get_Year, 'CkDtObj_get_Year');
  Chilkat_GetProcedureAddress(CkDtObj_put_Year, 'CkDtObj_put_Year');
  Chilkat_GetProcedureAddress(CkDtObj_DeSerialize, 'CkDtObj_DeSerialize');
  Chilkat_GetProcedureAddress(CkDtObj_Serialize, 'CkDtObj_Serialize');

end.
