qtmobility/src/sensors/qproximitysensor.cpp
changeset 1 2b40d63a9c3d
child 4 90517678cc4f
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include "qproximitysensor.h"
       
    43 #include "qproximitysensor_p.h"
       
    44 
       
    45 QTM_BEGIN_NAMESPACE
       
    46 
       
    47 IMPLEMENT_READING(QProximityReading)
       
    48 
       
    49 /*!
       
    50     \class QProximityReading
       
    51     \ingroup sensors_reading
       
    52 
       
    53     \preliminary
       
    54     \brief The QProximityReading class represents one reading from the
       
    55            proximity sensor.
       
    56 
       
    57     \target QProximityReading_Units
       
    58     The proximity sensor returns an indication of how far the user is
       
    59     away from the device using the pre-defined values found in the
       
    60     QProximityReading::Proximity enum.
       
    61 */
       
    62 
       
    63 /*!
       
    64     \enum QProximityReading::Proximity
       
    65 
       
    66     This enum represents the proximity of the user.
       
    67 
       
    68     \value Undefined  The proximity is unknown.
       
    69     \value Close      The user is close to the device.
       
    70     \value NotClose   The user is not close to the device.
       
    71 */
       
    72 
       
    73 /*!
       
    74     \property QProximityReading::proximity
       
    75     \brief the proximity of the user.
       
    76 
       
    77     The value is an indication of if the user is close or not.
       
    78     \sa QProximityReading_Units
       
    79 */
       
    80 
       
    81 QProximityReading::Proximity QProximityReading::proximity() const
       
    82 {
       
    83     return static_cast<QProximityReading::Proximity>(d->proximity);
       
    84 }
       
    85 
       
    86 /*!
       
    87     Sets the \a proximity of the user.
       
    88 */
       
    89 void QProximityReading::setProximity(QProximityReading::Proximity proximity)
       
    90 {
       
    91     d->proximity = proximity;
       
    92 }
       
    93 
       
    94 // =====================================================================
       
    95 
       
    96 // begin generated code
       
    97 
       
    98 /*!
       
    99     \class QProximityFilter
       
   100     \ingroup sensors_filter
       
   101 
       
   102     \preliminary
       
   103     \brief The QProximityFilter class is a convenience wrapper around QSensorFilter.
       
   104 
       
   105     The only difference is that the filter() method features a pointer to QProximityReading
       
   106     instead of QSensorReading.
       
   107 */
       
   108 
       
   109 /*!
       
   110     \fn QProximityFilter::filter(QProximityReading *reading)
       
   111 
       
   112     Called when \a reading changes. Returns false to prevent the reading from propagating.
       
   113 
       
   114     \sa QSensorFilter::filter()
       
   115 */
       
   116 
       
   117 const char *QProximitySensor::type("QProximitySensor");
       
   118 
       
   119 /*!
       
   120     \class QProximitySensor
       
   121     \ingroup sensors_type
       
   122 
       
   123     \preliminary
       
   124     \brief The QProximitySensor class is a convenience wrapper around QSensor.
       
   125 
       
   126     The only behavioural difference is that this class sets the type properly.
       
   127 
       
   128     This class also features a reading() function that returns a QProximityReading instead of a QSensorReading.
       
   129 
       
   130     For details about how the sensor works, see \l QProximityReading.
       
   131 
       
   132     \sa QProximityReading
       
   133 */
       
   134 
       
   135 /*!
       
   136     \fn QProximitySensor::QProximitySensor(QObject *parent)
       
   137 
       
   138     Construct the sensor as a child of \a parent.
       
   139 */
       
   140 
       
   141 /*!
       
   142     \fn QProximitySensor::~QProximitySensor()
       
   143 
       
   144     Destroy the sensor. Stops the sensor if it has not already been stopped.
       
   145 */
       
   146 
       
   147 /*!
       
   148     \fn QProximitySensor::reading() const
       
   149 
       
   150     Returns the reading class for this sensor.
       
   151 
       
   152     \sa QSensor::reading()
       
   153 */
       
   154 // end generated code
       
   155 
       
   156 #include "moc_qproximitysensor.cpp"
       
   157 QTM_END_NAMESPACE
       
   158