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