]>
Commit | Line | Data |
---|---|---|
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
2 | %% Name: dobjsmpl.tex | |
3 | %% Purpose: wxDataObjectSimple documentation | |
4 | %% Author: Vadim Zeitlin | |
5 | %% Modified by: | |
6 | %% Created: 02.11.99 | |
7 | %% RCS-ID: $Id$ | |
8 | %% Copyright: (c) Vadim Zeitlin | |
9 | %% License: wxWindows license | |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | ||
12 | \section{\class{wxDataObjectSimple}}\label{wxdataobjectsimple} | |
13 | ||
14 | This is the simplest possible implementation of the | |
15 | \helpref{wxDataObject}{wxdataobject} class. The data object of (a class derived | |
16 | from) this class only supports one format, so the number of virtual functions | |
17 | to be implemented is reduced. | |
18 | ||
19 | Notice that this is still an abstract base class and cannot be used but should | |
20 | be derived from. | |
21 | ||
22 | \pythonnote{If you wish to create a derived wxDataObjectSimple class in | |
23 | wxPython you should derive the class from wxPyDataObjectSimple | |
24 | in order to get Python-aware capabilities for the various virtual | |
25 | methods.} | |
26 | ||
27 | \perlnote{In wxPerl, you need to derive your data object class | |
28 | from Wx::PlDataObjectSimple.} | |
29 | ||
30 | \wxheading{Virtual functions to override} | |
31 | ||
32 | The objects supporting rendering the data must override | |
33 | \helpref{GetDataSize}{wxdataobjectsimplegetdatasize} and | |
34 | \helpref{GetDataHere}{wxdataobjectsimplegetdatahere} while the objects which | |
35 | may be set must override \helpref{SetData}{wxdataobjectsimplesetdata}. Of | |
36 | course, the objects supporting both operations must override all three | |
37 | methods. | |
38 | ||
39 | \wxheading{Derived from} | |
40 | ||
41 | \helpref{wxDataObject}{wxdataobject} | |
42 | ||
43 | \wxheading{Include files} | |
44 | ||
45 | <wx/dataobj.h> | |
46 | ||
47 | \wxheading{See also} | |
48 | ||
49 | \helpref{Clipboard and drag and drop overview}{wxdndoverview}, | |
50 | \helpref{DnD sample}{samplednd}, | |
51 | \helpref{wxFileDataObject}{wxfiledataobject}, | |
52 | \helpref{wxTextDataObject}{wxtextdataobject}, | |
53 | \helpref{wxBitmapDataObject}{wxbitmapdataobject} | |
54 | ||
55 | \latexignore{\rtfignore{\wxheading{Members}}} | |
56 | ||
57 | \membersection{wxDataObjectSimple::wxDataObjectSimple}\label{wxdataobjectsimplewxdataobjectsimple} | |
58 | ||
59 | \func{}{wxDataObjectSimple}{\param{const wxDataFormat\&}{ format = wxFormatInvalid}} | |
60 | ||
61 | Constructor accepts the supported format (none by default) which may also be | |
62 | set later with \helpref{SetFormat}{wxdataobjectsimplesetformat}. | |
63 | ||
64 | \membersection{wxDataObjectSimple::GetFormat}\label{wxdataobjectsimplegetformat} | |
65 | ||
66 | \constfunc{const wxDataFormat\&}{GetFormat}{\void} | |
67 | ||
68 | Returns the (one and only one) format supported by this object. It is supposed | |
69 | that the format is supported in both directions. | |
70 | ||
71 | \membersection{wxDataObjectSimple::SetFormat}\label{wxdataobjectsimplesetformat} | |
72 | ||
73 | \func{void}{SetFormat}{\param{const wxDataFormat\&}{ format}} | |
74 | ||
75 | Sets the supported format. | |
76 | ||
77 | \membersection{wxDataObjectSimple::GetDataSize}\label{wxdataobjectsimplegetdatasize} | |
78 | ||
79 | \constfunc{virtual size\_t}{GetDataSize}{\void} | |
80 | ||
81 | Gets the size of our data. Must be implemented in the derived class if the | |
82 | object supports rendering its data. | |
83 | ||
84 | \membersection{wxDataObjectSimple::GetDataHere}\label{wxdataobjectsimplegetdatahere} | |
85 | ||
86 | \constfunc{virtual bool}{GetDataHere}{\param{void }{*buf}} | |
87 | ||
88 | Copy the data to the buffer, return true on success. Must be implemented in the | |
89 | derived class if the object supports rendering its data. | |
90 | ||
91 | \pythonnote{When implementing this method in wxPython, no additional | |
92 | parameters are required and the data should be returned from the | |
93 | method as a string.} | |
94 | ||
95 | \membersection{wxDataObjectSimple::SetData}\label{wxdataobjectsimplesetdata} | |
96 | ||
97 | \func{virtual bool}{SetData}{\param{size\_t }{len}, \param{const void }{*buf}} | |
98 | ||
99 | Copy the data from the buffer, return true on success. Must be implemented in | |
100 | the derived class if the object supports setting its data. | |
101 | ||
102 | \pythonnote{When implementing this method in wxPython, the data comes | |
103 | as a single string parameter rather than the two shown here.} | |
104 |