source: trunk/doc/html/qmime-h.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 7.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qmime.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qmime.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qmime.h</h1>
33
34<p>This is the verbatim text of the qmime.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qmime-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of mime classes
41**
42** Created : 981204
43**
44** Copyright (C) 1998-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the kernel module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73
74#ifndef QMIME_H
75#define QMIME_H
76
77#ifndef QT_H
78#include "qwindowdefs.h"
79#include "qmap.h"
80#endif // QT_H
81
82#ifndef QT_NO_MIME
83
84class QImageDrag;
85class QTextDrag;
86
87class Q_EXPORT QMimeSource
88{
89 friend class QClipboardData;
90
91public:
92 QMimeSource();
93 virtual ~QMimeSource();
94 virtual const char* format( int n = 0 ) const = 0;
95 virtual bool provides( const char* ) const;
96 virtual QByteArray encodedData( const char* ) const = 0;
97 int serialNumber() const;
98
99private:
100 int ser_no;
101 enum { NoCache, Text, Graphics } cacheType;
102 union
103 {
104 struct
105 {
106 QString *str;
107 QCString *subtype;
108 } txt;
109 struct
110 {
111 QImage *img;
112 QPixmap *pix;
113 } gfx;
114 } cache;
115 void clearCache();
116
117 // friends for caching
118 friend class QImageDrag;
119 friend class QTextDrag;
120
121};
122
123inline int QMimeSource::serialNumber() const
124{ return ser_no; }
125
126class QStringList;
127class QMimeSourceFactoryData;
128
129class Q_EXPORT QMimeSourceFactory {
130public:
131 QMimeSourceFactory();
132 virtual ~QMimeSourceFactory();
133
134 static QMimeSourceFactory* defaultFactory();
135 static void setDefaultFactory( QMimeSourceFactory* );
136 static QMimeSourceFactory* takeDefaultFactory();
137 static void addFactory( QMimeSourceFactory *f );
138 static void removeFactory( QMimeSourceFactory *f );
139
140 virtual const QMimeSource* data(const QString&amp; abs_name) const;
141 virtual QString makeAbsolute(const QString&amp; abs_or_rel_name, const QString&amp; context) const;
142 const QMimeSource* data(const QString&amp; abs_or_rel_name, const QString&amp; context) const;
143
144 virtual void setText( const QString&amp; abs_name, const QString&amp; text );
145 virtual void setImage( const QString&amp; abs_name, const QImage&amp; im );
146 virtual void setPixmap( const QString&amp; abs_name, const QPixmap&amp; pm );
147 virtual void setData( const QString&amp; abs_name, QMimeSource* data );
148 virtual void setFilePath( const QStringList&amp; );
149 virtual QStringList filePath() const;
150 void addFilePath( const QString&amp; );
151 virtual void setExtensionType( const QString&amp; ext, const char* mimetype );
152
153private:
154 QMimeSource *dataInternal(const QString&amp; abs_name, const QMap&lt;QString, QString&gt; &amp;extensions ) const;
155 QMimeSourceFactoryData* d;
156};
157
158#if defined(Q_WS_WIN)
159
160#ifndef QT_H
161#include "qptrlist.h" // down here for GCC 2.7.* compatibility
162#endif // QT_H
163
164/*
165 Encapsulation of conversion between MIME and Windows CLIPFORMAT.
166 Not need on X11, as the underlying protocol uses the MIME standard
167 directly.
168*/
169
170class Q_EXPORT QWindowsMime {
171public:
172 QWindowsMime();
173 virtual ~QWindowsMime();
174
175 static void initialize();
176
177 static QPtrList&lt;QWindowsMime&gt; all();
178 static QWindowsMime* convertor( const char* mime, int cf );
179 static const char* cfToMime(int cf);
180
181 static int registerMimeType(const char *mime);
182
183 virtual const char* convertorName()=0;
184 virtual int countCf()=0;
185 virtual int cf(int index)=0;
186 virtual bool canConvert( const char* mime, int cf )=0;
187 virtual const char* mimeFor(int cf)=0;
188 virtual int cfFor(const char* )=0;
189 virtual QByteArray convertToMime( QByteArray data, const char* mime, int cf )=0;
190 virtual QByteArray convertFromMime( QByteArray data, const char* mime, int cf )=0;
191};
192
193#endif
194#if defined(Q_WS_MAC)
195
196#ifndef QT_H
197#include "qptrlist.h" // down here for GCC 2.7.* compatibility
198#endif // QT_H
199
200/*
201 Encapsulation of conversion between MIME and Mac flavor.
202 Not need on X11, as the underlying protocol uses the MIME standard
203 directly.
204*/
205
206class Q_EXPORT QMacMime {
207 char type;
208public:
209 enum QMacMimeType { MIME_DND=0x01, MIME_CLIP=0x02, MIME_QT_CONVERTOR=0x04, MIME_ALL=MIME_DND|MIME_CLIP };
210 QMacMime(char);
211 virtual ~QMacMime();
212
213 static void initialize();
214
215 static QPtrList&lt;QMacMime&gt; all(QMacMimeType);
216 static QMacMime* convertor(QMacMimeType, const char* mime, int flav);
217 static const char* flavorToMime(QMacMimeType, int flav);
218
219 virtual const char* convertorName()=0;
220 virtual int countFlavors()=0;
221 virtual int flavor(int index)=0;
222 virtual bool canConvert(const char* mime, int flav)=0;
223 virtual const char* mimeFor(int flav)=0;
224 virtual int flavorFor(const char*)=0;
225 virtual QByteArray convertToMime(QValueList&lt;QByteArray&gt; data, const char* mime, int flav)=0;
226 virtual QValueList&lt;QByteArray&gt; convertFromMime(QByteArray data, const char* mime, int flav)=0;
227};
228
229#endif // Q_WS_MAC
230
231#endif // QT_NO_MIME
232
233#endif // QMIME_H
234</pre>
235<!-- eof -->
236<p><address><hr><div align=center>
237<table width=100% cellspacing=0 border=0><tr>
238<td>Copyright &copy; 2007
239<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
240<td align=right><div align=right>Qt 3.3.8</div>
241</table></div></address></body>
242</html>
Note: See TracBrowser for help on using the repository browser.