1.1 --- a/epoc32/include/sensrvchannelinfo.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sensrvchannelinfo.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,179 @@
1.4 -sensrvchannelinfo.h
1.5 +/*
1.6 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: The channel basic information
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef SENSRVCHANNELINFO_H
1.24 +#define SENSRVCHANNELINFO_H
1.25 +
1.26 +#include <e32base.h>
1.27 +#include <sensrvtypes.h>
1.28 +/**
1.29 + * The TSensrvChannelInfo class is a data class that holds information about a sensor channel.
1.30 + *
1.31 + * It also provides simple helper methods that allow users to determine if the class is complete
1.32 + * and if one instance of this class matches another.
1.33 + *
1.34 + * @lib sensrvutil.lib
1.35 + * @since S60 5.0
1.36 + */
1.37 +NONSHARABLE_CLASS( TSensrvChannelInfo )
1.38 + {
1.39 +public:
1.40 +
1.41 + /**
1.42 + * Default Constructor
1.43 + *
1.44 + * @since S60 5.0
1.45 + */
1.46 + IMPORT_C TSensrvChannelInfo();
1.47 +
1.48 + /**
1.49 + * Constructor
1.50 + *
1.51 + * This constructor is for use with CSensrvChannelFinder::FindChannelsL(). It sets the ChannelId
1.52 + * and DataItemSize to zero.
1.53 + *
1.54 + * @since S60 5.0
1.55 + * @param aContextType Channel context type. Set to a value from TSensrvContextType.
1.56 + * @param aQuantity Channel quantity. Set to a value from TSensrvQuantity.
1.57 + * @param aChannelType Channel type id. This is a uid.
1.58 + * @param aLocation Channel physical location.
1.59 + * @param aVendorId Channel vendor name.
1.60 + * @param aChannelDataTypeId Channel data type Id. This is a uid.
1.61 + * @see TSensrvContextType
1.62 + * @see TSensrvQuantity
1.63 + */
1.64 + IMPORT_C TSensrvChannelInfo( TInt aContextType,
1.65 + TInt aQuantity,
1.66 + TSensrvChannelTypeId aChannelType,
1.67 + const TDesC8& aLocation,
1.68 + const TDesC8& aVendorId,
1.69 + TSensrvChannelDataTypeId aChannelDataTypeId );
1.70 +
1.71 + /**
1.72 + * Constructor
1.73 + *
1.74 + * @since S60 5.0
1.75 + * @param aChannelId Channel identifier
1.76 + * @param aContextType Channel context type. Set to a value from TSensrvContextType.
1.77 + * @param aQuantity Channel quantity. Set to a value from TSensrvQuantity.
1.78 + * @param aChannelType Channel type id. This is a uid.
1.79 + * @param aLocation Channel physical location.
1.80 + * @param aVendorId Channel vendor name.
1.81 + * @param aDataItemSize Data item size for channel specific data
1.82 + * @param aChannelDataTypeId Channel data type Id. This is a uid.
1.83 + * @see TSensrvContextType
1.84 + * @see TSensrvQuantity
1.85 + */
1.86 + IMPORT_C TSensrvChannelInfo( TSensrvChannelId aChannelId,
1.87 + TInt aContextType,
1.88 + TInt aQuantity,
1.89 + TSensrvChannelTypeId aChannelType,
1.90 + const TDesC8& aLocation,
1.91 + const TDesC8& aVendorId,
1.92 + TInt aDataItemSize,
1.93 + TSensrvChannelDataTypeId aChannelDataTypeId );
1.94 +
1.95 + /**
1.96 + * Copy constructor
1.97 + *
1.98 + * @since S60 5.0
1.99 + * @param aChannelInfo Instance to be copied
1.100 + */
1.101 + IMPORT_C TSensrvChannelInfo( const TSensrvChannelInfo& aChannelInfo );
1.102 +
1.103 +public:
1.104 +
1.105 + /**
1.106 + * Checks if this instance matches supplied instance. Fields that are zero or empty are ignored.
1.107 + * Channel Id, Data Item Size and Reserved fields are ignored.
1.108 + *
1.109 + * @since S60 5.0
1.110 + * @param aInfo Instance to be matched against this instance.
1.111 + * @return ETrue if there is a match, otherwise EFalse
1.112 + */
1.113 + IMPORT_C TBool IsMatch( const TSensrvChannelInfo &aInfo ) const;
1.114 +
1.115 + /**
1.116 + * Checks that channel information in this object is complete. Complete means no zero or empty fields.
1.117 + * Channel Id, Data Item Size and the Reserved fields are ignored.
1.118 + *
1.119 + * @since S60 5.0
1.120 + * @return ETrue if channel information is complete.
1.121 + */
1.122 + IMPORT_C TBool IsComplete() const;
1.123 +
1.124 +public:
1.125 + /**
1.126 + * Channel Identifier
1.127 + */
1.128 + TSensrvChannelId iChannelId;
1.129 +
1.130 + /**
1.131 + * Context type
1.132 + * @see TSensrvContextType
1.133 + */
1.134 + TInt iContextType;
1.135 +
1.136 + /**
1.137 + * Quantity
1.138 + * @see TSensrvQuantity
1.139 + */
1.140 + TInt iQuantity;
1.141 +
1.142 + /**
1.143 + * Channel type identifier
1.144 + *
1.145 + * Identifies the channel type and therefore the content of the channel. This value is a uid and is
1.146 + * unique among all channels. See sensor channel specific header files.
1.147 + */
1.148 + TSensrvChannelTypeId iChannelType;
1.149 +
1.150 + /**
1.151 + * Location of the of the channel. This is a free format string
1.152 + */
1.153 + TBuf8<KSensrvLocationLength> iLocation;
1.154 +
1.155 + /**
1.156 + * Vendor name of the channel provider. This is a free format string and is not to be confused with
1.157 + * Vendor Id unique Uid's.
1.158 + */
1.159 + TBuf8<KSensrvVendorIdLength> iVendorId;
1.160 +
1.161 + /**
1.162 + * Size of the data item delivered by the channel
1.163 + */
1.164 + TInt iDataItemSize;
1.165 +
1.166 +private:
1.167 + TInt iReserved3;
1.168 +
1.169 +public:
1.170 + /**
1.171 + * Identifies the channel data type. This value is a uid and is unique among all channels. See sensor
1.172 + * channel specific header files.
1.173 + */
1.174 + TSensrvChannelDataTypeId iChannelDataTypeId;
1.175 +
1.176 +private:
1.177 + TInt iReserved;
1.178 + TInt iReserved2;
1.179 + };
1.180 +
1.181 +
1.182 +
1.183 +#endif // SENSRVCHANNELINFO_H