summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxTextDataObject.xml
blob: 2339a488a25c813ceea4e9fea7be35b5a0810e8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxTextDataObject</title>
</header>
<module>wxTextDataObject</module>
<modulesummary>Functions for wxTextDataObject class</modulesummary>
<description><p><seeerl marker="wxTextDataObject"><c>wxTextDataObject</c></seeerl> is a specialization of <c>wxDataObjectSimple</c> (not implemented in wx) for text data. It can be used without change to paste data into the <seeerl marker="wxClipboard"><c>wxClipboard</c></seeerl> or a <c>wxDropSource</c> (not implemented in wx). A user may wish to derive a new class from this class for providing text on-demand in order to minimize memory consumption when offering data in several formats, such as plain text and RTF because by default the text is stored in a string in this class, but it might as well be generated when requested. For this, <seemfa marker="#getTextLength/1"><c>getTextLength/1</c></seemfa> and <seemfa marker="#getText/1"><c>getText/1</c></seemfa> will have to be overridden.
      </p><p>Note that if you already have the text inside a string, you will not achieve any efficiency gain by overriding these functions because copying wxStrings is already a very efficient operation (data is not actually copied because wxStrings are reference counted).
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_dnd.html#overview_dnd">Overview dnd</url>, <seeerl marker="wxDataObject"><c>wxDataObject</c></seeerl>, <c>wxDataObjectSimple</c> (not implemented in wx), <seeerl marker="wxFileDataObject"><c>wxFileDataObject</c></seeerl>, <seeerl marker="wxBitmapDataObject"><c>wxBitmapDataObject</c></seeerl>
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxDataObject"><c>wxDataObject</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_text_data_object.html">wxTextDataObject</url></p>
  </description>
<datatypes><datatype><name name="wxTextDataObject"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>See: <c>new/1</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary>Constructor, may be used to initialise the text (otherwise <c>setText/2</c> should be used later). </fsummary>
    <desc><p>Constructor, may be used to initialise the text (otherwise <seemfa marker="#setText/2"><c>setText/2</c></seemfa> should be used later). 
      </p></desc>
  </func>
  
  <func>
    <name name="getTextLength" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the data size. </fsummary>
    <desc><p>Returns the data size. 
      </p><p>By default, returns the size of the text data set in the constructor or using <seemfa marker="#setText/2"><c>setText/2</c></seemfa>. This can be overridden to provide text size data on-demand. It is recommended to return the text length plus 1 for a trailing zero, but this is not strictly required. 
      </p></desc>
  </func>
  
  <func>
    <name name="getText" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the text associated with the data object. </fsummary>
    <desc><p>Returns the text associated with the data object. 
      </p><p>You may wish to override this method when offering data on-demand, but this is not required by wxWidgets' internals. Use this method to get data in text form from the <seeerl marker="wxClipboard"><c>wxClipboard</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="setText" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the text associated with the data object. </fsummary>
    <desc><p>Sets the text associated with the data object. 
      </p><p>This method is called when the data object receives the data and, by default, copies the text into the member variable. If you want to process the text on the fly you may wish to override this function. 
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor</fsummary>
    <desc><p>Destroys the object.</p></desc>
  </func>
  </funcs>
</erlref>