Eneboo - Documentación para desarrolladores
src/qt/include/qcursor.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qcursor.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QCursor class
00005 **
00006 ** Created : 940219
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QCURSOR_H
00039 #define QCURSOR_H
00040 
00041 #ifndef QT_H
00042 #include "qpoint.h"
00043 #include "qshared.h"
00044 #endif // QT_H
00045 
00046 /*
00047   ### The fake cursor has to go first with old qdoc.
00048 */
00049 #ifdef QT_NO_CURSOR
00050 
00051 class Q_EXPORT QCursor : public Qt
00052 {
00053 public:
00054     static QPoint pos();
00055     static void   setPos( int x, int y );
00056     static void   setPos( const QPoint & );
00057 private:
00058     QCursor();
00059 };
00060 
00061 #endif // QT_NO_CURSOR
00062 
00063 #ifndef QT_NO_CURSOR
00064 
00065 struct QCursorData;
00066 
00067 
00068 class Q_EXPORT QCursor : public Qt
00069 {
00070 public:
00071     QCursor();                          // create default arrow cursor
00072     QCursor( int shape );
00073     QCursor( const QBitmap &bitmap, const QBitmap &mask,
00074              int hotX=-1, int hotY=-1 );
00075     QCursor( const QPixmap &pixmap,
00076              int hotX=-1, int hotY=-1 );
00077     QCursor( const QCursor & );
00078    ~QCursor();
00079     QCursor &operator=( const QCursor & );
00080 
00081     int           shape()   const;
00082     void          setShape( int );
00083 
00084     const QBitmap *bitmap() const;
00085     const QBitmap *mask()   const;
00086     QPoint        hotSpot() const;
00087 
00088 #if defined(Q_WS_WIN)
00089     HCURSOR       handle()  const;
00090     QCursor( HCURSOR );
00091 #elif defined(Q_WS_X11)
00092     HANDLE        handle()  const;
00093     QCursor( HANDLE );
00094 #elif defined(Q_WS_MAC)
00095     HANDLE handle() const;
00096 #elif defined(Q_WS_QWS)
00097     HANDLE        handle()  const;
00098 #endif
00099 
00100     static QPoint pos();
00101     static void   setPos( int x, int y );
00102     static void   setPos( const QPoint & );
00103 
00104     static void   initialize();
00105     static void   cleanup();
00106 
00107 #if defined(Q_WS_X11)
00108     static int    x11Screen();
00109 #endif
00110 private:
00111     void          setBitmap( const QBitmap &bitmap, const QBitmap &mask,
00112                                  int hotX, int hotY );
00113     void          update() const;
00114     QCursorData  *data;
00115     QCursor      *find_cur(int);
00116 #if defined(Q_WS_MAC)
00117     friend void qt_mac_set_cursor(const QCursor *c, const Point *p);
00118 #endif
00119 };
00120 
00121 
00122 #if !defined(QT_CLEAN_NAMESPACE)
00123 // CursorShape is defined in X11/X.h
00124 #ifdef CursorShape
00125 #define X_CursorShape CursorShape
00126 #undef CursorShape
00127 #endif
00128 typedef Qt::CursorShape QCursorShape;
00129 #ifdef X_CursorShape
00130 #define CursorShape X_CursorShape
00131 #endif
00132 #endif
00133 
00134 
00135 /*****************************************************************************
00136   QCursor stream functions
00137  *****************************************************************************/
00138 #ifndef QT_NO_DATASTREAM
00139 Q_EXPORT QDataStream &operator<<( QDataStream &, const QCursor & );
00140 Q_EXPORT QDataStream &operator>>( QDataStream &, QCursor & );
00141 #endif
00142 #endif // QT_NO_CURSOR
00143 
00144 
00145 inline void QCursor::setPos( const QPoint &p )
00146 {
00147     setPos( p.x(), p.y() );
00148 }
00149 
00150 #endif // QCURSOR_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'