epoc32/include/sensrvchannelinfo.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  The channel basic information
    15 *
    16 */
    17 
    18 
    19 #ifndef SENSRVCHANNELINFO_H
    20 #define SENSRVCHANNELINFO_H
    21 
    22 #include <e32base.h>
    23 #include <sensrvtypes.h>
    24 /**
    25  *  The TSensrvChannelInfo class is a data class that holds information about a sensor channel.
    26  *
    27  *  It also provides simple helper methods that allow users to determine if the class is complete
    28  *  and if one instance of this class matches another.
    29  *
    30  *  @lib sensrvutil.lib
    31  *  @since S60 5.0
    32  */
    33 NONSHARABLE_CLASS( TSensrvChannelInfo )
    34     {
    35 public:
    36     
    37     /**
    38     * Default Constructor
    39     *
    40     * @since S60 5.0
    41     */      
    42     IMPORT_C TSensrvChannelInfo();
    43       
    44     /**
    45     * Constructor
    46     * 
    47     * This constructor is for use with CSensrvChannelFinder::FindChannelsL(). It sets the ChannelId
    48     * and DataItemSize to zero.
    49     *
    50     * @since S60 5.0
    51     * @param  aContextType Channel context type. Set to a value from TSensrvContextType.
    52     * @param  aQuantity Channel quantity. Set to a value from TSensrvQuantity.
    53     * @param  aChannelType Channel type id. This is a uid.
    54     * @param  aLocation Channel physical location.
    55     * @param  aVendorId Channel vendor name.
    56     * @param  aChannelDataTypeId Channel data type Id. This is a uid.
    57     * @see TSensrvContextType
    58     * @see TSensrvQuantity
    59     */          
    60     IMPORT_C TSensrvChannelInfo( TInt aContextType, 
    61                                  TInt aQuantity, 
    62                                  TSensrvChannelTypeId aChannelType,
    63                                  const TDesC8& aLocation,
    64                                  const TDesC8& aVendorId,
    65                                  TSensrvChannelDataTypeId aChannelDataTypeId ); 
    66 
    67     /**
    68     * Constructor
    69     *
    70     * @since S60 5.0
    71     * @param aChannelId Channel identifier
    72     * @param  aContextType Channel context type. Set to a value from TSensrvContextType.
    73     * @param  aQuantity Channel quantity. Set to a value from TSensrvQuantity.
    74     * @param  aChannelType Channel type id. This is a uid.
    75     * @param  aLocation Channel physical location.
    76     * @param  aVendorId Channel vendor name.
    77     * @param  aDataItemSize Data item size for channel specific data
    78     * @param  aChannelDataTypeId Channel data type Id. This is a uid.
    79     * @see    TSensrvContextType
    80     * @see    TSensrvQuantity 
    81     */          
    82     IMPORT_C TSensrvChannelInfo( TSensrvChannelId aChannelId, 
    83                                  TInt aContextType, 
    84                                  TInt aQuantity, 
    85                                  TSensrvChannelTypeId aChannelType,
    86                                  const TDesC8& aLocation,
    87                                  const TDesC8& aVendorId, 
    88                                  TInt aDataItemSize,
    89                                  TSensrvChannelDataTypeId aChannelDataTypeId ); 
    90       
    91     /**
    92     * Copy constructor
    93     * 
    94     * @since S60 5.0
    95     * @param  aChannelInfo Instance to be copied
    96     */    
    97     IMPORT_C TSensrvChannelInfo( const TSensrvChannelInfo& aChannelInfo );
    98     
    99 public:     
   100     
   101     /**
   102     * Checks if this instance matches supplied instance. Fields that are zero or empty are ignored.
   103     * Channel Id, Data Item Size and Reserved fields are ignored.
   104     * 
   105     * @since S60 5.0
   106     * @param  aInfo Instance to be matched against this instance.
   107     * @return ETrue if there is a match, otherwise EFalse
   108     */  
   109     IMPORT_C TBool IsMatch( const TSensrvChannelInfo &aInfo ) const;
   110           
   111     /**
   112     * Checks that channel information in this object is complete. Complete means no zero or empty fields.
   113     * Channel Id, Data Item Size and the Reserved fields are ignored.
   114     * 
   115     * @since S60 5.0
   116     * @return ETrue if channel information is complete.
   117     */
   118     IMPORT_C TBool IsComplete() const;
   119 
   120 public:
   121     /**
   122     * Channel Identifier
   123     */
   124     TSensrvChannelId iChannelId;
   125 
   126     /**
   127     * Context type
   128     * @see TSensrvContextType
   129     */
   130     TInt iContextType;
   131 
   132     /**
   133     * Quantity
   134     * @see TSensrvQuantity
   135     */
   136     TInt iQuantity;    
   137 
   138     /**
   139     * Channel type identifier
   140     * 
   141     * Identifies the channel type and therefore the content of the channel. This value is a uid and is
   142     * unique among all channels. See sensor channel specific header files.
   143     */
   144     TSensrvChannelTypeId iChannelType;
   145     
   146     /**
   147     * Location of the of the channel. This is a free format string
   148     */
   149     TBuf8<KSensrvLocationLength> iLocation;
   150 
   151     /**
   152     * Vendor name of the channel provider. This is a free format string and is not to be confused with
   153     * Vendor Id unique Uid's.
   154     */
   155     TBuf8<KSensrvVendorIdLength> iVendorId;
   156 
   157     /**
   158     * Size of the data item delivered by the channel
   159     */
   160     TInt iDataItemSize;
   161     
   162 private:
   163     TInt iReserved3;
   164     
   165 public:
   166     /**
   167     * Identifies the channel data type. This value is a uid and is unique among all channels. See sensor
   168     * channel specific header files.
   169     */      
   170     TSensrvChannelDataTypeId iChannelDataTypeId;
   171     
   172 private:
   173     TInt iReserved;
   174     TInt iReserved2;
   175     };
   176 
   177 
   178 
   179 #endif // SENSRVCHANNELINFO_H