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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxDataObject Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classwx_data_object-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxDataObject Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__group__class__dnd.html">Clipboard and Drag & Drop</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/dataobj.h></code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxDataObject:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_data_object__inherit__graph.png" border="0" usemap="#wx_data_object_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_data_object_inherit__map" id="wx_data_object_inherit__map">
<area shape="rect" id="node3" href="classwx_data_object_composite.html" title="wxDataObjectComposite is the simplest wxDataObject derivation which may be used to support multiple f..." alt="" coords="157,81,320,109"/><area shape="rect" id="node5" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class." alt="" coords="168,131,309,159"/><area shape="rect" id="node7" href="classwx_bitmap_data_object.html" title="wxBitmapDataObject is a specialization of wxDataObject for bitmap data." alt="" coords="391,5,532,33"/><area shape="rect" id="node9" href="classwx_custom_data_object.html" title="wxCustomDataObject is a specialization of wxDataObjectSimple for some application-specific data in ar..." alt="" coords="388,55,535,83"/><area shape="rect" id="node11" href="classwx_file_data_object.html" title="wxFileDataObject is a specialization of wxDataObject for file names." alt="" coords="400,106,523,134"/><area shape="rect" id="node13" href="classwx_h_t_m_l_data_object.html" title="wxHTMLDataObject is used for working with HTML-formatted text." alt="" coords="393,157,529,185"/><area shape="rect" id="node15" href="classwx_rich_text_buffer_data_object.html" title="Implements a rich text data object for clipboard transfer." alt="" coords="368,207,555,235"/><area shape="rect" id="node17" href="classwx_text_data_object.html" title="wxTextDataObject is a specialization of wxDataObjectSimple for text data." alt="" coords="399,258,524,286"/><area shape="rect" id="node19" href="classwx_u_r_l_data_object.html" title="wxURLDataObject is a wxDataObject containing an URL and can be used e.g." alt="" coords="604,258,729,286"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> represents data that can be copied to or from the clipboard, or dragged and dropped. </p>
<p>The important thing about <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> is that this is a 'smart' piece of data unlike 'dumb' data containers such as memory buffers or files. Being 'smart' here means that the data object itself should know what data formats it supports and how to render itself in each of its supported formats.</p>
<p>A supported format, incidentally, is exactly the format in which the data can be requested from a data object or from which the data object may be set. In the general case, an object may support different formats on 'input' and 'output', i.e. it may be able to render itself in a given format but not be created from data on this format or vice versa. <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> defines the <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">wxDataObject::Direction</a> enumeration type which distinguishes between them.</p>
<p>See <a class="el" href="classwx_data_format.html" title="A wxDataFormat is an encapsulation of a platform-specific format handle which is used by the system f...">wxDataFormat</a> documentation for more about formats.</p>
<p>Not surprisingly, being 'smart' comes at a price of added complexity. This is reasonable for the situations when you really need to support multiple formats, but may be annoying if you only want to do something simple like cut and paste text.</p>
<p>To provide a solution for both cases, wxWidgets has two predefined classes which derive from <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a>: <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a> and <a class="el" href="classwx_data_object_composite.html" title="wxDataObjectComposite is the simplest wxDataObject derivation which may be used to support multiple f...">wxDataObjectComposite</a>. <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a> is the simplest <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> possible and only holds data in a single format (such as HTML or text) and <a class="el" href="classwx_data_object_composite.html" title="wxDataObjectComposite is the simplest wxDataObject derivation which may be used to support multiple f...">wxDataObjectComposite</a> is the simplest way to implement a <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> that does support multiple formats because it achieves this by simply holding several <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a> objects.</p>
<p>So, you have several solutions when you need a <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> class (and you need one as soon as you want to transfer data via the clipboard or drag and drop):</p>
<ol type="1">
<li>Use one of the built-in classes.<ul>
<li>You may use <a class="el" href="classwx_text_data_object.html" title="wxTextDataObject is a specialization of wxDataObjectSimple for text data.">wxTextDataObject</a>, <a class="el" href="classwx_bitmap_data_object.html" title="wxBitmapDataObject is a specialization of wxDataObject for bitmap data.">wxBitmapDataObject</a> <a class="el" href="classwx_file_data_object.html" title="wxFileDataObject is a specialization of wxDataObject for file names.">wxFileDataObject</a>, <a class="el" href="classwx_u_r_l_data_object.html" title="wxURLDataObject is a wxDataObject containing an URL and can be used e.g.">wxURLDataObject</a> in the simplest cases when you only need to support one format and your data is either text, bitmap or list of files.</li>
</ul>
</li>
<li>Use <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a><ul>
<li>Deriving from <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a> is the simplest solution for custom data - you will only support one format and so probably won't be able to communicate with other programs, but data transfer will work in your program (or between different instances of it).</li>
</ul>
</li>
<li>Use <a class="el" href="classwx_data_object_composite.html" title="wxDataObjectComposite is the simplest wxDataObject derivation which may be used to support multiple f...">wxDataObjectComposite</a><ul>
<li>This is a simple but powerful solution which allows you to support any number of formats (either standard or custom if you combine it with the previous solution).</li>
</ul>
</li>
<li>Use <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> directly<ul>
<li>This is the solution for maximum flexibility and efficiency, but it is also the most difficult to implement.</li>
</ul>
</li>
</ol>
<p>Please note that the easiest way to use drag and drop and the clipboard with multiple formats is by using <a class="el" href="classwx_data_object_composite.html" title="wxDataObjectComposite is the simplest wxDataObject derivation which may be used to support multiple f...">wxDataObjectComposite</a>, but it is not the most efficient one as each <a class="el" href="classwx_data_object_simple.html" title="This is the simplest possible implementation of the wxDataObject class.">wxDataObjectSimple</a> would contain the whole data in its respective formats. Now imagine that you want to paste 200 pages of text in your proprietary format, as well as Word, RTF, HTML, Unicode and plain text to the clipboard and even today's computers are in trouble. For this case, you will have to derive from <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> directly and make it enumerate its formats and provide the data in the requested format on demand.</p>
<p>Note that neither the GTK+ data transfer mechanisms for clipboard and drag and drop, nor OLE data transfer, <em>copies</em> any data until another application actually requests the data. This is in contrast to the 'feel' offered to the user of a program who would normally think that the data resides in the clipboard after having pressed 'Copy' - in reality it is only declared to be <em>available</em>.</p>
<p>You may also derive your own data object classes from <a class="el" href="classwx_custom_data_object.html" title="wxCustomDataObject is a specialization of wxDataObjectSimple for some application-specific data in ar...">wxCustomDataObject</a> for user-defined types. The format of user-defined data is given as a mime-type string literal, such as "application/word" or "image/png". These strings are used as they are under Unix (so far only GTK+) to identify a format and are translated into their Windows equivalent under Win32 (using the OLE IDataObject for data exchange to and from the clipboard and for drag and drop). Note that the format string translation under Windows is not yet finished.</p>
<p>Each class derived directly from <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> must override and implement all of its functions which are pure virtual in the base class. The data objects which only render their data or only set it (i.e. work in only one direction), should return 0 from <a class="el" href="classwx_data_object.html#a3f82815810bf4dcc34e1a5783c9b8a62" title="Returns the number of available formats for rendering or setting the data.">GetFormatCount()</a>.</p>
<p><b>wxPerl Note:</b> This class is not currently usable from wxPerl; you may use Wx::PlDataObjectSimple instead.</p>
<h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxcore">wxCore</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__dnd.html">Clipboard and Drag & Drop</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="overview_dnd.html">Drag and Drop Overview</a>, <a class="el" href="page_samples.html#page_samples_dnd">Drag & Drop Sample</a>, <a class="el" href="classwx_file_data_object.html" title="wxFileDataObject is a specialization of wxDataObject for file names.">wxFileDataObject</a>, <a class="el" href="classwx_text_data_object.html" title="wxTextDataObject is a specialization of wxDataObjectSimple for text data.">wxTextDataObject</a>, <a class="el" href="classwx_bitmap_data_object.html" title="wxBitmapDataObject is a specialization of wxDataObject for bitmap data.">wxBitmapDataObject</a>, <a class="el" href="classwx_custom_data_object.html" title="wxCustomDataObject is a specialization of wxDataObjectSimple for some application-specific data in ar...">wxCustomDataObject</a>, <a class="el" href="classwx_drop_target.html" title="This class represents a target for a drag and drop operation.">wxDropTarget</a>, <a class="el" href="classwx_drop_source.html" title="This class represents a source for a drag and drop operation.">wxDropSource</a>, <a class="el" href="classwx_text_drop_target.html" title="A predefined drop target for dealing with text data.">wxTextDropTarget</a>, <a class="el" href="classwx_file_drop_target.html" title="This is a drop target which accepts files (dragged from File Manager or Explorer).">wxFileDropTarget</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a7623fd02a6bef5dba7c96ff0a1a692ef"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> { <br/>
  <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a> = 0x01,
<br/>
  <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efa2ab9d7f173f2d17dc8ee7324ed3410b6">Set</a> = 0x02,
<br/>
  <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efa1f94b69e55238c5470f85e252b5fd8df">Both</a> = 0x03
<br/>
}</td></tr>
<tr class="separator:a7623fd02a6bef5dba7c96ff0a1a692ef"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa910d21b55e45638567f770aa71a44da"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#aa910d21b55e45638567f770aa71a44da">wxDataObject</a> ()</td></tr>
<tr class="memdesc:aa910d21b55e45638567f770aa71a44da"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#aa910d21b55e45638567f770aa71a44da"></a><br/></td></tr>
<tr class="separator:aa910d21b55e45638567f770aa71a44da"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a392665fe790cd29de240223b5bd2936c"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a392665fe790cd29de240223b5bd2936c">~wxDataObject</a> ()</td></tr>
<tr class="memdesc:a392665fe790cd29de240223b5bd2936c"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a392665fe790cd29de240223b5bd2936c"></a><br/></td></tr>
<tr class="separator:a392665fe790cd29de240223b5bd2936c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71abcc4eb2229e936ea53ebdefa53bef"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a71abcc4eb2229e936ea53ebdefa53bef">GetAllFormats</a> (<a class="el" href="classwx_data_format.html">wxDataFormat</a> *formats, <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> dir=<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a>) const =0</td></tr>
<tr class="memdesc:a71abcc4eb2229e936ea53ebdefa53bef"><td class="mdescLeft"> </td><td class="mdescRight">Copies all formats supported in the given direction <em>dir</em> to the array pointed to by <em>formats</em>. <a href="#a71abcc4eb2229e936ea53ebdefa53bef"></a><br/></td></tr>
<tr class="separator:a71abcc4eb2229e936ea53ebdefa53bef"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa48761390b25d797d4cad393db752568"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#aa48761390b25d797d4cad393db752568">GetDataHere</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format, void *buf) const =0</td></tr>
<tr class="memdesc:aa48761390b25d797d4cad393db752568"><td class="mdescLeft"> </td><td class="mdescRight">The method will write the data of the format <em>format</em> to the buffer <em>buf</em>. <a href="#aa48761390b25d797d4cad393db752568"></a><br/></td></tr>
<tr class="separator:aa48761390b25d797d4cad393db752568"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10674c65e59f08ba318f942e410b8627"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a10674c65e59f08ba318f942e410b8627">GetDataSize</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format) const =0</td></tr>
<tr class="memdesc:a10674c65e59f08ba318f942e410b8627"><td class="mdescLeft"> </td><td class="mdescRight">Returns the data size of the given format <em>format</em>. <a href="#a10674c65e59f08ba318f942e410b8627"></a><br/></td></tr>
<tr class="separator:a10674c65e59f08ba318f942e410b8627"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3f82815810bf4dcc34e1a5783c9b8a62"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a3f82815810bf4dcc34e1a5783c9b8a62">GetFormatCount</a> (<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> dir=<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a>) const =0</td></tr>
<tr class="memdesc:a3f82815810bf4dcc34e1a5783c9b8a62"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of available formats for rendering or setting the data. <a href="#a3f82815810bf4dcc34e1a5783c9b8a62"></a><br/></td></tr>
<tr class="separator:a3f82815810bf4dcc34e1a5783c9b8a62"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a47570ed6123bbebec195a2b7f843103c"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classwx_data_format.html">wxDataFormat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#a47570ed6123bbebec195a2b7f843103c">GetPreferredFormat</a> (<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> dir=<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a>) const =0</td></tr>
<tr class="memdesc:a47570ed6123bbebec195a2b7f843103c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the preferred format for either rendering the data (if <em>dir</em> is <code>Get</code>, its default value) or for setting it. <a href="#a47570ed6123bbebec195a2b7f843103c"></a><br/></td></tr>
<tr class="separator:a47570ed6123bbebec195a2b7f843103c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab73fa5f1cb933c67df20ddb1fad99071"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#ab73fa5f1cb933c67df20ddb1fad99071">SetData</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format, size_t len, const void *buf)</td></tr>
<tr class="memdesc:ab73fa5f1cb933c67df20ddb1fad99071"><td class="mdescLeft"> </td><td class="mdescRight">Set the data in the format <em>format</em> of the length <em>len</em> provided in the buffer <em>buf</em>. <a href="#ab73fa5f1cb933c67df20ddb1fad99071"></a><br/></td></tr>
<tr class="separator:ab73fa5f1cb933c67df20ddb1fad99071"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaedc05373d1e6822c9795f57d8200b72"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_object.html#aaedc05373d1e6822c9795f57d8200b72">IsSupported</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format, <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> dir=<a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a>) const </td></tr>
<tr class="memdesc:aaedc05373d1e6822c9795f57d8200b72"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if this format is supported. <a href="#aaedc05373d1e6822c9795f57d8200b72"></a><br/></td></tr>
<tr class="separator:aaedc05373d1e6822c9795f57d8200b72"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a7623fd02a6bef5dba7c96ff0a1a692ef"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">wxDataObject::Direction</a></td>
</tr>
</table>
</div><div class="memdoc">
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397"></a>Get</em> </td><td>
<p>Format is supported by <a class="el" href="classwx_data_object.html#aa48761390b25d797d4cad393db752568" title="The method will write the data of the format format to the buffer buf.">GetDataHere()</a> </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a7623fd02a6bef5dba7c96ff0a1a692efa2ab9d7f173f2d17dc8ee7324ed3410b6"></a>Set</em> </td><td>
<p>Format is supported by <a class="el" href="classwx_data_object.html#ab73fa5f1cb933c67df20ddb1fad99071" title="Set the data in the format format of the length len provided in the buffer buf.">SetData()</a> </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a7623fd02a6bef5dba7c96ff0a1a692efa1f94b69e55238c5470f85e252b5fd8df"></a>Both</em> </td><td>
<p>Format is supported by both <a class="el" href="classwx_data_object.html#aa48761390b25d797d4cad393db752568" title="The method will write the data of the format format to the buffer buf.">GetDataHere()</a> and <a class="el" href="classwx_data_object.html#ab73fa5f1cb933c67df20ddb1fad99071" title="Set the data in the format format of the length len provided in the buffer buf.">SetData()</a> (unused currently) </p>
</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="aa910d21b55e45638567f770aa71a44da"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDataObject::wxDataObject </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
</div>
</div>
<a class="anchor" id="a392665fe790cd29de240223b5bd2936c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual wxDataObject::~wxDataObject </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a71abcc4eb2229e936ea53ebdefa53bef"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void wxDataObject::GetAllFormats </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_data_format.html">wxDataFormat</a> * </td>
<td class="paramname"><em>formats</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> </td>
<td class="paramname"><em>dir</em> = <code><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Copies all formats supported in the given direction <em>dir</em> to the array pointed to by <em>formats</em>. </p>
<p>There must be enough space for GetFormatCount(dir) formats in it.</p>
<p><b>wxPerl Note:</b> In wxPerl this method only takes the <em>dir</em> parameter. In scalar context it returns the first format in the list, in list context it returns a list containing all the supported formats. </p>
<p>Implemented in <a class="el" href="classwx_text_data_object.html#afab1f5add25010432a69e34f7ee7e8a1">wxTextDataObject</a>.</p>
</div>
</div>
<a class="anchor" id="aa48761390b25d797d4cad393db752568"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxDataObject::GetDataHere </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_data_format.html">wxDataFormat</a> & </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buf</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The method will write the data of the format <em>format</em> to the buffer <em>buf</em>. </p>
<p>In other words, copy the data from this object in the given format to the supplied buffer. Returns <span class="literal">true</span> on success, <span class="literal">false</span> on failure. </p>
<p>Implemented in <a class="el" href="classwx_rich_text_buffer_data_object.html#afc08d8f3fc63ed125aad62dc78430809">wxRichTextBufferDataObject</a>.</p>
</div>
</div>
<a class="anchor" id="a10674c65e59f08ba318f942e410b8627"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxDataObject::GetDataSize </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_data_format.html">wxDataFormat</a> & </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the data size of the given format <em>format</em>. </p>
<p>Implemented in <a class="el" href="classwx_rich_text_buffer_data_object.html#a7b41a93de4327d1170888e954387e936">wxRichTextBufferDataObject</a>.</p>
</div>
</div>
<a class="anchor" id="a3f82815810bf4dcc34e1a5783c9b8a62"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxDataObject::GetFormatCount </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> </td>
<td class="paramname"><em>dir</em> = <code><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a></code></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of available formats for rendering or setting the data. </p>
<p>Implemented in <a class="el" href="classwx_text_data_object.html#a43c1ec7300578d552ac3c25cfbdb9188">wxTextDataObject</a>.</p>
</div>
</div>
<a class="anchor" id="a47570ed6123bbebec195a2b7f843103c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classwx_data_format.html">wxDataFormat</a> wxDataObject::GetPreferredFormat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> </td>
<td class="paramname"><em>dir</em> = <code><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a></code></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the preferred format for either rendering the data (if <em>dir</em> is <code>Get</code>, its default value) or for setting it. </p>
<p>Usually this will be the native format of the <a class="el" href="classwx_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a>. </p>
<p>Implemented in <a class="el" href="classwx_rich_text_buffer_data_object.html#a3009d44515212141d1aa18f25a54db7e">wxRichTextBufferDataObject</a>.</p>
</div>
</div>
<a class="anchor" id="aaedc05373d1e6822c9795f57d8200b72"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDataObject::IsSupported </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_data_format.html">wxDataFormat</a> & </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692ef">Direction</a> </td>
<td class="paramname"><em>dir</em> = <code><a class="el" href="classwx_data_object.html#a7623fd02a6bef5dba7c96ff0a1a692efac7de2bf89290f75553da7f3cb8fa5397">Get</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if this format is supported. </p>
</div>
</div>
<a class="anchor" id="ab73fa5f1cb933c67df20ddb1fad99071"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxDataObject::SetData </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_data_format.html">wxDataFormat</a> & </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>buf</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the data in the format <em>format</em> of the length <em>len</em> provided in the buffer <em>buf</em>. </p>
<p>In other words, copy length bytes of data from the buffer to this data object.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">format</td><td>The format for which to set the data. </td></tr>
<tr><td class="paramname">len</td><td>The size of data in bytes. </td></tr>
<tr><td class="paramname">buf</td><td>Non-<span class="literal">NULL</span> pointer to the data. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> on success, <span class="literal">false</span> on failure. </dd></dl>
<p>Reimplemented in <a class="el" href="classwx_rich_text_buffer_data_object.html#aa9b77769053603a9d1214c12600f68ce">wxRichTextBufferDataObject</a>.</p>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:45 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|