unit WS_General_API_types;

interface

uses
  Windows;
{
  See
  http://dev.mysql.com/tech-resources/articles/visual-basic-datatypes.html
  or
  http://msdn2.microsoft.com/en-us/library/25sb10we(VS.80).aspx
  for a list of standard types used by different programming languages
}
const
    cm_Progress_Total_Words = 6102;
    cm_Progress_suspend = 6103;
    cm_Progress_thisfile = 6104;
    cm_Progress_overall = 6105;
    cm_Progress_caption = 6106;
    cm_Progress_number = 6110;
    cm_Progress_clear_bars = 6111;
    cm_Progress_clear_all = 6112;

    cm_Progress_stop_processing_files = 6120;
    cm_Progress_stop_processing_quick = 6121;
    cm_Progress_stop_panic = 6122;
type

{ use these integer values for the Tools:
    0 = wordlist
    1 = concord
    2 = keywords,
    3 = controller,
    9 = chooselang,
    11 = viewer,
    12 = webgetter,
    13 = character_analyser,
    14 = minimal_pairs,
    15 = file_utilities
}

  TAPISortInfoRec = record
    start_position,
    length : integer;
    barrier : integer;
  end;
  // barrier values are
  // 0 = none,
  // 1 = stop at punctuation,
  // 2 = stop at sentence barrier,
  // 3 = stop at paragraph break,
  // 4 = stop at heading break,
  // 5 = stop at section break,
  // 6 = stop at text end

  maxpathwidechar = array[0..MAX_PATH] of widechar; // MAX_PATH for Windows = 256
  hundredwidechar = array[0..100] of widechar;
  twohundredwidechar = array[0..200] of widechar;
  fivehundredwidechar = array[0..500] of widechar;
  tenthousandwidechar = array[0..10000] of widechar;

  TAPIFixedArray_of_Sort_pos = array[0..11] of TAPISortInfoRec;


  TAPISearchStatsRec = record
    number,
    position,
    out_of : array[0..4] of integer;
  end;
  //  These stats integers refer to
  //  0 = words,
  //  1 = sentences,
  //  2 = paragraphs,
  //  3 = headings,
  //  4 = sections;

  TAPIWordlistEntryRec = record
    n_files,
    frequency       : integer;
    word            : twohundredwidechar;
  end;

  TAPIWordlistOrder  = (alphabetical_order, frequency_order, n_texts_order);

  TAPI_two_KW_frequencies = array[0..1] of longint;
  //  0 = little_text,
  //  1 = reference_corpus

  TAPIKeyWordsEntryRec = record
    frequencies     : TAPI_two_KW_frequencies;
    p_value         : double;
    word            : twohundredwidechar;
  end;

  TAPIKeyWordsOrder = (kw_alphabetical_order,
                       kw_keyness_order,
                       kw_frequency_order,
                       kw_ref_corpus_frequency_order);

  TAPIConcordEntryRec = record
    hit_characters,
    byte_position,
    word_num,
    midpoint,
    left_tag_distance,
    filename_num,
    sw_number,
    tag_context_sortpos,
    percent_of_file       : integer;
    has_percent           : WordBool;
    context_word_position : TAPISortInfoRec;
    sort_positions        : TAPIFixedArray_Of_Sort_Pos;
    extras                : TAPISearchStatsRec;
    conc_line             : tenthousandwidechar;
  end;

  TAPIArrayOfCollocFreqs = array[0..50] of integer;
  TAPICollocateEntryRec = record
    association_value : double;
    most_frequent,
    total,
    total_left,
    total_right,
    freqs_used        : integer;
    freqs             : TAPIArrayOfCollocFreqs;
    w                 : hundredwidechar;
    sw_number         : integer;
  end;

implementation

end.
