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
|
<!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: wxDataFormat 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-methods">Public Member Functions</a> |
<a href="classwx_data_format-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxDataFormat Class Reference<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>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <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> is an encapsulation of a platform-specific format handle which is used by the system for the clipboard and drag and drop operations. </p>
<p>The applications are usually only interested in, for example, pasting data from the clipboard only if the data is in a format the program understands and a data format is something which uniquely identifies this format.</p>
<p>On the system level, a data format is usually just a number (<code>CLIPFORMAT</code> under Windows or <code>Atom</code> under X11, for example) and the standard formats are, indeed, just numbers which can be implicitly converted to <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>. The standard formats are:</p>
<table class="doclist" border="1" cellspacing="0">
<tr>
<td><span class="itemdef">wxDF_INVALID</span> </td><td>An invalid format - used as default argument for functions taking a <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> argument sometimes. </td></tr>
<tr>
<td><span class="itemdef">wxDF_TEXT</span> </td><td>Text format (<a class="el" href="classwx_string.html" title="String class for passing textual data to or receiving it from wxWidgets.">wxString</a>). </td></tr>
<tr>
<td><span class="itemdef">wxDF_BITMAP</span> </td><td>A bitmap (<a class="el" href="classwx_bitmap.html" title="This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or co...">wxBitmap</a>). </td></tr>
<tr>
<td><span class="itemdef">wxDF_METAFILE</span> </td><td>A metafile (<a class="el" href="classwx_metafile.html" title="A wxMetafile represents the MS Windows metafile object, so metafile operations have no effect in X...">wxMetafile</a>, Windows only). </td></tr>
<tr>
<td><span class="itemdef">wxDF_FILENAME</span> </td><td>A list of filenames. </td></tr>
<tr>
<td><span class="itemdef">wxDF_HTML</span> </td><td>An HTML string. This is currently only valid on Mac and MSW. </td></tr>
</table>
<p>As mentioned above, these standard formats may be passed to any function taking <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> argument because <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> has an implicit conversion from them (or, to be precise from the type <code>wxDataFormat::NativeFormat</code> which is the type used by the underlying platform for data formats).</p>
<p>Aside the standard formats, the application may also use custom formats which are identified by their names (strings) and not numeric identifiers. Although internally custom format must be created (or <em>registered</em>) first, you shouldn't care about it because it is done automatically the first time the <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> object corresponding to a given format name is created. The only implication of this is that you should avoid having global <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> objects with non-default constructor because their constructors are executed before the program has time to perform all necessary initialisations and so an attempt to do clipboard format registration at this time will usually lead to a crash!</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_data_object.html" title="A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped...">wxDataObject</a> </dd></dl>
</div><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:add51a8562152c7925113829dc297c43f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#add51a8562152c7925113829dc297c43f">wxDataFormat</a> (<a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> format=<a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047a8e449ff1cdf3fe95c9af901bb89d4053">wxDF_INVALID</a>)</td></tr>
<tr class="memdesc:add51a8562152c7925113829dc297c43f"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a data format object for one of the standard data formats or an empty data object (use <a class="el" href="classwx_data_format.html#a9400041e82a194b015bdf9d90805f701" title="Sets the format to the given value, which should be one of wxDF_XXX constants.">SetType()</a> or <a class="el" href="classwx_data_format.html#a3b3748f25fc57f360b3ea5f68c238ee7" title="Sets the format to be the custom format identified by the given name.">SetId()</a> later in this case). <a href="#add51a8562152c7925113829dc297c43f"></a><br/></td></tr>
<tr class="separator:add51a8562152c7925113829dc297c43f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6c08911611be5e3a5dd35528b4d091db"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a6c08911611be5e3a5dd35528b4d091db">wxDataFormat</a> (const <a class="el" href="classwx_string.html">wxString</a> &format)</td></tr>
<tr class="memdesc:a6c08911611be5e3a5dd35528b4d091db"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a data format object for a custom format identified by its name <em>format</em>. <a href="#a6c08911611be5e3a5dd35528b4d091db"></a><br/></td></tr>
<tr class="separator:a6c08911611be5e3a5dd35528b4d091db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aad852ba717c2db4d3d61b9e4ac2f09d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#aad852ba717c2db4d3d61b9e4ac2f09d9">GetId</a> () const </td></tr>
<tr class="memdesc:aad852ba717c2db4d3d61b9e4ac2f09d9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of a custom format (this function will fail for a standard format). <a href="#aad852ba717c2db4d3d61b9e4ac2f09d9"></a><br/></td></tr>
<tr class="separator:aad852ba717c2db4d3d61b9e4ac2f09d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0747b4235e1df0e2eead9cba3bbc53e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a0747b4235e1df0e2eead9cba3bbc53e9">GetType</a> () const </td></tr>
<tr class="memdesc:a0747b4235e1df0e2eead9cba3bbc53e9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the platform-specific number identifying the format. <a href="#a0747b4235e1df0e2eead9cba3bbc53e9"></a><br/></td></tr>
<tr class="separator:a0747b4235e1df0e2eead9cba3bbc53e9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b3748f25fc57f360b3ea5f68c238ee7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a3b3748f25fc57f360b3ea5f68c238ee7">SetId</a> (const <a class="el" href="classwx_string.html">wxString</a> &format)</td></tr>
<tr class="memdesc:a3b3748f25fc57f360b3ea5f68c238ee7"><td class="mdescLeft"> </td><td class="mdescRight">Sets the format to be the custom format identified by the given name. <a href="#a3b3748f25fc57f360b3ea5f68c238ee7"></a><br/></td></tr>
<tr class="separator:a3b3748f25fc57f360b3ea5f68c238ee7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9400041e82a194b015bdf9d90805f701"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a9400041e82a194b015bdf9d90805f701">SetType</a> (<a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> type)</td></tr>
<tr class="memdesc:a9400041e82a194b015bdf9d90805f701"><td class="mdescLeft"> </td><td class="mdescRight">Sets the format to the given value, which should be one of wxDF_XXX constants. <a href="#a9400041e82a194b015bdf9d90805f701"></a><br/></td></tr>
<tr class="separator:a9400041e82a194b015bdf9d90805f701"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3195c7a3d956201e8ef5076796814fd9"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a3195c7a3d956201e8ef5076796814fd9">operator!=</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format) const </td></tr>
<tr class="memdesc:a3195c7a3d956201e8ef5076796814fd9"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the formats are different. <a href="#a3195c7a3d956201e8ef5076796814fd9"></a><br/></td></tr>
<tr class="separator:a3195c7a3d956201e8ef5076796814fd9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a21fdc4110ef2504bfae857dcb3c6c144"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#a21fdc4110ef2504bfae857dcb3c6c144">operator!=</a> (<a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> format) const </td></tr>
<tr class="memdesc:a21fdc4110ef2504bfae857dcb3c6c144"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the formats are different. <a href="#a21fdc4110ef2504bfae857dcb3c6c144"></a><br/></td></tr>
<tr class="separator:a21fdc4110ef2504bfae857dcb3c6c144"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aade3c187a590872495bdae7c87e478b3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#aade3c187a590872495bdae7c87e478b3">operator==</a> (const <a class="el" href="classwx_data_format.html">wxDataFormat</a> &format) const </td></tr>
<tr class="memdesc:aade3c187a590872495bdae7c87e478b3"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the formats are equal. <a href="#aade3c187a590872495bdae7c87e478b3"></a><br/></td></tr>
<tr class="separator:aade3c187a590872495bdae7c87e478b3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaca5c8ae97f3e1efa5490edcc524af02"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_data_format.html#aaca5c8ae97f3e1efa5490edcc524af02">operator==</a> (<a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> format) const </td></tr>
<tr class="memdesc:aaca5c8ae97f3e1efa5490edcc524af02"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the formats are equal. <a href="#aaca5c8ae97f3e1efa5490edcc524af02"></a><br/></td></tr>
<tr class="separator:aaca5c8ae97f3e1efa5490edcc524af02"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="add51a8562152c7925113829dc297c43f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDataFormat::wxDataFormat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> </td>
<td class="paramname"><em>format</em> = <code><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047a8e449ff1cdf3fe95c9af901bb89d4053">wxDF_INVALID</a></code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a data format object for one of the standard data formats or an empty data object (use <a class="el" href="classwx_data_format.html#a9400041e82a194b015bdf9d90805f701" title="Sets the format to the given value, which should be one of wxDF_XXX constants.">SetType()</a> or <a class="el" href="classwx_data_format.html#a3b3748f25fc57f360b3ea5f68c238ee7" title="Sets the format to be the custom format identified by the given name.">SetId()</a> later in this case). </p>
<p><b>wxPerl Note:</b> In wxPerl use Wx::Bitmap->newNative(format). </p>
</div>
</div>
<a class="anchor" id="a6c08911611be5e3a5dd35528b4d091db"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDataFormat::wxDataFormat </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a data format object for a custom format identified by its name <em>format</em>. </p>
<p><b>wxPerl Note:</b> In wxPerl use Wx::Bitmap->newUser(format). </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aad852ba717c2db4d3d61b9e4ac2f09d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxDataFormat::GetId </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of a custom format (this function will fail for a standard format). </p>
</div>
</div>
<a class="anchor" id="a0747b4235e1df0e2eead9cba3bbc53e9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> wxDataFormat::GetType </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the platform-specific number identifying the format. </p>
</div>
</div>
<a class="anchor" id="a3195c7a3d956201e8ef5076796814fd9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDataFormat::operator!= </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>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the formats are different. </p>
</div>
</div>
<a class="anchor" id="a21fdc4110ef2504bfae857dcb3c6c144"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDataFormat::operator!= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the formats are different. </p>
</div>
</div>
<a class="anchor" id="aade3c187a590872495bdae7c87e478b3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDataFormat::operator== </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>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the formats are equal. </p>
</div>
</div>
<a class="anchor" id="aaca5c8ae97f3e1efa5490edcc524af02"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDataFormat::operator== </td>
<td>(</td>
<td class="paramtype"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the formats are equal. </p>
</div>
</div>
<a class="anchor" id="a3b3748f25fc57f360b3ea5f68c238ee7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxDataFormat::SetId </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the format to be the custom format identified by the given name. </p>
</div>
</div>
<a class="anchor" id="a9400041e82a194b015bdf9d90805f701"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxDataFormat::SetType </td>
<td>(</td>
<td class="paramtype"><a class="el" href="defs_8h.html#a263109c79f708754bf656c7768b27047">wxDataFormatId</a> </td>
<td class="paramname"><em>type</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the format to the given value, which should be one of wxDF_XXX constants. </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>
|