Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QCURSOR_H
00043 #define QCURSOR_H
00044
00045 #include <QtCore/qpoint.h>
00046 #include <QtGui/qwindowdefs.h>
00047
00048 QT_BEGIN_HEADER
00049
00050 QT_BEGIN_NAMESPACE
00051
00052 QT_MODULE(Gui)
00053
00054 class QVariant;
00055
00056
00057
00058
00059 #ifdef QT_NO_CURSOR
00060
00061 class Q_GUI_EXPORT QCursor
00062 {
00063 public:
00064 static QPoint pos();
00065 static void setPos(int x, int y);
00066 inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
00067 private:
00068 QCursor();
00069 };
00070
00071 #endif // QT_NO_CURSOR
00072
00073 #ifndef QT_NO_CURSOR
00074
00075 class QCursorData;
00076 class QBitmap;
00077 class QPixmap;
00078
00079 #if defined(Q_WS_MAC)
00080 void qt_mac_set_cursor(const QCursor *c, const QPoint &p);
00081 #endif
00082 #if defined(Q_OS_SYMBIAN)
00083 extern void qt_symbian_show_pointer_sprite();
00084 extern void qt_symbian_hide_pointer_sprite();
00085 extern void qt_symbian_set_pointer_sprite(const QCursor& cursor);
00086 extern void qt_symbian_move_cursor_sprite();
00087 #endif
00088
00089 class Q_GUI_EXPORT QCursor
00090 {
00091 public:
00092 QCursor();
00093 QCursor(Qt::CursorShape shape);
00094 QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX=-1, int hotY=-1);
00095 QCursor(const QPixmap &pixmap, int hotX=-1, int hotY=-1);
00096 QCursor(const QCursor &cursor);
00097 ~QCursor();
00098 QCursor &operator=(const QCursor &cursor);
00099 operator QVariant() const;
00100
00101 Qt::CursorShape shape() const;
00102 void setShape(Qt::CursorShape newShape);
00103
00104 const QBitmap *bitmap() const;
00105 const QBitmap *mask() const;
00106 QPixmap pixmap() const;
00107 QPoint hotSpot() const;
00108
00109 static QPoint pos();
00110 static void setPos(int x, int y);
00111 inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
00112
00113 #ifdef qdoc
00114 HCURSOR_or_HANDLE handle() const;
00115 QCursor(HCURSOR cursor);
00116 QCursor(Qt::HANDLE cursor);
00117 #endif
00118
00119 #ifndef qdoc
00120 #if defined(Q_WS_WIN)
00121 HCURSOR handle() const;
00122 QCursor(HCURSOR cursor);
00123 #elif defined(Q_WS_X11)
00124 Qt::HANDLE handle() const;
00125 QCursor(Qt::HANDLE cursor);
00126 static int x11Screen();
00127 #elif defined(Q_WS_MAC)
00128 Qt::HANDLE handle() const;
00129 #elif defined(Q_WS_QWS)
00130 int handle() const;
00131 #elif defined(Q_OS_SYMBIAN)
00132 Qt::HANDLE handle() const;
00133 #endif
00134 #endif
00135
00136 private:
00137 QCursorData *d;
00138 #if defined(Q_WS_MAC)
00139 friend void *qt_mac_nsCursorForQCursor(const QCursor &c);
00140 friend void qt_mac_set_cursor(const QCursor *c, const QPoint &p);
00141 #endif
00142 #if defined(Q_OS_SYMBIAN)
00143 friend void qt_symbian_show_pointer_sprite();
00144 friend void qt_symbian_hide_pointer_sprite();
00145 friend void qt_symbian_set_pointer_sprite(const QCursor& cursor);
00146 friend void qt_symbian_move_cursor_sprite();
00147 #endif
00148 };
00149
00150 #ifdef QT3_SUPPORT
00151
00152 #ifdef CursorShape
00153 #define X_CursorShape CursorShape
00154 #undef CursorShape
00155 #endif
00156 typedef Qt::CursorShape QCursorShape;
00157 #ifdef X_CursorShape
00158 #define CursorShape X_CursorShape
00159 #endif
00160 #endif
00161
00162
00163
00164
00165 #ifndef QT_NO_DATASTREAM
00166 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &outS, const QCursor &cursor);
00167 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &inS, QCursor &cursor);
00168 #endif
00169 #endif // QT_NO_CURSOR
00170
00171 QT_END_NAMESPACE
00172
00173 QT_END_HEADER
00174
00175 #endif // QCURSOR_H