[190] | 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/qdragobject.h:1 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>qdragobject.h Include File</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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>qdragobject.h</h1>
|
---|
| 33 |
|
---|
| 34 | <p>This is the verbatim text of the qdragobject.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
| 35 | <hr>
|
---|
| 36 | <pre>
|
---|
| 37 | /****************************************************************************
|
---|
| 38 | ** $Id: qdragobject-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
| 39 | **
|
---|
| 40 | ** Definition of QDragObject
|
---|
| 41 | **
|
---|
| 42 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
| 43 | **
|
---|
| 44 | ** This file is part of the kernel module of the Qt GUI Toolkit.
|
---|
| 45 | **
|
---|
| 46 | ** This file may be distributed under the terms of the Q Public License
|
---|
| 47 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
| 48 | ** LICENSE.QPL included in the packaging of this file.
|
---|
| 49 | **
|
---|
| 50 | ** This file may be distributed and/or modified under the terms of the
|
---|
| 51 | ** GNU General Public License version 2 as published by the Free Software
|
---|
| 52 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 53 | ** packaging of this file.
|
---|
| 54 | **
|
---|
| 55 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
| 56 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
| 57 | ** Agreement provided with the Software.
|
---|
| 58 | **
|
---|
| 59 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
| 60 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 61 | **
|
---|
| 62 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
| 63 | ** information about Qt Commercial License Agreements.
|
---|
| 64 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
| 65 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
| 66 | **
|
---|
| 67 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
| 68 | ** not clear to you.
|
---|
| 69 | **
|
---|
| 70 | **********************************************************************/
|
---|
| 71 |
|
---|
| 72 | #ifndef QDRAGOBJECT_H
|
---|
| 73 | #define QDRAGOBJECT_H
|
---|
| 74 |
|
---|
| 75 | class QWidget;
|
---|
| 76 | class QTextDragPrivate;
|
---|
| 77 | class QDragObjectData;
|
---|
| 78 | class QStoredDragData;
|
---|
| 79 | class QImageDragData;
|
---|
| 80 |
|
---|
| 81 | #ifndef QT_H
|
---|
| 82 | #include "qobject.h"
|
---|
| 83 | #include "qimage.h"
|
---|
| 84 | #include "qstrlist.h"
|
---|
| 85 | #include "qcolor.h"
|
---|
| 86 | #endif // QT_H
|
---|
| 87 |
|
---|
| 88 | #ifndef QT_NO_MIME
|
---|
| 89 |
|
---|
| 90 | class Q_EXPORT QDragObject: public QObject, public QMimeSource {
|
---|
| 91 | Q_OBJECT
|
---|
| 92 | public:
|
---|
| 93 | QDragObject( QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 94 | virtual ~QDragObject();
|
---|
| 95 |
|
---|
| 96 | #ifndef QT_NO_DRAGANDDROP
|
---|
| 97 | bool drag();
|
---|
| 98 | bool dragMove();
|
---|
| 99 | void dragCopy();
|
---|
| 100 | void dragLink();
|
---|
| 101 |
|
---|
| 102 | virtual void setPixmap(QPixmap);
|
---|
| 103 | virtual void setPixmap(QPixmap, const QPoint& hotspot);
|
---|
| 104 | QPixmap pixmap() const;
|
---|
| 105 | QPoint pixmapHotSpot() const;
|
---|
| 106 | #endif
|
---|
| 107 |
|
---|
| 108 | QWidget * source();
|
---|
| 109 | static QWidget * target();
|
---|
| 110 |
|
---|
| 111 | static void setTarget(QWidget*);
|
---|
| 112 |
|
---|
| 113 | #ifndef QT_NO_DRAGANDDROP
|
---|
| 114 | enum DragMode { DragDefault, DragCopy, DragMove, DragLink, DragCopyOrMove };
|
---|
| 115 |
|
---|
| 116 | protected:
|
---|
| 117 | virtual bool drag(DragMode);
|
---|
| 118 | #endif
|
---|
| 119 |
|
---|
| 120 | private:
|
---|
| 121 | QDragObjectData * d;
|
---|
| 122 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 123 | QDragObject( const QDragObject & );
|
---|
| 124 | QDragObject &operator=( const QDragObject & );
|
---|
| 125 | #endif
|
---|
| 126 | };
|
---|
| 127 |
|
---|
| 128 | class Q_EXPORT QStoredDrag: public QDragObject {
|
---|
| 129 | Q_OBJECT
|
---|
| 130 | QStoredDragData * d;
|
---|
| 131 |
|
---|
| 132 | public:
|
---|
| 133 | QStoredDrag( const char * mimeType,
|
---|
| 134 | QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 135 | ~QStoredDrag();
|
---|
| 136 |
|
---|
| 137 | virtual void setEncodedData( const QByteArray & );
|
---|
| 138 |
|
---|
| 139 | const char * format(int i) const;
|
---|
| 140 | virtual QByteArray encodedData(const char*) const;
|
---|
| 141 |
|
---|
| 142 | private:
|
---|
| 143 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 144 | QStoredDrag( const QStoredDrag & );
|
---|
| 145 | QStoredDrag &operator=( const QStoredDrag & );
|
---|
| 146 | #endif
|
---|
| 147 | };
|
---|
| 148 |
|
---|
| 149 | class Q_EXPORT QTextDrag: public QDragObject {
|
---|
| 150 | Q_OBJECT
|
---|
| 151 | QTextDragPrivate* d;
|
---|
| 152 | public:
|
---|
| 153 | QTextDrag( const QString &,
|
---|
| 154 | QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 155 | QTextDrag( QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 156 | ~QTextDrag();
|
---|
| 157 |
|
---|
| 158 | virtual void setText( const QString &);
|
---|
| 159 | virtual void setSubtype( const QCString &);
|
---|
| 160 |
|
---|
| 161 | const char * format(int i) const;
|
---|
| 162 | virtual QByteArray encodedData(const char*) const;
|
---|
| 163 |
|
---|
| 164 | static bool canDecode( const QMimeSource* e );
|
---|
| 165 | static bool decode( const QMimeSource* e, QString& s );
|
---|
| 166 | static bool decode( const QMimeSource* e, QString& s, QCString& subtype );
|
---|
| 167 |
|
---|
| 168 | private:
|
---|
| 169 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 170 | QTextDrag( const QTextDrag & );
|
---|
| 171 | QTextDrag &operator=( const QTextDrag & );
|
---|
| 172 | #endif
|
---|
| 173 | };
|
---|
| 174 |
|
---|
| 175 | class Q_EXPORT QImageDrag: public QDragObject {
|
---|
| 176 | Q_OBJECT
|
---|
| 177 | QImage img;
|
---|
| 178 | QStrList ofmts;
|
---|
| 179 | QImageDragData* d;
|
---|
| 180 |
|
---|
| 181 | public:
|
---|
| 182 | QImageDrag( QImage image, QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 183 | QImageDrag( QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 184 | ~QImageDrag();
|
---|
| 185 |
|
---|
| 186 | virtual void setImage( QImage image );
|
---|
| 187 |
|
---|
| 188 | const char * format(int i) const;
|
---|
| 189 | virtual QByteArray encodedData(const char*) const;
|
---|
| 190 |
|
---|
| 191 | static bool canDecode( const QMimeSource* e );
|
---|
| 192 | static bool decode( const QMimeSource* e, QImage& i );
|
---|
| 193 | static bool decode( const QMimeSource* e, QPixmap& i );
|
---|
| 194 |
|
---|
| 195 | private:
|
---|
| 196 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 197 | QImageDrag( const QImageDrag & );
|
---|
| 198 | QImageDrag &operator=( const QImageDrag & );
|
---|
| 199 | #endif
|
---|
| 200 | };
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 | class Q_EXPORT QUriDrag: public QStoredDrag {
|
---|
| 204 | Q_OBJECT
|
---|
| 205 |
|
---|
| 206 | public:
|
---|
| 207 | QUriDrag( QStrList uris, QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 208 | QUriDrag( QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 209 | ~QUriDrag();
|
---|
| 210 |
|
---|
| 211 | void setFilenames( const QStringList & fnames ) { setFileNames( fnames ); }
|
---|
| 212 | void setFileNames( const QStringList & fnames );
|
---|
| 213 | void setUnicodeUris( const QStringList & uuris );
|
---|
| 214 | virtual void setUris( QStrList uris );
|
---|
| 215 |
|
---|
| 216 | static QString uriToLocalFile(const char*);
|
---|
| 217 | static QCString localFileToUri(const QString&);
|
---|
| 218 | static QString uriToUnicodeUri(const char*);
|
---|
| 219 | static QCString unicodeUriToUri(const QString&);
|
---|
| 220 | static bool canDecode( const QMimeSource* e );
|
---|
| 221 | static bool decode( const QMimeSource* e, QStrList& i );
|
---|
| 222 | static bool decodeToUnicodeUris( const QMimeSource* e, QStringList& i );
|
---|
| 223 | static bool decodeLocalFiles( const QMimeSource* e, QStringList& i );
|
---|
| 224 |
|
---|
| 225 | private:
|
---|
| 226 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 227 | QUriDrag( const QUriDrag & );
|
---|
| 228 | QUriDrag &operator=( const QUriDrag & );
|
---|
| 229 | #endif
|
---|
| 230 | };
|
---|
| 231 |
|
---|
| 232 | class Q_EXPORT QColorDrag : public QStoredDrag
|
---|
| 233 | {
|
---|
| 234 | Q_OBJECT
|
---|
| 235 | QColor color;
|
---|
| 236 |
|
---|
| 237 | public:
|
---|
| 238 | QColorDrag( const QColor &col, QWidget *dragsource = 0, const char *name = 0 );
|
---|
| 239 | QColorDrag( QWidget * dragSource = 0, const char * name = 0 );
|
---|
| 240 | void setColor( const QColor &col );
|
---|
| 241 |
|
---|
| 242 | static bool canDecode( QMimeSource * );
|
---|
| 243 | static bool decode( QMimeSource *, QColor &col );
|
---|
| 244 |
|
---|
| 245 | private:
|
---|
| 246 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 247 | QColorDrag( const QColorDrag & );
|
---|
| 248 | QColorDrag &operator=( const QColorDrag & );
|
---|
| 249 | #endif
|
---|
| 250 | };
|
---|
| 251 |
|
---|
| 252 | #ifndef QT_NO_COMPAT
|
---|
| 253 | typedef QUriDrag QUrlDrag;
|
---|
| 254 | #endif
|
---|
| 255 |
|
---|
| 256 | #ifndef QT_NO_DRAGANDDROP
|
---|
| 257 |
|
---|
| 258 | // QDragManager is not part of the public API. It is defined in a
|
---|
| 259 | // header file simply so different .cpp files can implement different
|
---|
| 260 | // member functions.
|
---|
| 261 | //
|
---|
| 262 |
|
---|
| 263 | class Q_EXPORT QDragManager: public QObject {
|
---|
| 264 | Q_OBJECT
|
---|
| 265 |
|
---|
| 266 | private:
|
---|
| 267 | QDragManager();
|
---|
| 268 | ~QDragManager();
|
---|
| 269 | // only friend classes can use QDragManager.
|
---|
| 270 | friend class QDragObject;
|
---|
| 271 | friend class QDragMoveEvent;
|
---|
| 272 | friend class QDropEvent;
|
---|
| 273 | friend class QApplication;
|
---|
| 274 |
|
---|
| 275 | bool eventFilter( QObject *, QEvent * );
|
---|
| 276 | void timerEvent( QTimerEvent* );
|
---|
| 277 |
|
---|
| 278 | bool drag( QDragObject *, QDragObject::DragMode );
|
---|
| 279 |
|
---|
| 280 | void cancel( bool deleteSource = TRUE );
|
---|
| 281 | void move( const QPoint & );
|
---|
| 282 | void drop();
|
---|
| 283 | void updatePixmap();
|
---|
| 284 |
|
---|
| 285 | private:
|
---|
| 286 | QDragObject * object;
|
---|
| 287 | void updateMode( ButtonState newstate );
|
---|
| 288 | void updateCursor();
|
---|
| 289 | #if defined(Q_WS_X11)
|
---|
| 290 | void createCursors();
|
---|
| 291 | #endif
|
---|
| 292 |
|
---|
| 293 | QWidget * dragSource;
|
---|
| 294 | QWidget * dropWidget;
|
---|
| 295 | bool beingCancelled;
|
---|
| 296 | bool restoreCursor;
|
---|
| 297 | bool willDrop;
|
---|
| 298 |
|
---|
| 299 | QPixmap *pm_cursor;
|
---|
| 300 | int n_cursor;
|
---|
| 301 | #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
|
---|
| 302 | QDragManager( const QDragManager & );
|
---|
| 303 | QDragManager &operator=( const QDragManager & );
|
---|
| 304 | #endif
|
---|
| 305 | };
|
---|
| 306 |
|
---|
| 307 | #endif
|
---|
| 308 |
|
---|
| 309 | #endif // QT_NO_MIME
|
---|
| 310 |
|
---|
| 311 | #endif // QDRAGOBJECT_H
|
---|
| 312 | </pre>
|
---|
| 313 | <!-- eof -->
|
---|
| 314 | <p><address><hr><div align=center>
|
---|
| 315 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 316 | <td>Copyright © 2007
|
---|
| 317 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 318 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 319 | </table></div></address></body>
|
---|
| 320 | </html>
|
---|