sensrvproperty.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : sensrvproperty.h
00004 *  Interface   : Sensor Channel API
00005 *  Description : Sensor and channel property container
00006 *  Version     : %version: 2.1.1 %
00007 *
00008 *  Copyright © 2008 Nokia.  All rights reserved.
00009 *  This material, including documentation and any related computer
00010 *  programs, is protected by copyright controlled by Nokia.  All
00011 *  rights are reserved.  Copying, including reproducing, storing,
00012 *  adapting or translating, any or all of this material requires the
00013 *  prior written consent of Nokia.  This material also contains
00014 *  confidential information which may not be disclosed to others
00015 *  without the prior written consent of Nokia.
00016 * ============================================================================
00017 * Template version: 4.1
00018 */
00019 
00020 
00021 #ifndef SENSRVPROPERTY_H
00022 #define SENSRVPROPERTY_H
00023 
00024 //  INCLUDES
00025 #include <e32base.h>
00026 #include <babitflags.h>
00027 
00028 // CONSTANTS
00029 
00034 const TInt KSensrvPropertyTextBufferSize = 20;
00035 
00036 
00037 // DATA TYPES
00038 
00043 enum TSensrvPropertyType
00044     {
00046     ESensrvUninitializedProperty = 0,
00048     ESensrvIntProperty,
00050     ESensrvRealProperty,
00055     ESensrvBufferProperty
00056     };
00057 
00063 enum TSensrvArrayIndex
00064     {
00066     ESensrvSingleProperty    = -1,
00071     ESensrvArrayPropertyInfo = -2
00072     };
00073 
00084 enum TSensrvPropertyRangeUsage
00085     {
00086     // General properties
00087     ESensrvPropertyRangeNotDefined = 0, // 0x0000
00088     ESensrvGeneralPropertyRangeBase = 1, // 0x0001
00089     ESensrvGeneralPropertyRangeEnd = 4095, // 0x0FFF
00090 
00091     // Channel properties
00092     ESensrvChannelPropertyRangeBase = 4096, // 0x1000
00093     ESensrvChannelPropertyRangeEnd = 8191, // 0x1FFF
00094 
00095     // A range for licensees to define their own properties. Usage is defined by the licensee. 
00096     ESensrvLicenseePropertyRangeBase = 8192, // 0x2000
00097     ESensrvLicenseePropertyRangeEnd = 12287 // 0x2FFF
00098     };
00099 
00104 typedef TUint32 TSensrvPropertyId;
00105 
00106 // CLASS DECLARATION
00107 
00279 NONSHARABLE_CLASS( TSensrvProperty )
00280     {
00281 public:
00282 
00286     IMPORT_C TSensrvProperty();
00287 
00300     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00301                               const TInt aItemIndex,
00302                               const TInt aValue,
00303                               const TInt aMaxValue,
00304                               const TInt aMinValue,
00305                               const TBool aReadOnly,
00306                               const TSensrvPropertyType aPropertyType );
00307 
00316     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00317                               const TInt aItemIndex,
00318                               const TInt aValue );
00319 
00332     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00333                               const TInt aItemIndex,
00334                               const TReal aValue,
00335                               const TReal aMaxValue,
00336                               const TReal aMinValue,
00337                               const TBool aReadOnly,
00338                               const TSensrvPropertyType aPropertyType );
00339 
00348     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00349                               const TInt aItemIndex,
00350                               const TReal aValue );
00351 
00362     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00363                               const TInt aItemIndex,
00364                               const TDesC8& aValue,
00365                               const TBool aReadOnly,
00366                               const TSensrvPropertyType aPropertyType );
00367 
00376     IMPORT_C TSensrvProperty( const TSensrvPropertyId aPropertyId,
00377                               const TInt aItemIndex,
00378                               const TDesC8& aValue );
00379 
00386     IMPORT_C void SetPropertyId( TSensrvPropertyId aPropertyId );
00387 
00394     IMPORT_C TSensrvPropertyId GetPropertyId() const;
00395 
00402     IMPORT_C void SetItemIndex( TInt aItemIndex );
00403 
00410     IMPORT_C TInt PropertyItemIndex() const;
00411 
00418     IMPORT_C TSensrvPropertyType PropertyType() const;
00419 
00426     IMPORT_C TBool ReadOnly() const;
00427 
00434     IMPORT_C void SetReadOnly( TBool aReadOnly );
00435 
00444     IMPORT_C void SetValue( const TInt aValue );
00445 
00454     IMPORT_C void SetValue( const TReal aValue );
00455 
00464     IMPORT_C void SetValue( const TDesC8& aValue );
00465 
00474     IMPORT_C void GetValue( TInt& aValue ) const;
00475 
00484     IMPORT_C void GetValue( TReal& aValue ) const;
00485 
00494     IMPORT_C void GetValue( TDes8& aValue ) const;
00495 
00504     IMPORT_C TDes8& GetValueRef();
00505 
00514     IMPORT_C void GetMaxValue( TInt& aMaxValue ) const;
00515 
00524     IMPORT_C void GetMinValue( TInt& aMinValue ) const;
00525 
00534     IMPORT_C void SetMaxValue( TInt aMaxValue );
00535 
00544     IMPORT_C void SetMinValue( TInt aMinValue );
00545 
00554     IMPORT_C void GetMaxValue( TReal& aMaxValue ) const;
00555 
00564     IMPORT_C void GetMinValue( TReal& aMinValue ) const;
00565 
00574     IMPORT_C void SetMaxValue( const TReal& aMaxValue );
00575 
00584     IMPORT_C void SetMinValue( const TReal& aMinValue );
00585 
00592     IMPORT_C void SetSecurityInfo( const TSecurityInfo& aSecurityInfo );
00593 
00600     IMPORT_C TSecurityInfo GetSecurityInfo() const;
00601 
00610     IMPORT_C void SetArrayIndex( const TInt aArrayIndex );
00611 
00620     IMPORT_C TInt GetArrayIndex() const;
00621 
00622 private:
00623     // property identifier
00624     TSensrvPropertyId iPropertyId;
00625 
00626     // property item index
00627     TInt iItemIndex;
00628 
00629     //Array index
00630     TInt16 iArrayIndex;
00631 
00632 
00633     // property value
00634     union
00635         {
00636         TInt iIntValue;
00637         TReal iRealValue;
00638         };
00639     TBuf8<KSensrvPropertyTextBufferSize> iBufValue;
00640 
00641     // read only flag
00642     TBitFlags32 iReadOnly;
00643 
00644     // maximum value
00645     union
00646         {
00647         TInt iIntValueMax;
00648         TReal iRealValueMax;
00649         };
00650 
00651     // minimum value
00652     union
00653         {
00654         TInt iIntValueMin;
00655         TReal iRealValueMin;
00656         };
00657 
00658     // property type
00659     TSensrvPropertyType iPropertyType;
00660 
00661     // property security infomation
00662     TSecurityInfo iSecurityInfo;
00663 
00664     // not used
00665     TInt iReserved;
00666     };
00667 
00668 #endif //SENSRVPROPERTY_H
00669 
00670 // End of File
00671 
00672 

Copyright © Nokia Corporation 2001-2007
Back to top