unit WS_General_API_caller_main;

interface

uses Sysutils, Windows,
     WS_General_API_types;

type
  TYieldProcessProc = procedure of Object;
 // general
procedure ReadSettingsAndSetupWindowMessaging(
  AWindowHandle : DWORD;
  AProcessMessage : TYieldProcessProc); export; stdcall;
procedure SetCurrentTool(Value : integer); stdcall;
// see WS_General_API_types for the values used for SetCurrentTool

 // chosen files
function AddAFileToProcess (filename : pwidechar) : WordBool; stdcall;
function GetAFileToProcess (index : integer) : pwidechar; stdcall;
function GetFilesToProcessCount : integer; stdcall;
function FreeFilesToProcess : WordBool;               stdcall;

// Concord
function ConcordanceLine(index: integer) : TAPIConcordEntryRec; stdcall;
function GetCollocateDetails(index : integer) : TAPICollocateEntryRec; stdcall;
function GetCollocateCount : integer;                stdcall;
function GetConcordanceCount : integer;              stdcall;
function FreeUpConc : WordBool;                       stdcall;
function ComputeConcordance : WordBool; stdcall;
function AddASearchWord (w : pwidechar; kind : integer) : WordBool; stdcall;
function ClearSearchWords (kind : integer) : WordBool; stdcall;
function SetupSearchWords (kind : integer) : WordBool; stdcall;
function SaveConcordance(filename : pwidechar) : WordBool; stdcall;
function GetSavedConcordanceFilename : pwidechar; stdcall;

// WordList
function FreeUpWordlist : WordBool; stdcall;
function GetWordlistCount : integer; stdcall;
function GetWordListDetails(index: integer; order : TAPIWordlistOrder) : TAPIWordlistEntryRec; stdcall;
function ComputeWordList : WordBool; stdcall;
function SaveWordList(filename : pwidechar) : WordBool; stdcall;
function GetSavedWordlistFilename : pwidechar; stdcall;

// KeyWords
function GetReferenceCorpusFilename : pwidechar; stdcall;
function GetSavedKeyWordlistFilename : pwidechar; stdcall;
function FreeUpKeywords : WordBool; stdcall;
function ComputeKeyWords(filename,
                         ref_corpus_filename : pwidechar) : WordBool; stdcall;
function GetKeyWordlistCount : integer; stdcall;
function GetKeyWordDetails(index: integer) : TAPIKeywordsEntryRec; stdcall;
function SaveKeyWordList(filename : pwidechar) : WordBool; stdcall;

implementation

const the_dll = 'WS_GENERAL_API_DLL.DLL';

procedure ReadSettingsAndSetupWindowMessaging(
  AWindowHandle : DWORD;
  AProcessMessage : TYieldProcessProc); external the_dll;
function GetSavedWordlistFilename : pwidechar; external the_dll;
function GetReferenceCorpusFilename : pwidechar; external the_dll;
function GetSavedConcordanceFilename : pwidechar; external the_dll;
function GetSavedKeyWordlistFilename : pwidechar; external the_dll;
function FreeUpWordlist : WordBool; external the_dll;
function FreeUpKeywords : WordBool; external the_dll;
function ComputeWordList : WordBool; external the_dll;
function SaveWordList(filename : pwidechar) : WordBool; external the_dll;
function ComputeKeyWords(filename,
                         ref_corpus_filename : pwidechar) : WordBool; external the_dll;
function ConcordanceLine(index: integer) : TAPIConcordEntryRec; external the_dll;
function GetCollocateDetails(index : integer) : TAPICollocateEntryRec; external the_dll;
function GetCollocateCount : integer; external the_dll;
function AddASearchWord (w : pwidechar; kind : integer) : WordBool; external the_dll;
function ClearSearchWords (kind : integer) : WordBool; external the_dll;
function SetupSearchWords (kind : integer) : WordBool; external the_dll;
function ComputeConcordance : WordBool; external the_dll;
function SaveConcordance(filename : pwidechar) : WordBool; external the_dll;
function GetConcordanceCount : integer; external the_dll;
procedure SetCurrentTool(Value : integer); external the_dll;
function FreeUpConc : WordBool; external the_dll;
function FreeFilesToProcess : WordBool; external the_dll;
function AddAFileToProcess (filename : pwidechar) : WordBool; external the_dll;
function GetAFileToProcess (index : integer) : pwidechar; external the_dll;
function GetFilesToProcessCount : integer; external the_dll;
function GetWordlistCount : integer; external the_dll;
function GetKeyWordlistCount : integer; external the_dll;
function SaveKeyWordList(filename : pwidechar) : WordBool; external the_dll;
function GetWordListDetails(index: integer; order : TAPIWordlistOrder) : TAPIWordlistEntryRec; external the_dll;
function GetKeyWordDetails(index: integer) : TAPIKeywordsEntryRec; external the_dll;

end.
