wim/WimServer/inc/WimUtilityFuncs.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Header for utility functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWIMUTILITYFUNCS_H
       
    21 #define CWIMUTILITYFUNCS_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "WimConsts.h"      //Error codes
       
    25 #include "Wimi.h"           //WIMI definitions
       
    26 
       
    27 // DATA TYPES
       
    28 
       
    29 // Type of request
       
    30 enum TWimReqType
       
    31     {
       
    32     EWimMgmtReq
       
    33     };
       
    34 
       
    35 // Request type and transaction id
       
    36 struct TWimReqTrId
       
    37     {
       
    38     TAny*       iReqTrId;
       
    39     TWimReqType iReqType;
       
    40     };
       
    41 
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 *  Utility functions for WimServer
       
    47 *
       
    48 *  @since Series 60 2.1
       
    49 */
       
    50 class CWimUtilityFuncs : public CBase  
       
    51     {
       
    52     public:  // Constructors and destructor
       
    53         
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         */
       
    57         static CWimUtilityFuncs* NewL();
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CWimUtilityFuncs();
       
    63 
       
    64     public: // New functions
       
    65         
       
    66         /**
       
    67         * Map WIMI error to WIM errors
       
    68         * @param aStatus WIMI error code
       
    69         * @return WIM error code 
       
    70         */
       
    71         static TInt MapWIMError( WIMI_STAT aStatus );
       
    72 
       
    73         /**
       
    74         * Get SIM/SWIM state
       
    75         * @return SIM/SWIM state: KErrNone if OK
       
    76         *                         If not OK some other system wide state
       
    77         */
       
    78         static TInt SimState();
       
    79 
       
    80         /**
       
    81         * Utility function that reads a descriptor from the clients address
       
    82         * space. The caller has to free the returned HBufC8.
       
    83         * @param aIndex Message slot index to be read
       
    84         * @param aMessage Message
       
    85         * @return Pointer to allocated HBufC8 buffer.
       
    86         */
       
    87         HBufC8* DesLC( const TInt aIndex,
       
    88                        const RMessage2& aMessage ) const;
       
    89    
       
    90        
       
    91         /**
       
    92         * Creates a new ReqTrId item.
       
    93         * @param aAny Pointer to TAny
       
    94         * @param aReqType Request type
       
    95         * @return Structure which contains transaction ID and request type
       
    96         */
       
    97         TWimReqTrId* TrIdLC( TAny* aAny, TWimReqType aReqType ) const;
       
    98 
       
    99         /**
       
   100         * Maps WIMI's certificate location value to WimServer's location type
       
   101         * TWimCertificateCDF
       
   102         * @param aCertCDF WIMI's certificate location value
       
   103         * @return WimServer's location value
       
   104         */
       
   105         TUint8 MapCertLocation( const TUint8 aCertCDF ) const;
       
   106 
       
   107     private:
       
   108 
       
   109         /**
       
   110         * By default Symbian 2nd phase constructor is private.
       
   111         */
       
   112         void ConstructL();
       
   113 
       
   114         /**
       
   115         * C++ default constructor.
       
   116         */
       
   117         CWimUtilityFuncs();
       
   118 
       
   119     };
       
   120 
       
   121 #endif      // CWIMUTILITYFUNCS_H 
       
   122             
       
   123 // End of File