home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wpentk.zip / WBPENTK4.DSK / IDRRECO.IDL < prev    next >
Text File  |  1994-10-07  |  17KB  |  515 lines

  1.  
  2. //# This file was generated by the SOM Compiler.
  3. //# FileName: idrreco.id2.
  4. //# Generated using:
  5. //#     SOM Precompiler somopc: 2.7
  6. //#     SOM Emitter emitidl: 2.22
  7.  
  8. //
  9. //   CLASS: IDRReco
  10. //
  11. //   CLASS HIERARCHY:
  12. //
  13. //     SOMObject
  14. //       └── IDRReco
  15. //
  16. //   DESCRIPTION:
  17. //
  18. //     Generic input data recognition class.
  19.  
  20. #ifndef idrreco_idl
  21. #define idrreco_idl
  22.  
  23. #include <somobj.idl>
  24. #include <somcls.idl>
  25.  
  26. #include "pentypes.idl"
  27. #include "idftypes.idl"
  28.  
  29.  
  30. interface M_IDRReco;
  31.  
  32. exception IDR_PROB { ULONG ulErrorCode; };
  33.  
  34. interface IDOStroke;
  35. interface IDRReco : SOMObject
  36. {
  37.  
  38. exception IDR_PROB { ULONG ulErrorCode; };
  39.  
  40.   APIRET idrGetDescriptionFromFile( in PSZ pszFileName, in PSZ pszDescription);
  41.  
  42.   // Method   : idrGetDescriptionFromFile
  43.   //
  44.   // Purpose  : Get the description from backed up trainer file
  45.   //
  46.   // Parameters: pszFileName - .HWS file
  47.   //
  48.   //             pszDescription - place to put description
  49.   //
  50.   // Returns:
  51.   //             NO_ERROR - okay
  52.   //
  53.   // History:
  54.   //             05-16-94 - MikeD created
  55.  
  56.  
  57.   VOID idrSetSymbolSubset( in PIDR_SYMSET pSymSet ) raises(IDR_PROB);
  58.  
  59.   // Method   : idrSetSymbolSubset
  60.   //
  61.   // Purpose  : Set the symbol subsets to be used for recognition.
  62.   //
  63.   // Synopsis : VOID idrSetSymbolSubset( PIDR_SYMSET pSymSet )
  64.   //
  65.   //   pSymSet... The symbol set to be used.
  66.   //
  67.   // Returns  :
  68.   //   NO_ERROR.............. Success.
  69.   //   IDRERR_ERROR.......... Error.
  70.   //
  71.   // Notes    :
  72.   //   This method will constrain the recognition object to use the specified
  73.   //   subset of recognizable symbols.
  74.   //
  75.   // Usage    :
  76.   //   Callable - During Alive state.
  77.   //   Override - Override by subclasses.
  78.  
  79.   VOID idrGetSymbolSubset( in PIDR_SYMSET pSymSet,
  80.                            in PULONG pulSize ) raises(IDR_PROB);
  81.  
  82.   // Method   : idrGetSymbolSubset
  83.   //
  84.   // Purpose  : Get the symbol subsets being used for recognition.
  85.   //
  86.   // Synopsis : VOID idrGetSymbolSubset( INOUT PIDR_SYMSET pSymSet,
  87.   //                                     INOUT PULONG pulSize )
  88.   //
  89.   //   pSymSet... Pointer to symbol set.
  90.   //              Suggested size: sizeof (IDR_SYMSET)
  91.   //   pulSize... Pointer to size variable.
  92.   //
  93.   // Returns  :
  94.   //   NO_ERROR.............. Success.
  95.   //   IDRERR_ERROR.......... Error.
  96.   //   IDRERR_BUF_TOO_SMALL...Larger buffer is required.
  97.   //
  98.   // Notes    :
  99.   //   This method will return the symbol set being used by the recognition
  100.   //   object as recognizable symbols.
  101.   //   Two invocations may be required to get the data:
  102.   //      1) Invoke with pulSize pointing to the initial size of the
  103.   //         buffer at pSymSet.
  104.   //      2) On return, if the buffer size passed in was large enough,
  105.   //         pSymSet will contain the information.  Otherwise,
  106.   //         IDRERR_BUF_TOO_SMALL will be returned and
  107.   //         pulSize will point to the size of the required buffer.
  108.   //      3) Reallocate the buffer needed and invoke the method again.
  109.   //
  110.   // Usage    :
  111.   //   Callable - During Alive state.
  112.   //   Override - Override by subclasses.
  113.  
  114.   VOID idrGetSymbolSubsetInfo(in ULONG ulSymSets,
  115.                                 in PULONG pulSymCnt,
  116.                                 in PIDR_SYM pSyms) raises(IDR_PROB);
  117.  
  118.   // Method   : idrGetSymbolSubsetInfo
  119.   //
  120.   // Purpose  : Get the symbols associated with the specified subsets.
  121.   //
  122.   // Synopsis : VOID idrGetSymbolSubsetInfo( IN ULONG ulSymSets,
  123.   //                                          INOUT PULONG pulSymCnt,
  124.   //                                          INOUT PIDR_SYM pSyms)
  125.   //
  126.   //   ulSymSets.. Mask of symbol sets.
  127.   //   pulSymCnt.. Pointer to the number of symbols
  128.   //   pSyms...... Pointer to the array of symbols.  This is a contiguous
  129.   //               array of IDR_SYMs.
  130.   //
  131.   // Returns  :
  132.   //   NO_ERROR.............. Success.
  133.   //   IDRERR_ERROR.......... Error.
  134.   //   IDRERR_BUF_TOO_SMALL...Larger buffer is required.
  135.   //
  136.   // Notes    :
  137.   //   This method will enumerate the symbols in the given symbol subsets.
  138.   //   Two invocations may be required to get the data:
  139.   //      1) Invoke with pSyms pointing to a buffer of size
  140.   //         *pulSymCnt*sizeof(IDR_SYM).
  141.   //      2) On return, if the buffer size passed in was large enough,
  142.   //         pSyms will contain the symbols.  Otherwise,
  143.   //         IDRERR_BUF_TOO_SMALL will be returned and
  144.   //         pulSymCnt will point to the number of symbols to return.
  145.   //      3) Reallocate *pulSymCnt*sizeof(IDR_SYM) and point to it with
  146.   //         pSyms. Invoke the method again.
  147.   //
  148.   // Usage    :
  149.   //   Callable - During Alive state.
  150.   //   Override - Override by subclasses.
  151.  
  152.  
  153.   VOID idrSetMetrics(in PIDR_INKMETRICS pMetrics) raises(IDR_PROB);
  154.  
  155.   // Method   : idrSetMetrics
  156.   //
  157.   // Purpose  : Set the metrics.
  158.   //
  159.   // Synopsis : VOID  idrSetMetrics( IN    PIDR_INKMETRICS pMetrics )
  160.   //
  161.   //   pMetrics....... Pointer to metrics structure.
  162.   //
  163.   // Returns  :
  164.   //   NO_ERROR.................. Success.
  165.   //   IDRERR_ERROR.............. Error.
  166.   //
  167.   // Notes    :
  168.   //
  169.   // Usage    :
  170.   //   Callable - Always.
  171.   //   Override - By subclasses if metrics are defaulted.
  172.  
  173.   VOID idrGetMetrics(in PIDR_INKMETRICS pMetrics) raises(IDR_PROB);
  174.  
  175.   // Method   : idrGetMetrics
  176.   //
  177.   // Purpose  : Get the metrics in use by the object.
  178.   //
  179.   // Synopsis : VOID  idrGetMetrics( INOUT  PVOID pMetrics )
  180.   //
  181.   //   pMetrics....... Pointer to metrics structure.
  182.   //
  183.   // Returns  :
  184.   //   NO_ERROR.............. Success.
  185.   //   IDRERR_ERROR.......... Error.
  186.   //
  187.   // Notes    :
  188.  
  189.   VOID idrAddStroke(in PSTROKEDATA pData,
  190.                       in HWND hRelative ) raises(IDR_PROB);
  191.  
  192.   // Method   : idrAddStroke
  193.   //
  194.   // Purpose  : Add stroke data to recognition process.
  195.   //
  196.   // Synopsis : VOID  idrAddStroke(in PSTROKEDATA pData,
  197.   //                                 in HWND hRelative )
  198.   //
  199.   //   pData... Pointer to a stroke data structure.  If this is NULL,
  200.   //            the stroke data will be queried by this object.
  201.   //   hRelative... If the pData parameter is NULL, this HWND is the
  202.   //                window for which the stroke data is to be queried.
  203.   //
  204.   // Returns  :
  205.   //   NO_ERROR.............. Success.
  206.   //   IDRERR_ERROR.......... Error.
  207.   //
  208.   // Notes    :
  209.   //    Once an application adds strokes via this method, it should
  210.   //    continue to use only this method to add strokes until the
  211.   //    recognition occurs and the engine returns to the Alive state.
  212.   //
  213.  
  214.   VOID idrAddStrokefromStrokeObject(in IDOStroke pStrokeObj ) raises(IDR_PROB);
  215.  
  216.   // Method   : idrAddStrokefromStrokeObject
  217.   //
  218.   // Purpose  : Add a stroke object's stroke data to this recognition process.
  219.   //
  220.   // Synopsis : VOID idrAddStrokefromStrokeObject(in IDOStroke pStrokeObj )
  221.   //
  222.   //   pStrokeObj..... Source stroke object.
  223.   //
  224.   // Returns  :
  225.   //   NO_ERROR.............. Success.
  226.   //   IDRERR_ERROR.......... Error.
  227.   //
  228.   // Notes    :
  229.   //    Once an application adds strokes via this method, it should
  230.   //    continue to use only this method to add strokes until the
  231.   //    recognition occurs and the engine returns to the Alive state.
  232.  
  233.   VOID idrClearStrokes() raises(IDR_PROB);
  234.  
  235.   // Method   : idrClearStrokes
  236.   //
  237.   // Purpose  : Clear all strokes from the engine.
  238.   //
  239.   // Synopsis : VOID  idrClearStrokes()
  240.   //
  241.   // Returns  :
  242.   //   NO_ERROR.............. Success.
  243.   //   IDRERR_ERROR.......... Error.
  244.   //
  245.   // Notes    :
  246.   //   Clears strokes; does NOT reset the object's processing options.
  247.   //   Resets the engine back to the Alive state.
  248.  
  249.  
  250.  
  251. #ifdef __SOMIDL__
  252.   implementation {
  253.  
  254.      releaseorder:idrSetSymSet,idrGetSymSet,
  255.                   idrSetSymbolSubset,idrGetSymbolSubset,
  256.                   idrGetSymbolSubsetInfo,idrSetMetrics,idrGetMetrics,
  257.                   idrAddStroke,idrAddStrokefromStrokeObject,idrClearStrokes,
  258.                   idrSetEngEntryPts,
  259.                   idrSetInstHdls,idrSetCfgValues,idrSetDefaults,
  260.                   idrResetToDefaults,idrSetSymSubsets,
  261.                   idrSetLngMdlUsage,idrSetTrainData,idrGetDefaults,idrGetInstHdls,
  262.                   idrGetEngEntryPts,idrGetCfgValues,idrGetSymSubsets,
  263.                   idrGetLngMdlUsage,idrGetCompCfgCaps,idrGetDataCfgCaps,
  264.                   idrGetTrainData,idrAddRawData,idrDelData,
  265.                   idrDelRawData,idrDataComplete,idrDataClear,
  266.                   idrGetGrf,idrCopyGrf,idrGetGrfChildAltCnt,idrGetGrfChildHndls,
  267.                   idrGetGrfInfoAltCnt,idrGetGrfInfo,idrSetXlateInfo,idrGetXlateInfo,
  268.                   idrXlateSym,idrSetMetricsDefaults,idrGetMetricsDefaults,
  269.                   idrSetState,idrGetState,
  270.                   idrSaveCfg,idrRestoreCfg,idrGetDescriptionFromFile,
  271.                   idrCopyEnviron,idrIGetTrainStatus;
  272.  
  273.     //# Class Modifiers
  274.     functionprefix = IDRReco;
  275.     majorversion = 0;
  276.     minorversion = 1;
  277.     local;
  278.     filestem = idrreco;
  279.     metaclass = M_IDRReco;
  280.     callstyle = idl;
  281.  
  282.  
  283.     passthru C_h_before =  ""
  284. ""
  285. ""
  286. "#pragma pack(2)"
  287. ""
  288. "/*"
  289. "** Input Data Recognition (IDR) error codes."
  290. "** Certain OS/2 error codes are also used directly. (for ex. NO_ERROR)"
  291. "*/"
  292. "#include \"idrerror.h\""
  293. ""
  294. "/*"
  295. "**  Defines for symbol types."
  296. "*/"
  297. ""
  298. "#define IDR_TYPE_ASCII          (USHORT)(0x0002)"
  299. "#define IDR_TYPE_CTRL           (USHORT)(0xffff)"
  300. "#define IDR_TYPE_SYSGESTURE     (USHORT)(0x8001)"
  301. "#define IDR_TYPE_LETTERGESTURE  (USHORT)(0x8002)"
  302. ""
  303. ""
  304. "typedef struct _IDR_SYM         /* Basic symbol */"
  305. "{"
  306. "  USHORT    usSymType;          /* Symbol, e.g. ASCII, etc. */"
  307. "  USHORT    usSymVal;           /* Symbol value, For IDR_TYPE_ASCII and "
  308. "                                   IDR_TYPE_LETTERGESTURE, this is the"
  309. "                                   \"code point\" on the current code page."
  310. "                                   For IDR_TYPE_SYSGESTURE this is the"
  311. "                                   gesture's virtual id. */ "
  312. "}   IDR_SYM,"
  313. "   *PIDR_SYM,"
  314. "  **PPIDR_SYM;"
  315. ""
  316. "/*"
  317. "**  Defines for text and gesture symbol subsets."
  318. "*/"
  319. ""
  320. "#define IDR_SYMSET_FULL        (0x10000000)    /* full symbol set; this is the default */"
  321. ""
  322. "/*"
  323. "**  Defines for text symbol subsets. These are valid in text mode only."
  324. "*/"
  325. ""
  326. "#define IDR_SYMSET_ALPHALO     (0x00000001)   /* lower-alphabetic text symbols */"
  327. "#define IDR_SYMSET_ALPHAHI     (0x00000002)   /* upper-alphabetic text symbols */"
  328. "#define IDR_SYMSET_DIGIT       (0x00000004)   /* digits; 0 through 9 */"
  329. "#define IDR_SYMSET_MONETARY    (0x00000008)   /* monetary symbols */"
  330. "#define IDR_SYMSET_MATH        (0x00000010)   /* mathematical symbols */"
  331. "#define IDR_SYMSET_PUNCTUATION (0x00000020)   /* punctuation symbols */"
  332. "#define IDR_SYMSET_SPECIAL     (0x00000040)   /* special symbols */"
  333. ""
  334. ""
  335. "typedef struct _IDR_SYMSET /* Symbol set */"
  336. "{"
  337. "  ULONG ulSymSets;              /* Symbol subset mask */"
  338. "  ULONG ulSymCnt;               /* Count of symbols in the symbol list. */"
  339. "  IDR_SYM SymList[1];           /* Contiguous array of symbols. */"
  340. "}  IDR_SYMSET,"
  341. "  *PIDR_SYMSET,"
  342. " **PPIDR_SYMSET;"
  343. ""
  344. ""
  345. "/*"
  346. "**  Defines used for setting the metrics."
  347. "**  Space disabling is only used if all strokes are known to belong to one word."
  348. "**  Direction is defaulted by the object."
  349. "*/"
  350. ""
  351. "#define IDR_INKFORM_SINGLE_SYM      (0x00000002)"
  352. "#define IDR_INKFORM_BOXED           (0x00000004)"
  353. "#define IDR_INKFORM_LINED           (0x00000008)"
  354. "#define IDR_INKFORM_UNLINED         (0x00000010)"
  355. ""
  356. "#define IDR_INKSPACE_DISABLE_OFF    (0x00000000)"
  357. "#define IDR_INKSPACE_DISABLE_ON     (0x00000001)"
  358. ""
  359. "#define IDR_INKDIRECT_RIGHT_DOWN    (0x00000001) /* Left->right, top->bottom */ "
  360. ""
  361. ""
  362. "typedef struct _IDR_INKMETRICS"
  363. "{"
  364. "  ULONG           ulSSize;          /* IDR_INKMETRICS size                 */"
  365. "  ULONG           ulRecoForm;       /* Type of segmentation                */"
  366. "  ULONG           ulSpaceDisable;   /* Don't return any whitespace         */"
  367. "  ULONG           ulDirection;      /* Direction of \"normal\" writing     */"
  368. "  POINTL          ptlOrigin;        /* Origin                              */"
  369. "  POINTL          ptlOffset;        /* Offset of \"gray\" area from Origin */"
  370. "  POINTL          ptlBox;           /* Box extents (width & height)        */"
  371. "  POINTL          ptlGray;          /* \"Gray\" area between boxes         */"
  372. "  LONG            lOffsetBline;     /* Baseline offset from bottom of Box  */"
  373. "  ULONG           ulRowCount;       /* Row count, 0 == indeterminate       */"
  374. "  ULONG           ulColCount;       /* Column count, 0 == indeterminate    */"
  375. "}  IDR_INKMETRICS,"
  376. "  *PIDR_INKMETRICS,"
  377. " **PPIDR_INKMETRICS;"
  378. ""
  379. "#pragma pack()"
  380. ""
  381. "";
  382.  
  383.     passthru C_h_after =  ""
  384. "";
  385.  
  386.  
  387.  
  388.     //# Method Modifiers
  389.     somInit: override;
  390.     somUninit: override;
  391.  
  392.     //# Data Modifiers
  393.  
  394.  
  395.   };
  396. #endif /* __SOMIDL__ */
  397. };
  398.  
  399.  
  400. interface M_IDRReco : SOMClass
  401. {
  402.  
  403.   VOID   idrclsGetEngineDescription( in PULONG pulSize,
  404.                                     in PSZ pszDescription ) raises(IDR_PROB);
  405.  
  406.   // Method   : idrclsGetEngineDescription
  407.   //
  408.   // Purpose  : Get the text description of the recognition engine.
  409.   //
  410.   // Synopsis : VOID idrclsGetEngineDescription( inout PULONG pulSize,
  411.   //                                out PSZ pszDescription )
  412.   //
  413.   //   pulsize.........  Buffer size required.
  414.   //                         Suggested initial size: 50 bytes.
  415.   //   pszDescription..  Description of the engine.
  416.   //
  417.   // Returns  :
  418.   //   NO_ERROR............... Success.
  419.   //   IDRERR_ERROR........... Error.
  420.   //   IDRERR_BUF_TOO_SMALL... A larger buffer is needed.
  421.   //
  422.   // Notes    : Two invocations of this method may be required.
  423.   //
  424.   // Usage    :
  425.   //   Callable - Always.
  426.   //   Override - By subclasses.
  427.  
  428.   IDRReco  idrclsNewIDRReco(in PVOID pCfg ) raises(IDR_PROB);
  429.  
  430.   // Method   : idrclsNewIDRReco
  431.   //
  432.   // Purpose  : Construct a base data transformer object using a specific
  433.   //            recognition configuration.
  434.   //
  435.   // Synopsis : APIRET idrclsNewIDRReco( IN    PVOID    pCfg )
  436.   //
  437.   //   pCfg...... Recognition configuration to use when constructing
  438.   //              the object.
  439.   //   IDRReco * pObject.. Pointer to the newly created object.
  440.   //
  441.   // Returns  :
  442.   //   NO_ERROR.......... Object created, ready for use.
  443.   //   IDRERR_ERROR...... Object creation failed.
  444.   //
  445.   // Notes    : If an error occurs *'ppObject' is set to NULL.
  446.   //
  447.   // Usage    :
  448.   //   Callable - Always.
  449.   //   Override - By subclasses.
  450.  
  451.   VOID idrclsFreeIDR(in IDRReco pObject) raises(IDR_PROB);
  452.  
  453.   // Method   : idrclsFreeIDR
  454.   //
  455.   // Purpose  : Destroy a base data transformer object created via
  456.   //            idrclsNewIDRReco().
  457.   //
  458.   // Synopsis : VOID  idrclsFreeIDR( IN    IDRReco *pObject )
  459.   //
  460.   //   pObject... Object to free.
  461.   //
  462.   // Returns    :
  463.   //   NO_ERROR.......... Success.
  464.   //   IDRERR_ERROR...... Error, object freed as much as possible.
  465.   //
  466.   // Notes      :
  467.   //   This should be overridden by any meta-class for a descendant of the
  468.   //   IDRReco class.  The override should perform any sub-class specific
  469.   //   cleanup and then invoke this method via parent_idrclsFreeIDR().
  470.   //
  471.   // Usage    :
  472.   //   Callable - Always.
  473.   //   Override - By subclasses.
  474.  
  475.  
  476.  
  477. #ifdef __SOMIDL__
  478.   implementation {
  479.  
  480.     releaseorder: idrclsGetEngineDescription,idrclsNewIDRReco,idrclsFreeIDR,
  481.                   idrclsSetCfgType,idrclsGetCfgType,idrclsSetCfgTypes,
  482.                   idrclsSetCfgDescs,idrclsSetCfg,idrclsAddCfgDesc,idrclsDelCfgDesc,
  483.                   idrclsAddCfg,idrclsReplaceCfg,idrclsDelCfg,idrclsSetDefaultCfg,
  484.                   idrclsGetCfgTypes,idrclsGetCfgDescs,idrclsGetCfg,idrclsNewCfgFromBase,
  485.                   idrclsNewDirFromBase,idrclsDelPath,idrclsGetDefaultCfg,
  486.                   idrclsGetCtlrHandle,idrclsEngCtlrResolve,idrclsCopyCfg,
  487.                   idrclsFreeCfg,idrclsCfgToInstance,idrclsCfgToInUse,
  488.                   idrclsCfgCompDataMatch,idrclsCfgCompMatch,idrclsCfgIniToCfg,
  489.                   idrclsCfgToCfgIni,idrclsInUseListAdd,idrclsInUseListRemove,
  490.                   idrclsInUseListLock,idrclsInUseListUnlock,idrclsInstListAdd,
  491.                   idrclsInstListRemove,idrclsInstListLock,idrclsInstListUnlock,
  492.                   idrclsGlobalLock,idrclsGlobalUnlock;
  493.  
  494.     //# Class Modifiers
  495.     functionprefix = IDRRecoM;
  496.     majorversion = 0;
  497.     minorversion = 1;
  498.     local;
  499.     filestem = idrreco;
  500.     callstyle = idl;
  501.  
  502.  
  503.     //# Method Modifiers
  504.     somInit: override;
  505.     somUninit: override;
  506.  
  507.     //# Data Modifiers
  508.  
  509.  
  510.   };
  511. #endif /* __SOMIDL__ */
  512. };
  513.  
  514. #endif  /* idrreco_idl */
  515.