EdGetCon.sgm 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!-- $XConsortium: EdGetCon.sgm /main/7 1996/09/08 20:03:12 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.XCSA.MAN25.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCSA.MAN25.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtEditorGetContents</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtEditorGetContents</Function></RefName>
  17. <RefPurpose>retrieve the contents of a DtEditor widget
  18. </RefPurpose>
  19. </RefNameDiv>
  20. <!-- CDE Common Source Format, Version 1.0.0-->
  21. <!-- *************************************************************************-->
  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. <!-- ************************************************************************-->
  27. <RefSynopsisDiv>
  28. <FuncSynopsis Remap="ANSI">
  29. <FuncSynopsisInfo>#include &lt;Dt/Editor.h>
  30. </FuncSynopsisInfo>
  31. <FuncDef>DtEditorErrorCode <Function>DtEditorGetContents</Function></FuncDef>
  32. <ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
  33. <ParamDef>DtEditorContentRec *<Parameter>data</Parameter></ParamDef>
  34. <ParamDef>Boolean <Parameter>hardCarriageReturns</Parameter></ParamDef>
  35. <ParamDef>Boolean <Parameter>markContentsAsSaved</Parameter></ParamDef>
  36. </FuncSynopsis>
  37. </RefSynopsisDiv>
  38. <RefSect1>
  39. <Title>DESCRIPTION</Title>
  40. <Para>The
  41. <Function>DtEditorGetContents</Function> function retrieves the entire contents of a DtEditor widget as
  42. a string, wide character string or sized buffer of data.
  43. The data is transferred from the
  44. DtEditor widget using a
  45. <StructName Role="typedef">DtEditorContentRec</StructName>, which indicates the
  46. type of data being transferred along with the actual data.
  47. If desired, any soft
  48. line feeds (word wraps) can be replaced with
  49. <KeySym>newline</KeySym>s.</Para>
  50. <Para>The DtEditor widget tracks whether its contents have changed since they
  51. were last saved or retrieved.
  52. Setting the
  53. <Emphasis>markContentsAsSaved</Emphasis> argument to True
  54. retrieves a copy of the data without
  55. affecting whether
  56. &cdeman.DtEditorCheckForUnsavedChanges; reports that there are unsaved changes.
  57. This is useful if the application needs a temporary copy of the
  58. contents.
  59. </Para>
  60. <Para>The
  61. <Symbol Role="Variable">widget</Symbol> argument specifies the DtEditor widget ID.
  62. </Para>
  63. <Para>The
  64. <Symbol Role="Variable">data</Symbol> argument is a pointer to a data structure to receive
  65. the contents of
  66. <Symbol Role="Variable">widget</Symbol>.</Para>
  67. <Para>The
  68. <Emphasis>hardCarriageReturns</Emphasis> argument, if set to
  69. True,
  70. indicates that the DtEditor widget should replace
  71. any soft line feeds (word wraps) with
  72. <KeySym>newline</KeySym>s when saving
  73. the data.
  74. When
  75. <Emphasis>hardCarriageReturns</Emphasis> is set to
  76. False,
  77. any line wrapped because it reaches the
  78. right edge of the window is saved as one complete line.
  79. </Para>
  80. <Para>The
  81. <Emphasis>markContentsAsSaved</Emphasis> argument, if set to
  82. True,
  83. causes the DtEditor widget to mark that all changes made to date have been saved.
  84. When
  85. <Emphasis>markContentsAsSaved</Emphasis> is set to
  86. False,
  87. the DtEditor widget does not change its status regarding unsaved changes.
  88. <![ %CDE.C.CDE; [</Para>
  89. <Para>For a complete definition of the DtEditor widget
  90. and its associated resources, see
  91. &cdeman.DtEditor;. ]]></Para>
  92. <Para>For a complete definition of
  93. <StructName Role="typedef">DtEditorContentRec</StructName>, see
  94. &cdeman.Dt.Editor.h;.</Para>
  95. </RefSect1>
  96. <RefSect1>
  97. <Title>RETURN VALUE</Title>
  98. <Para>Upon successful completion, the
  99. <Function>DtEditorGetContents</Function> function returns
  100. <SystemItem Class="Constant">DtEDITOR_NO_ERRORS</SystemItem>; otherwise, it returns
  101. <SystemItem Class="Constant">DtEDITOR_INVALID_TYPE</SystemItem> if the Type field is not recognized.
  102. </Para>
  103. </RefSect1>
  104. <RefSect1>
  105. <Title>EXAMPLES</Title>
  106. <Para>The following code segment retrieves the contents of a DtEditor widget,
  107. marking that all changes to date have been saved.
  108. </Para>
  109. <InformalExample Remap="indent">
  110. <ProgramListing>Widget editor;
  111. DtEditorContentRec cr;
  112. DtEditorErrorCode status;
  113. Boolean markContentsAsSaved = True;
  114. cr.type = DtEDITOR_TEXT;
  115. status = DtEditorGetContents(editor, &amp;cr, False, markContentsAsSaved);
  116. if (status == DtEDITOR_NO_ERRORS)
  117. printf("The contents are:&bsol;n%s&bsol;n", cr.value.string);
  118. else
  119. printf("Unable to retrieve contents of the widget&bsol;n");
  120. </ProgramListing>
  121. </InformalExample>
  122. </RefSect1>
  123. <RefSect1>
  124. <Title>APPLICATION USAGE</Title>
  125. <Para>To write the data directly to a file, the application should use
  126. &cdeman.DtEditorSaveContentsToFile;.</Para>
  127. </RefSect1>
  128. <RefSect1>
  129. <Title>SEE ALSO</Title>
  130. <Para>&cdeman.Dt.Editor.h;, &cdeman.DtEditor;, &cdeman.DtEditorAppend;, &cdeman.DtEditorAppendFromFile;, &cdeman.DtEditorCheckForUnsavedChanges;, &cdeman.DtEditorInsert;, &cdeman.DtEditorInsertFromFile;, &cdeman.DtEditorReplace;, &cdeman.DtEditorReplaceFromFile;, &cdeman.DtEditorSaveContentsToFile;, &cdeman.DtEditorSetContents;, &cdeman.DtEditorSetContentsFromFile;.</Para>
  131. </RefSect1>
  132. </RefEntry>
  133. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:40:24-->