mtpfws/mtpfw/inc/cmtpserviceconfig.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17 @file
       
    18 @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPSERVICECONFIG_H_
       
    22 #define CMTPSERVICECONFIG_H_
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32des8.h> 
       
    26 #include <barsc.h>
       
    27 #include <barsread.h>
       
    28 #include <e32cmn.h>
       
    29 
       
    30 #include <mtp/tmtptypeuint128.h>
       
    31 #include <mtp/tmtptypeguid.h>
       
    32 #include "cmtpserviceinfo.h"
       
    33 
       
    34 #include "mtpdebug.h"
       
    35 
       
    36 class TResourceReader;
       
    37 
       
    38 
       
    39 class CMTPServiceConfig : public CBase
       
    40 	{
       
    41 private:
       
    42 
       
    43     class TSupportedService
       
    44         {
       
    45         public:
       
    46             TSupportedService( const TMTPTypeGuid& aGUID, const TUint aServiceType, const TUint aResID );
       
    47         public:
       
    48             TMTPTypeGuid iGUID;
       
    49             TUint   iServiceType;
       
    50             TUint   iResourceID;
       
    51         };
       
    52     
       
    53 public:   
       
    54  
       
    55     static CMTPServiceConfig* NewL( RFs& aRFs );
       
    56     ~CMTPServiceConfig();	
       
    57     
       
    58     static TInt SupportedServiceOrderFromAscending( const TSupportedService& aL, const TSupportedService& aR);
       
    59     static TInt SupportedServiceOrderFromKeyAscending( const TMTPTypeGuid* aL, const TSupportedService& aR);
       
    60 
       
    61 public:
       
    62     TBool IsSupportedService( const TMTPTypeGuid& aServiceGUID ) const;
       
    63     void LoadServiceDataL( const TMTPTypeGuid& aServiceGUID );
       
    64     CMTPServiceInfo* ServiceInfo(const TMTPTypeGuid& aServiceGUID ) const;
       
    65     CMTPServiceInfo* ServiceInfo(const TUint aServiceID) const;
       
    66     TInt ServiceTypeOfSupportedService( const TMTPTypeGuid& aServiceGUID ) const;
       
    67     
       
    68 private:
       
    69     
       
    70 	CMTPServiceConfig( RFs& aRFs );
       
    71     void ConstructL( const TDesC& aResourceFilename );
       
    72     void InitializeL( TResourceReader& aReader );
       
    73     TUint ServiceResourceIDL( const TMTPTypeGuid& aServiceGUID ) const;
       
    74     
       
    75     void StartReadUseServicesL( RResourceFile& aResFile, const TUint aResID, CMTPServiceInfo& aServiceInfo );
       
    76     void StartReadServicePropertyNamespacesL(  RResourceFile& aResFile, const TUint aResID, RArray<TMTPTypeGuid>& aNamespaces );
       
    77     void StartReadServicePropertiesL(  RResourceFile& aResFile, const TUint aNamespaceResID, const TUint aPropertiesResID, CMTPServiceInfo& aServiceInfo );
       
    78     void StartReadServiceFormatsL(  RResourceFile& aResFile, const TUint aResID, CMTPServiceInfo& aServiceInfo );
       
    79     void StartReadServiceMethodsL(  RResourceFile& aResFile, const TUint aResID, CMTPServiceInfo& aServiceInfo );
       
    80     void StartReadServiceEventsL(  RResourceFile& aResFile, const TUint aResID, CMTPServiceInfo& aServiceInfo );
       
    81     void StartReadServiceDataBlockL(  RResourceFile& aResFile, const TUint aResID, CMTPServiceInfo& aServiceInfo );
       
    82     
       
    83     TMTPTypeGuid ReadGUID( TResourceReader& aReader );
       
    84     
       
    85 private:
       
    86 
       
    87     /**
       
    88     FLOGGER debug trace member variable.
       
    89     */
       
    90     __FLOG_DECLARATION_MEMBER_MUTABLE;
       
    91     
       
    92     
       
    93     RFs&                             iRFs;
       
    94     
       
    95     /**
       
    96      * service info store after loaded.
       
    97      */
       
    98     RPointerArray<CMTPServiceInfo>	        iServiceInfos;
       
    99 
       
   100 	/*
       
   101 	 * supported services
       
   102 	 */
       
   103 	RArray<TSupportedService>  iSupportedServices;
       
   104 		
       
   105 	};
       
   106 
       
   107 #endif /*CMTPSERVICECONFIG_H_*/