epoc32/include/sensrvorientationsensor.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Channel data types definitions
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef SENSRVORIENTATIONSENSOR_H
    21 #define SENSRVORIENTATIONSENSOR_H
    22 
    23 //  INCLUDES
    24 #include <e32base.h>
    25 #include <sensrvtypes.h> 
    26 
    27 // ORIENTATION RELATED CHANNELS
    28 
    29 /**
    30 * - Name:          Orientation event channel type
    31 * - Type:          Event
    32 * - Datatype:      TSensrvOrientationData
    33 * - Description:   Orientation events
    34 */
    35 const TSensrvChannelTypeId KSensrvChannelTypeIdOrientationData = 0x10205088; 
    36 
    37 /**
    38 * - Name:          Rotation event channel type
    39 * - Type:          Event
    40 * - Datatype:      TSensrvRotationData
    41 * - Description:   Rotation events
    42 */
    43 const TSensrvChannelTypeId KSensrvChannelTypeIdRotationData = 0x10205089; 
    44 
    45 // ORIENTATION RELATED DATATYPES
    46 
    47 class TSensrvOrientationData
    48     {
    49 public:
    50     /**
    51     * Channel data type Id number
    52     */      
    53     static const TSensrvChannelDataTypeId KDataTypeId = 0x10205088;
    54 
    55     /**
    56     * Channel data type index numbers
    57     */
    58     enum TSensrvOrientationEventIndexes
    59         {
    60         ETimeStamp = 0,
    61         EDeviceOrientation
    62         }; 
    63 
    64     /**
    65     * Possible device orientations
    66     */
    67     enum TSensrvDeviceOrientation
    68         {
    69 	    EOrientationUndefined = 0,
    70 	    EOrientationDisplayUp,
    71 	    EOrientationDisplayDown,
    72 	    EOrientationDisplayLeftUp,
    73 	    EOrientationDisplayRightUp,
    74 	    EOrientationDisplayUpwards,
    75 	    EOrientationDisplayDownwards	
    76         };
    77         
    78 public:
    79         
    80     /**
    81     * - Item name:   Sampling time
    82     * - Item Index:  0
    83     * - Description: Timestamp for a sample
    84     */   
    85     TTime iTimeStamp;
    86 
    87     /**
    88     * - Item name:   Device orientation
    89     * - Item Index:  1
    90     * - Description: Contains one of the six basic orientations of the device
    91     */   
    92     TSensrvDeviceOrientation iDeviceOrientation;    
    93     };
    94 
    95 
    96 class TSensrvRotationData
    97     {
    98 public:
    99     /**
   100     * Channel data type Id number
   101     */      
   102     static const TSensrvChannelDataTypeId KDataTypeId = 0x10205089;
   103     
   104     /**
   105     * Rotation axis value equals -1 when it cannot be defined. 
   106     * The undefined situation varies depending on the sensor type. 
   107     * In the case of an accelerometer, the rotation value cannot be defined 
   108     * when the corresponding axis is parallel to the gravitational force or
   109     * the device is in motion. In the case of a magnetometer, there are
   110     * difficulties in measuring values, when the axis is parallel to the
   111     * magnetic field.
   112     */
   113     static const TInt KSensrvRotationUndefined = -1; 
   114 
   115     /**
   116     * Channel data type index numbers
   117     */ 
   118     enum TSensrvRotationDataIndexes
   119         {
   120         ETimeStamp = 0,          
   121         EDeviceRotationAboutXAxis,
   122         EDeviceRotationAboutYAxis,
   123         EDeviceRotationAboutZAxis,
   124         };
   125 
   126 public:
   127     /**
   128     * - Item name:   Sampling time.
   129     * - Item Index:  0
   130     * - Description: Timestamp for a sample
   131     */   
   132     TTime iTimeStamp;
   133   
   134     /**
   135     * - Item name:   Rotation about x-axis
   136     * - Item Index:  1 
   137     * - Description: Positive rotation in Cartesian coordinate system about the x-axis.
   138     *                If the value cannot be defined it is set to KSensrvRotationUndefined.
   139     */   
   140     TInt iDeviceRotationAboutXAxis;  
   141 
   142     /**
   143     * - Item name:   Rotation about y-axis
   144     * - Item Index:  2
   145     * - Description: Positive rotation in Cartesian coordinate system about the y-axis.
   146     *                If the value cannot be defined it is set to KSensrvRotationUndefined.
   147     */   
   148     TInt iDeviceRotationAboutYAxis;  
   149       
   150 
   151     /**
   152     * - Item name:   Rotation about z-axis
   153     * - Item Index:  3 
   154     * - Description: Positive rotation in Cartesian coordinate system about the z-axis.
   155     *                If the value cannot be defined it is set to KSensrvRotationUndefined.
   156     */   
   157     TInt iDeviceRotationAboutZAxis;  
   158     };
   159 
   160 #endif //SENSRVORIENTATIONSENSOR_H
   161 
   162 // End of File