⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aspellheadersdyn.pas

📁 类似QQ的源码程序
💻 PAS
📖 第 1 页 / 共 4 页
字号:
unit AspellHeadersDyn;
{
  File      : AspellHeaders.pas
  Purpose   : Delphi Headerfiles for GNU-Aspell-0.50 (based on aspell.h)
  Copyright : (c) 12/2002 Thorsten Maerz <info@netztorte.de>
  License   : LGPL
}

interface

const ASPELLDLL = 'aspell-15.dll';

function LoadAspell(dllname:string=ASPELLDLL):boolean;

type
  AspellConfig                = type pointer;
  AspellMutableContainer      = type pointer;
  AspellKeyInfoEnumeration    = type pointer;
  AspellCanHaveError          = type pointer;
  AspellSpeller               = type pointer;
  AspellWordList              = type pointer;
  AspellFilter                = type pointer;
  AspellDocumentChecker       = type pointer;
  AspellModuleInfoList        = type pointer;
  AspellModuleInfoEnumeration = type pointer;
  AspellDictInfoList          = type pointer;
  AspellDictInfoEnumeration   = type pointer;
  AspellStringList            = type pointer;
  AspellStringEnumeration     = type pointer;
  AspellStringPairEnumeration = type pointer;
  AspellStringMap             = type pointer;

type
  AspellTypeId = ^TAspellTypeId;
  TAspellTypeId = record
    case boolean of
      true:  (num:Longword);
      false: (str:array[0..3] of char);
  end;

type
  AspellKeyInfoType = ( AspellKeyInfoString, AspellKeyInfoInt,
                        AspellKeyInfoBool,   AspellKeyInfoList );

  AspellKeyInfo = ^TAspellKeyInfo;
  TAspellKeyInfo = record
  {* the name of the key *}
    name       : PChar;
  {* the key type *}
    type_      : AspellKeyInfoType;
  {* the default value of the key *}
    def        : PChar;
  {* a brief description of the key or null if internal value *}
    desc       : PChar;
  {* other data used by config implementations
   * should be set to 0 if not used *}
    otherdata  : array[0..15] of char;
  end;

type
  AspellErrorInfo = ^TAspellErrorInfo;
  TAspellErrorInfo = record
    isa        : AspellErrorInfo;
    mesg       : PChar;
    num_parms  : Word;
    parms      : array[0..2] of char;
  end;

type
  AspellError = ^TAspellError;
  TAspellError = record
    mesg       : PChar;
    err        : AspellErrorInfo;
  end;

type
  AspellToken = ^TAspellToken;
  TAspellToken = record
    offset     : Word;
    len        : Word;
  end;

type
  AspellModuleInfo = ^TAspellModuleInfo;
  TAspellModuleInfo = record
    name        : PChar;
    order_num   : double;
    lib_dir     : PChar;
    dict_dirs   : AspellStringList;
    dict_exts   : AspellStringList;
  end;

type
  AspellDictInfo = ^TAspellDictInfo;
  TAspellDictInfo = record
  {* name to identify the dictionary by *}
    name        : PChar;
    code        : PChar;
    jargon      : PChar;
    size        : integer;
    size_str    : PChar;
    module      : AspellModuleInfo;
  end;

type
  AspellStringPair = ^TAspellStringPair;
  TAspellStringPair = record
    first       : PChar;
    second      : PChar;
  end;

type
{************************** mutable container **************************}
  Taspell_mutable_container_add=function(ths:AspellMutableContainer; to_add:PChar):integer; cdecl;
  Taspell_mutable_container_remove=function(ths:AspellMutableContainer; to_rem:PChar):integer; cdecl;
  Taspell_mutable_container_clear=procedure(ths:AspellMutableContainer); cdecl;
  Taspell_mutable_container_to_mutable_container=function(ths:AspellMutableContainer):AspellMutableContainer; cdecl;

{******************************* key info *******************************}
  Taspell_key_info_enumeration_at_end=function(ths:AspellKeyInfoEnumeration):integer; cdecl;
  Taspell_key_info_enumeration_next=function(ths:AspellKeyInfoEnumeration):AspellKeyInfo; cdecl;
  Tdelete_aspell_key_info_enumeration=procedure(ths:AspellKeyInfoEnumeration); cdecl;
  Taspell_key_info_enumeration_clone=function(ths:AspellKeyInfoEnumeration):AspellKeyInfoEnumeration; cdecl;
  Taspell_key_info_enumeration_assign=procedure(ths:AspellKeyInfoEnumeration; other:AspellKeyInfoEnumeration); cdecl;

{******************************** config ********************************}
  Tnew_aspell_config=function:AspellConfig; cdecl;
  Tdelete_aspell_config=procedure(ths:AspellConfig); cdecl;
  Taspell_config_clone=function(ths:AspellConfig):AspellConfig; cdecl;
  Taspell_config_assign=procedure(ths:AspellConfig; other:AspellConfig); cdecl;
  Taspell_config_error_number=function(ths:AspellConfig):Word; cdecl;
  Taspell_config_error_message=function(ths:AspellConfig):PChar; cdecl;

  Taspell_config_error=function(ths:AspellConfig):AspellError; cdecl;

{* sets extra keys which this config class should accept
 * begin and end are expected to point to the begging
 * and end of an array of Aspell Key Info *}
  Taspell_config_set_extra=procedure(ths, begin_, end_:AspellKeyInfo); cdecl;

{* returns the KeyInfo object for the
 * corresponding key or returns null and sets
 * error_num to PERROR_UNKNOWN_KEY if the key is
 * not valid. The pointer returned is valid for
 * the lifetime of the object. *}
  Taspell_config_keyinfo=function(ths:AspellConfig; key:PChar):AspellKeyInfo; cdecl;

{* returns a newly allocated enumeration of all the
 * possible objects this config class uses *}
  Taspell_config_possible_elements=function(ths:AspellConfig; include_extra:integer):AspellKeyInfoEnumeration; cdecl;

{* returns the default value for given key which
 * way involve substating variables, thus it is
 * not the same as keyinfo(key)->def returns null
 * and sets error_num to PERROR_UNKNOWN_KEY if
 * the key is not valid. Uses the temporary
 * string. *}
  Taspell_config_get_default=function(ths:AspellConfig; key:PChar):PChar; cdecl;

{* returns a newly alloacted enumeration of all the
 * key/value pairs. This DOES not include ones
 * which are set to their default values *}
  Taspell_config_elements=function(ths:AspellConfig):AspellStringPairEnumeration; cdecl;
  
{* inserts an item, if the item already exists it
 * will be replaced. returns true if it succesed
 * or false on error. If the key in not valid it
 * sets error_num to PERROR_UNKNOWN_KEY, if the
 * value is not valid it will sets error_num to
 * PERROR_BAD_VALUE, if the value can not be
 * changed it sets error_num to
 * PERROR_CANT_CHANGE_VALUE, and if the value is
 * a list and you are trying to set it directory
 * it sets error_num to PERROR_LIST_SET *}
  Taspell_config_replace=function(ths:AspellConfig; key, value:PChar):integer; cdecl;

{* remove a key and returns true if it exists
 * otherise return false. This effictly sets the
 * key to its default value. Calling replace with
 * a value of "<default>" will also call
 * remove. If the key does not exists sets
 * error_num to 0 or PERROR_NOT, if the key in
 * not valid sets error_num to
 * PERROR_UNKNOWN_KEY, if the value can not be
 * changed sets error_num to
 * PERROR_CANT_CHANGE_VALUE *}
  Taspell_config_remove=function(ths:AspellConfig; key:PChar):integer; cdecl;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -