]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dataform.tex
fixed MSLU check
[wxWidgets.git] / docs / latex / wx / dataform.tex
CommitLineData
c03648c2
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: dataform.tex
3%% Purpose: wxDataFormat documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 03.11.99
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
f6bcfd97 9%% License: wxWindows license
c03648c2
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxDataFormat}}\label{wxdataformat}
13
14A wxDataFormat is an encapsulation of a platform-specific format handle which
15is used by the system for the clipboard and drag and drop operations. The
16applications are usually only interested in, for example, pasting data from the
17clipboard only if the data is in a format the program understands and a data
18format is something which uniquely identifies this format.
19
20On the system level, a data format is usually just a number ({\tt CLIPFORMAT}
21under Windows or {\tt Atom} under X11, for example) and the standard formats
22are, indeed, just numbers which can be implicitly converted to wxDataFormat.
23The standard formats are:
24
25\begin{twocollist}\itemsep=1cm
26\twocolitem{wxDF\_INVALID}{An invalid format - used as default argument for
27functions taking a wxDataFormat argument sometimes}
28\twocolitem{wxDF\_TEXT}{Text format (wxString)}
29\twocolitem{wxDF\_BITMAP}{A bitmap (wxBitmap)}
30\twocolitem{wxDF\_METAFILE}{A metafile (wxMetafile, Windows only)}
31\twocolitem{wxDF\_FILENAME}{A list of filenames}
32\end{twocollist}
33
34As mentioned above, these standard formats may be passed to any function taking
35wxDataFormat argument because wxDataFormat has an implicit conversion from
36them (or, to be precise from the type {\tt wxDataFormat::NativeFormat} which is
37the type used by the underlying platform for data formats).
38
39Aside the standard formats, the application may also use custom formats which
40are identified by their names (strings) and not numeric identifiers. Although
41internally custom format must be created (or {\it registered}) first, you
42shouldn't care about it because it is done automatically the first time the
43wxDataFormat object corresponding to a given format name is created. The only
44implication of this is that you should avoid having global wxDataFormat objects
45with non-default constructor because their constructors are executed before the
46program has time to perform all necessary initialisations and so an attempt to
47do clipboard format registration at this time will usually lead to a crash!
48
49\wxheading{Virtual functions to override}
50
fa482912 51None
c03648c2
VZ
52
53\wxheading{Derived from}
54
55None
56
57\wxheading{See also}
58
59\helpref{Clipboard and drag and drop overview}{wxdndoverview},
60\helpref{DnD sample}{samplednd},
61\helpref{wxDataObject}{wxdataobject}
62
63\latexignore{\rtfignore{\wxheading{Members}}}
64
65\membersection{wxDataFormat::wxDataFormat}\label{wxdataformatwxdataformatdef}
66
67\func{}{wxDataFormat}{\param{NativeFormat}{ format = wxDF\_INVALID}}
68
69Constructs a data format object for one of the standard data formats or an
70empty data object (use \helpref{SetType}{wxdataformatsettype} or
71\helpref{SetId}{wxdataformatsetid} later in this case)
72
0a67eeac
MB
73\perlnote{In wxPerl this function is named {\tt newNative}.}
74
c03648c2
VZ
75\membersection{wxDataFormat::wxDataFormat}\label{wxdataformatwxdataformat}
76
77\func{}{wxDataFormat}{\param{const wxChar }{*format}}
78
79Constructs a data format object for a custom format identified by its name
80{\it format}.
81
0a67eeac
MB
82\perlnote{In wxPerl this function is named {\tt newUser}.}
83
c03648c2
VZ
84\membersection{wxDataFormat::operator $==$}\label{wxdataformatoperatoreq}
85
86\constfunc{bool}{operator $==$}{\param{const wxDataFormat\&}{ format}}
87
88Returns TRUE if the formats are equal.
89
90\membersection{wxDataFormat::operator $!=$}\label{wxdataformatoperatorneq}
91
92\constfunc{bool}{operator $!=$}{\param{const wxDataFormat\&}{ format}}
93
94Returns TRUE if the formats are different.
95
96\membersection{wxDataFormat::GetId}\label{wxdataformatgetid}
97
98\constfunc{wxString}{GetId}{\void}
99
100Returns the name of a custom format (this function will fail for a standard
101format).
102
103\membersection{wxDataFormat::GetType}\label{wxdataformatgettype}
104
105\constfunc{NativeFormat}{GetType}{\void}
106
107Returns the platform-specific number identifying the format.
108
109\membersection{wxDataFormat::SetId}\label{wxdataformatsetid}
110
111\func{void}{SetId}{\param{const wxChar }{*format}}
112
113Sets the format to be the custom format identified by the given name.
114
115\membersection{wxDataFormat::SetType}\label{wxdataformatsettype}
116
117\func{void}{SetType}{\param{NativeFormat}{ format}}
118
0a2017e0
JS
119Sets the format to the given value, which should be one of wxDF\_XXX constants.
120