1QWindowsMime(3qt) QWindowsMime(3qt)
2
3
4
6 QWindowsMime - Maps open-standard MIME to Window Clipboard formats
7
9 #include <qmime.h>
10
11 Public Members
12 QWindowsMime ()
13 virtual ~QWindowsMime ()
14 virtual const char * convertorName () = 0
15 virtual int countCf () = 0
16 virtual int cf ( int index ) = 0
17 virtual bool canConvert ( const char * mime, int cf ) = 0
18 virtual const char * mimeFor ( int cf ) = 0
19 virtual int cfFor ( const char * mime ) = 0
20 virtual QByteArray convertToMime ( QByteArray data, const char * mime,
21 int cf ) = 0
22 virtual QByteArray convertFromMime ( QByteArray data, const char *
23 mime, int cf ) = 0
24
25 Static Public Members
26 void initialize ()
27 QPtrList<QWindowsMime> all ()
28 QWindowsMime * convertor ( const char * mime, int cf )
29 const char * cfToMime ( int cf )
30
32 The QWindowsMime class maps open-standard MIME to Window Clipboard
33 formats.
34
35 Qt's drag-and-drop and clipboard facilities use the MIME standard. On
36 X11, this maps trivially to the Xdnd protocol, but on Windows although
37 some applications use MIME types to describe clipboard formats, others
38 use arbitrary non-standardized naming conventions, or unnamed built-in
39 formats of Windows.
40
41 By instantiating subclasses of QWindowsMime that provide conversions
42 between Windows Clipboard and MIME formats, you can convert proprietary
43 clipboard formats to MIME formats.
44
45 Qt has predefined support for the following Windows Clipboard formats:
46
47 CF_UNICODETEXT - converted to "text/plain;charset=ISO-10646-UCS-2" and
48 supported by QTextDrag.
49
50 CF_TEXT - converted to "text/plain;charset=system" or "text/plain" and
51 supported by QTextDrag.
52
53 CF_DIB - converted to "image/*", where * is a Qt image format, and
54 supported by QImageDrag.
55
56 CF_HDROP - converted to "text/uri-list", and supported by QUriDrag.
57
58 An example use of this class would be to map the Windows Metafile
59 clipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-
60 wmf". This conversion might simply be adding or removing a header, or
61 even just passing on the data. See the Drag-and-Drop documentation for
62 more information on choosing and definition MIME types.
63
64 You can check if a MIME type is convertible using canConvert() and can
65 perform conversions with convertToMime() and convertFromMime().
66
67 See also Drag And Drop Classes, Input/Output and Networking, and
68 Miscellaneous Classes.
69
72 Constructs a new conversion object, adding it to the globally accessed
73 list of available convertors.
74
76 Destroys a conversion object, removing it from the global list of
77 available convertors.
78
80 Returns a list of all currently defined QWindowsMime objects.
81
83 Returns TRUE if the convertor can convert (both ways) between mime and
84 cf; otherwise returns FALSE.
85
86 All subclasses must reimplement this pure virtual function.
87
89 Returns the Windows Clipboard format supported by this convertor that
90 is ordinarily at position index. This means that cf(0) returns the
91 first Windows Clipboard format supported, and cf(countCf()-1) returns
92 the last. If index is out of range the return value is undefined.
93
94 All subclasses must reimplement this pure virtual function.
95
97 Returns the Windows Clipboard type used for MIME type mime, or 0 if
98 this convertor does not support mime.
99
100 All subclasses must reimplement this pure virtual function.
101
103 Returns a MIME type for cf, or 0 if none exists.
104
106 int cf ) [pure virtual]
107 Returns data converted from MIME type mime to Windows Clipboard format
108 cf.
109
110 Note that Windows Clipboard formats must all be self-terminating. The
111 return value may contain trailing data.
112
113 All subclasses must reimplement this pure virtual function.
114
116 int cf ) [pure virtual]
117 Returns data converted from Windows Clipboard format cf to MIME type
118 mime.
119
120 Note that Windows Clipboard formats must all be self-terminating. The
121 input data may contain trailing data.
122
123 All subclasses must reimplement this pure virtual function.
124
126 Returns the most-recently created QWindowsMime that can convert between
127 the mime and cf formats. Returns 0 if no such convertor exists.
128
130 Returns a name for the convertor.
131
132 All subclasses must reimplement this pure virtual function.
133
135 Returns the number of Windows Clipboard formats supported by this
136 convertor.
137
138 All subclasses must reimplement this pure virtual function.
139
141 This is an internal function.
142
144 Returns the MIME type used for Windows Clipboard format cf, or 0 if
145 this convertor does not support cf.
146
147 All subclasses must reimplement this pure virtual function.
148
149
151 http://doc.trolltech.com/qwindowsmime.html
152 http://www.trolltech.com/faq/tech.html
153
155 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
156 license file included in the distribution for a complete license
157 statement.
158
160 Generated automatically from the source code.
161
163 If you find a bug in Qt, please report it as described in
164 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
165 help you. Thank you.
166
167 The definitive Qt documentation is provided in HTML format; it is
168 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
169 web browser. This man page is provided as a convenience for those users
170 who prefer man pages, although this format is not officially supported
171 by Trolltech.
172
173 If you find errors in this manual page, please report them to qt-
174 bugs@trolltech.com. Please include the name of the manual page
175 (qwindowsmime.3qt) and the Qt version (3.3.8).
176
177
178
179Trolltech AS 2 February 2007 QWindowsMime(3qt)