accessoryservices/accessoryserver/inc/Common/AccPolicyDB.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  This class defines the Accessory Policy DB interface. It is
       
    15 *                used by the Accessory Policy to access the database.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef ACCPOLICYDB_H
       
    21 #define ACCPOLICYDB_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "AccClientServerMessages.h"
       
    25 #include "AccPolCapabilityStorage.h"
       
    26 #include "AccPolicyDBNames.h"
       
    27 #include <AccPolValueRecord.h> //TAccPolValueType & TAccPolValueLocation 
       
    28 #include <e32std.h>
       
    29 #include <d32dbms.h> // RDbStoreDatabase
       
    30 #include <f32file.h> // RFs
       
    31 #include <s32file.h> // CFileStore
       
    32 
       
    33 // CONSTANTS
       
    34 const TInt KMaxBufLength = 256;
       
    35 
       
    36 // MACROS
       
    37 
       
    38 // DATA TYPES
       
    39 
       
    40 // FUNCTION PROTOTYPES
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 
       
    44 // CLASS DECLARATION
       
    45 /**
       
    46 *  Policy DB interface.
       
    47 *
       
    48 *  @lib AccPolicyDB.lib
       
    49 *  @since S60 3.1
       
    50 */
       
    51 class CAccPolicyDB : public CBase
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54 
       
    55         /**
       
    56         * Two-phased constructor.
       
    57         */
       
    58         IMPORT_C static CAccPolicyDB* NewL();
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         IMPORT_C virtual ~CAccPolicyDB();
       
    64 
       
    65     public: // New functions
       
    66 
       
    67         /**
       
    68         * OpenDBL Open DB connection.
       
    69         *
       
    70         * @since S60 3.1.
       
    71         * @return void.
       
    72         */
       
    73         IMPORT_C void OpenDBL();
       
    74 
       
    75         /**
       
    76         * CloseDB Close DB connection.
       
    77         *
       
    78         * @since S60 3.1.
       
    79         * @return void.
       
    80         */
       
    81         IMPORT_C void CloseDB();
       
    82 
       
    83         /**
       
    84         * Search if DeviceID has a mapped GIDInteger defined in DB.
       
    85         *
       
    86         * @since S60 3.1.
       
    87         * @param aDeviceID Device ID.
       
    88         * @param aGIDInt On succesfull return contains the GID integer value.
       
    89         * @return void.
       
    90         */
       
    91         IMPORT_C void FindGIDIntL( const TUint64& aDeviceID, TDes8& aGIDInt );
       
    92           
       
    93         
       
    94         /**
       
    95         * Search if DeviceID has a mapped GIDInteger defined in DB.
       
    96         *
       
    97         * @since S60 3.1.
       
    98         * @param aDeviceID Device ID.
       
    99         * @param aGIDInt On succesfull return contains the GID integer value.
       
   100         * @return void.
       
   101         */
       
   102         IMPORT_C void FindGIDIntL( const TUint64& aDeviceID, TDes8& aGIDInt, TAccGIDtype aType );  
       
   103            
       
   104         /**
       
   105         * Read all critical capabilities from DB.
       
   106         *
       
   107         * @since S60 3.1
       
   108         * @return void
       
   109         */       
       
   110         IMPORT_C TInt ReadAllCriticalCapabilitiesL();
       
   111         
       
   112         /**
       
   113         * Get the next critical capability read with ReadAllCriticalCapabilitiesL().
       
   114         *
       
   115         * @since S60 3.1
       
   116         * @param aName  On succesfull return, contains the next critical capability.
       
   117         * @param aValue On succesfull return, contains the value of next critical capability.
       
   118         * @return void
       
   119         */  
       
   120         IMPORT_C void GetNextCriticalCapabilityL( TUint32& aName, TInt32& aValue );
       
   121                 
       
   122         /**
       
   123         * 
       
   124         *
       
   125         * @since S60 3.1
       
   126         * @param 
       
   127         * @param 
       
   128         * @return void
       
   129         */        
       
   130         IMPORT_C TInt FilterGIDByTypeL( TAccGIDtype aType );
       
   131         
       
   132         /**
       
   133         * 
       
   134         *
       
   135         * @since S60 3.1
       
   136         * @param 
       
   137         * @param 
       
   138         * @return void
       
   139         */        
       
   140         IMPORT_C void GetNextGIDL( TUint64& aHWDeviceID, TDes8& aGIDInt );
       
   141         
       
   142         
       
   143         /**
       
   144         * 
       
   145         *
       
   146         * @since S60 3.1
       
   147         * @param 
       
   148         * @param 
       
   149         * @param aGetAllDeviceTypes If Ture, all configured device types are 
       
   150         *                           returned (i.e. all selection indexes).
       
   151         * @return void
       
   152         */        
       
   153         IMPORT_C void GetSelectionsL( TUint32 ruleIndex, 
       
   154                                       TUint32& aSelectionListBitMask,
       
   155                                       TBool aGetAllDeviceTypes = EFalse );
       
   156                        
       
   157                         
       
   158     public:     // Functions from base classes
       
   159 
       
   160     protected:  // New functions
       
   161 
       
   162     protected:  // Functions from base classes
       
   163 
       
   164     private:
       
   165 
       
   166         /**
       
   167         * C++ default constructor.
       
   168         */
       
   169         CAccPolicyDB();
       
   170 
       
   171         /**
       
   172         * By default Symbian 2nd phase constructor is private.
       
   173         */
       
   174         void ConstructL();
       
   175 
       
   176     public:     // Data
       
   177     
       
   178     protected:  // Data
       
   179 
       
   180     private:    // Data
       
   181 
       
   182         // For use of iFileStore
       
   183         RFs iFsSession;
       
   184 
       
   185         // For database operations
       
   186         RDbNamedDatabase iDb;
       
   187     
       
   188         // Buffer for SQL clauses
       
   189         TBuf<KMaxBufLength> iSQL;
       
   190 
       
   191         // View instance for rowsets from an SQL query
       
   192         RDbView iView;
       
   193 
       
   194     public:     // Friend classes
       
   195 
       
   196     protected:  // Friend classes
       
   197 
       
   198     private:    // Friend classes
       
   199 
       
   200     };
       
   201 
       
   202 #endif// ACCPOLICYDB_H
       
   203 
       
   204 // End of File