accessoryservices/accessoryserver/inc/Common/AccPolGenericIDAccessor.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  A private accessor API for Accessory Policy internal use. 
       
    15 *                  This API is used to modify the attribute values of a 
       
    16 *                  Generic ID instance.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef TACCPOLGENERICIDACCESSOR_H
       
    23 #define TACCPOLGENERICIDACCESSOR_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <AccPolGenericID.h>
       
    27 #include <AccPolGenericIDArray.h>
       
    28 #include <AccPolNameValueRecord.h>
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // Used internally by Accessory Policy. This defines the first attribute
       
    33 // definition. All other definitions are relative to this.
       
    34 const TUint KAccPolFirstAttributeDefinition = 1;
       
    35 // Device type
       
    36 const TUint KAccPolDTDeviceType             = KAccPolFirstAttributeDefinition;
       
    37 // Physical connection
       
    38 const TUint KAccPolPCPhysicalConnection     = KAccPolFirstAttributeDefinition + 1;
       
    39 // Application protocol
       
    40 const TUint KAccPolAPApplicationProtocol    = KAccPolFirstAttributeDefinition + 2;
       
    41 // Capabilities subblock
       
    42 const TUint KAccPolSBCapabilities           = KAccPolFirstAttributeDefinition + 3;
       
    43 
       
    44 // MACROS
       
    45 
       
    46 // DATA TYPES
       
    47 
       
    48 // FUNCTION PROTOTYPES
       
    49 
       
    50 // FORWARD DECLARATIONS
       
    51 class CAccConGenericID;
       
    52 
       
    53 // CLASS DECLARATION
       
    54 
       
    55 /**
       
    56 *  This API is used to modify the attribute values of a Generic ID instance
       
    57 *
       
    58 *  @lib AccPolicy.lib
       
    59 *  @since S60 3.1
       
    60 */
       
    61 class TAccPolGenericIDAccessor
       
    62     {
       
    63     public: // New functions
       
    64 
       
    65         /**
       
    66         * Set matching Generic ID feature attribute.
       
    67         *
       
    68         * @since S60 3.1
       
    69         * @param aGenericID           Generic ID instance where the features are stored.
       
    70         * @param aGIDAttribute        Generic ID attribute to be set.
       
    71         * @param aGIDAttributeBitMask Attribute(s) value to be set.
       
    72         * @return void
       
    73         */
       
    74         IMPORT_C static void SetFeatureAttributeL( TAccPolGenericID& aGenericID, 
       
    75                                                    const TUint aGIDAttribute, 
       
    76                                                    const TUint32 aGIDAttributeBitMask );
       
    77 
       
    78         /**
       
    79         * Set matching Generic ID feature attribute.
       
    80         *
       
    81         * @since S60 3.1
       
    82         * @param aGenericID           Generic ID instance where the features are stored.
       
    83         * @param aGIDAttribute        Generic ID attribute to be set.
       
    84         * @param aGIDAttributeBitMask Attribute(s) value to be set.
       
    85         * @return void
       
    86         */
       
    87         IMPORT_C static void SetFeatureAttributeL( TAccPolGenericID& aGenericID, 
       
    88                                                    const TUint aGIDAttribute, 
       
    89                                                    const TUint64 aGIDAttributeBitMask );
       
    90 
       
    91         /**
       
    92         * Set vendor specific hardware model identifier for this Generic ID.
       
    93         *
       
    94         * @since S60 3.1
       
    95         * @param aGenericID Generic ID instance where the HWModelID is stored.
       
    96         * @param aHWModelID Hardware model identifier to be set.
       
    97         * @return void
       
    98         */
       
    99         IMPORT_C static void SetHWModelID( TAccPolGenericID& aGenericID, 
       
   100                                            const TDesC& aHWModelID );
       
   101 
       
   102         /**
       
   103         * Set vendor specific hardware device identifier for this Generic ID.
       
   104         *
       
   105         * @since S60 3.1
       
   106         * @param aGenericID  Generic ID instance where the HWDeviceID is stored.
       
   107         * @param aHWDeviceID Hardware device identifier to be set.
       
   108         * @return void
       
   109         */
       
   110         IMPORT_C static void SetHWDeviceID( TAccPolGenericID& aGenericID, 
       
   111                                             const TUint64 aHWDeviceID );
       
   112 
       
   113         /**
       
   114         * Set device address ID for this Generic ID.
       
   115         *
       
   116         * @since S60 3.1
       
   117         * @param aGenericID      Generic ID instance where the aDeviceAddress is stored.
       
   118         * @param aDeviceAddress  Device address to be set, for instance BT Address.
       
   119         * @return void
       
   120         */
       
   121         IMPORT_C static void SetDeviceAddress( TAccPolGenericID& aGenericID,
       
   122                                                const TUint64 aDeviceAddress );
       
   123 
       
   124         /**
       
   125         * Set unique ID from DB for this Generic ID.
       
   126         *
       
   127         * @since S60 3.1
       
   128         * @param aGenericID Generic ID instance where the unique identifier is stored.
       
   129         * @param aDBID      Unique identifier to be set, generated by DBMS server.
       
   130         * @return void
       
   131         */
       
   132         IMPORT_C static void SetDBID( TAccPolGenericID& aGenericID, const TInt aDBID );
       
   133 
       
   134         /**
       
   135         * Compare two Generic ID instances based on static member attributes 
       
   136         *   (AccPolGIDHeader).
       
   137         *
       
   138         * @since S60 3.1
       
   139         * @param aLValue A reference to the first (or left) Generic ID to be compared
       
   140         * @param aRValue A reference to the second (or right) Generic ID to be compared.
       
   141         * @return ETrue if AccPolGIDHeader instance of both Generic 
       
   142         *   IDs are exactly the same, else EFalse.
       
   143         */
       
   144         IMPORT_C static TBool CompareGenericID( const TAccPolGenericID& aLValue, 
       
   145                                                 const TAccPolGenericID& aRValue );
       
   146 
       
   147         /**
       
   148         * Set static attributes for this Generic ID.
       
   149         *
       
   150         * @since S60 3.1
       
   151         * @param aLGenericID Generic ID instance where the static attributes are stored.
       
   152         * @param aRGenericID Static attributes to be set.        
       
   153         * @return void
       
   154         */                                        
       
   155         IMPORT_C static void SetGenericIDStaticAttributes( CAccConGenericID* const aLGenericID, 
       
   156                                                            const TAccPolGenericID& aRGenericID );
       
   157 
       
   158         /**
       
   159         * Set static attributes for this Generic ID.
       
   160         *
       
   161         * @since S60 3.1
       
   162         * @param aGenericID Generic ID instance where the static attributes are stored.
       
   163         * @param aGenericIDHeader Static attributes to be set.        
       
   164         * @return void
       
   165         */                                        
       
   166         static void SetGenericIDStaticAttributes( TAccPolGenericID& aGenericID, 
       
   167                                                   const TAccPolGIDHeader &aGenericIDHeader);
       
   168 
       
   169 
       
   170                                
       
   171         /**
       
   172         * Get a pointer to the member name value buffer.
       
   173         *
       
   174         * @since S60 3.1
       
   175         * @param aGenericID Generic ID instance.
       
   176         * @return Pointer to name value buffer.
       
   177         */
       
   178         IMPORT_C static CBufFlat* NameValueBuf( CAccConGenericID* const aGenericID );
       
   179      
       
   180     
       
   181         /**
       
   182         * Get reference to Generic ID header.
       
   183         *
       
   184         * @since S60 3.1
       
   185         * @param aGenericID Generic ID instance.
       
   186         * @return Reference to Generic ID header.
       
   187         */
       
   188         IMPORT_C static TAccPolGenericID& GenericIDRef( CAccConGenericID* const aGenericID );
       
   189  
       
   190         /**
       
   191         * Debug print Generic ID using RDebug::Print().
       
   192         *
       
   193         * @since S60 3.1
       
   194         * @param aGenericID Generic ID instance to be print.
       
   195         * @return void
       
   196         */
       
   197         IMPORT_C static void DebugPrint( const TAccPolGenericID& aGenericID );
       
   198 
       
   199     private:  // Constructors and destructor
       
   200         
       
   201         /**
       
   202         * C++ default constructor.
       
   203         */
       
   204         TAccPolGenericIDAccessor();
       
   205     };
       
   206 
       
   207 #endif      // TACCPOLGENERICIDACCESSOR_H
       
   208 
       
   209 // End of File