2
0

Translat.sgm 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!-- $XConsortium: Translat.sgm /main/5 1996/09/08 20:16:44 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCDI.MAN317.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCDI.MAN317.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>Translate</RefEntryTitle>
  13. <ManVolNum>special file</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Symbol Role="Message">Translate</Symbol></RefName>
  17. <RefPurpose>translate a document from one media type to another
  18. </RefPurpose>
  19. </RefNameDiv>
  20. <!-- $XConsortium: Translat.sgm /main/5 1996/09/08 20:16:44 rws $-->
  21. <!-- CDE Common Source Format, Version 1.0.0-->
  22. <!-- (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
  23. <!-- (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
  24. <!-- (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
  25. <!-- (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
  26. <RefSynopsisDiv>
  27. <Synopsis>[<Symbol Role="Variable">file</Symbol>] Translate(in <Emphasis>mediaType contents</Emphasis>,
  28. out <Emphasis>mediaType output</Emphasis>,
  29. in boolean <Emphasis>inquisitive</Emphasis>,
  30. in boolean <Emphasis>covert</Emphasis>
  31. [in messageID <Emphasis>counterfoil</Emphasis>]);
  32. </Synopsis>
  33. </RefSynopsisDiv>
  34. <RefSect1>
  35. <Title>DESCRIPTION</Title>
  36. <Para>The
  37. <Symbol Role="Message">Translate</Symbol> request causes the handler to translate a document from one media type
  38. to another and return the translation.
  39. The translation must be the best possible representation of the document
  40. in the target media type,
  41. even if the resulting representation cannot be exactly translated
  42. back into the original document.
  43. </Para>
  44. <Para>The
  45. <Emphasis>contents</Emphasis> argument
  46. is the contents of the document.
  47. If this argument is unset
  48. (in other words, has a value of
  49. <Literal>(char *)0</Literal>), then the contents of the document are in
  50. the file named in the message's
  51. <Symbol Role="Variable">file</Symbol> attribute.
  52. The data type
  53. (<Emphasis>mediaType</Emphasis>) of the
  54. <Emphasis>contents</Emphasis> argument should be
  55. <Literal>string</Literal>, unless nulls are valid in the given media type,
  56. in which case the data type must be
  57. <Literal>bytes</Literal>.</Para>
  58. <Para>The
  59. <Emphasis>output</Emphasis> argument is the translation of the document.
  60. </Para>
  61. <Para>The
  62. <Emphasis>inquisitive</Emphasis> argument is a
  63. <Literal>boolean</Literal> value
  64. indicating whether the handler is allowed to block on user input
  65. while carrying out the request.
  66. However, even if
  67. <Emphasis>inquisitive</Emphasis> is True, the handler is not required to seek such input.
  68. </Para>
  69. <Para>The
  70. <Emphasis>covert</Emphasis> argument is a
  71. <Literal>boolean</Literal> value indicating whether the handler may make itself apparent to the user
  72. as it carries out the request.
  73. If False, the recipient need not make itself apparent.
  74. </Para>
  75. <Para>If both the
  76. <Emphasis>inquisitive</Emphasis> argument and the
  77. <Emphasis>covert</Emphasis> argument are True, the recipient should attempt to limit its presence
  78. to the minimum needed to receive any user input desired;
  79. for example, through iconification.
  80. </Para>
  81. <Para>The
  82. <Emphasis>counterfoil</Emphasis> argument is a unique string created by the message sender
  83. to give both sender and receiver a way to refer to this request
  84. in other correspondence.
  85. Typically this string is created by concatenating a process ID and a counter.
  86. This argument should be included
  87. if the sender anticipates a need to communicate with the handler
  88. about this request before it is completed; for example, to cancel it.
  89. When this argument is included,
  90. and the handler determines that an immediate reply is not possible,
  91. the handler must immediately send at least one
  92. <Symbol Role="Message">Status</Symbol> notice point-to-point back to the requester,
  93. so as to identify itself to the requester.
  94. </Para>
  95. </RefSect1>
  96. <RefSect1>
  97. <Title>APPLICATION USAGE</Title>
  98. <Para>To provide a speech-to-text service, a tool can handle requests of the form:
  99. </Para>
  100. <InformalExample Remap="indent">
  101. <ProgramListing>Translate(in Sun_Audio <Emphasis>contents</Emphasis>,
  102. out ISO_Latin_1 <Emphasis>output</Emphasis>,
  103. ...);
  104. </ProgramListing>
  105. </InformalExample>
  106. <Para>To provide an OCR (optical character recognition) service,
  107. a tool can handle requests of the form:
  108. </Para>
  109. <InformalExample Remap="indent">
  110. <ProgramListing>Translate(in GIF <Emphasis>contents</Emphasis>,
  111. out ISO_Latin_1 <Emphasis>output</Emphasis>,
  112. ...);
  113. </ProgramListing>
  114. </InformalExample>
  115. </RefSect1>
  116. <RefSect1>
  117. <Title>ERRORS</Title>
  118. <Para>The ToolTalk service may return one of the following errors
  119. in processing the
  120. <Symbol Role="Message">Translate</Symbol> request:
  121. </Para>
  122. <VariableList>
  123. <VarListEntry>
  124. <Term>TT_DESKTOP_ENOENT</Term>
  125. <ListItem>
  126. <Para>The file that was alleged to contain the document does not exist.
  127. </Para>
  128. </ListItem>
  129. </VarListEntry>
  130. <VarListEntry>
  131. <Term>TT_DESKTOP_ENODATA</Term>
  132. <ListItem>
  133. <Para>The in-mode
  134. <Emphasis>contents</Emphasis> argument had no value and the
  135. <Symbol Role="Variable">file</Symbol> attribute
  136. of the message was not set.
  137. </Para>
  138. </ListItem>
  139. </VarListEntry>
  140. <VarListEntry>
  141. <Term>TT_MEDIA_ERR_FORMAT</Term>
  142. <ListItem>
  143. <Para>The document is not a valid instance of the media type.
  144. </Para>
  145. </ListItem>
  146. </VarListEntry>
  147. </VariableList>
  148. </RefSect1>
  149. <RefSect1>
  150. <Title>SEE ALSO</Title>
  151. <Para><Emphasis>Intro</Emphasis>, <Emphasis>Abstract</Emphasis>, <Emphasis>Interpret</Emphasis>, <Symbol Role="Message">Status</Symbol> requests.
  152. </Para>
  153. </RefSect1>
  154. </RefEntry>
  155. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:18:47-->