lowlevellibsandfws/pluginfw/Framework/inc/Resolver.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-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 // This file contains the definition of the CResolver
       
    15 // class.
       
    16 // 
       
    17 //
       
    18 
       
    19 #if defined (_MSC_VER) && (_MSC_VER >= 1000)
       
    20 #pragma once
       
    21 #endif
       
    22 #ifndef __RESOLVER_H__
       
    23 #define __RESOLVER_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 #include <ecom/ecom.h>
       
    29 #include <ecom/publicregistry.h>
       
    30 
       
    31 class TEComResolverParams;
       
    32 
       
    33 /**
       
    34 The UID idnetifying the ECOM Resolver plugin interface.
       
    35 
       
    36 @publishedAll
       
    37 @released
       
    38 */
       
    39 const TUid KCustomResolverInterfaceUid = {0x10009D90};
       
    40 
       
    41 /**
       
    42 Abstract base class which is used to identify the correct interface implementation
       
    43 based on criteria supplied by the client.
       
    44 This base class can be used to write a client specific resolver, however this is not 
       
    45 required as a default implementation is provided within ECom.
       
    46 
       
    47 @publishedAll
       
    48 @released
       
    49 */
       
    50 
       
    51 class CResolver : public CBase
       
    52 {
       
    53 public:
       
    54 	/**
       
    55 	Intended Usage	:	Request that the resolver identify the most appropriate interface 
       
    56 						implementation.
       
    57 	Error Condition	:	Depends on implementation.
       
    58 	@since			7.0
       
    59 	@param			aInterfaceUid The interface for which an implementation is requested
       
    60 	@param			aAdditionalParameters The parameters which must match for an 
       
    61 					implementation to be suitable
       
    62 	@return			The unique Id of the implementation which satisfies the specified parameters.
       
    63 	@pre 			This object is fully constructed.
       
    64  	*/
       
    65 	
       
    66 	virtual TUid IdentifyImplementationL(TUid aInterfaceUid, 
       
    67 										 const TEComResolverParams& aAdditionalParameters) const  = 0;
       
    68 
       
    69 	/**
       
    70 	Intended Usage	:	List all the implementations which satisfy the specified 
       
    71 						interface definition and the resolve parameters supplied.
       
    72 	Error Condition	:	Depends on implementation.
       
    73 	@since			7.0
       
    74 	@param			aInterfaceUid The interface for which implementations are requested
       
    75 	@param			aAdditionalParameters The parameters which must match for an 
       
    76 					implementation to be suitable
       
    77 	@return			Pointer to an array of suitable implementations. Ownership of this 
       
    78 					array is passed to the calling function.
       
    79 	@pre 			Object is fully constructed and initialized
       
    80 	@post			Registry contents are not modified but registry keys may be updated
       
    81 	*/
       
    82 	
       
    83 	virtual RImplInfoArray* ListAllL(TUid aInterfaceUid, 
       
    84 									 const TEComResolverParams& aAdditionalParameters) const = 0;
       
    85 
       
    86 	
       
    87 	inline RImplInfoArray& ListAllL(TUid aInterfaceUid)const;
       
    88 
       
    89 protected:
       
    90 	
       
    91 	explicit inline CResolver(MPublicRegistry& aRegistry);
       
    92 
       
    93 	// Attributes
       
    94 	/** A reference to the instantiated registry information */
       
    95 	
       
    96 	 const MPublicRegistry& iRegistry;
       
    97 };
       
    98 
       
    99 /**
       
   100 @internalAll
       
   101 Intended Usage	: Standardized default c'tor
       
   102 Error Condition	: None
       
   103 @since			7.0
       
   104 @post			CResolver is fully constructed
       
   105 */
       
   106 CResolver::CResolver(MPublicRegistry& aRegistry) :
       
   107 CBase(),
       
   108 iRegistry(aRegistry)
       
   109 	{
       
   110 	// Do nothing
       
   111 	}
       
   112 
       
   113 /**
       
   114 Intended Usage	:	List all the implementations which satisfy the specified interface.
       
   115 Error Condition	:	@see CRegistryData::ListImplementationsL
       
   116 @since			7.0
       
   117 @param			aInterfaceUid The interface for which implementations are requested
       
   118 @return			Array of suitable implementations
       
   119 @pre 			Object is fully constructed and initialized
       
   120 @post			Registry contents are not modified but registry keys may be updated
       
   121 */
       
   122 RImplInfoArray& CResolver::ListAllL(TUid aInterfaceUid)const
       
   123 	{
       
   124 	return iRegistry.ListImplementationsL(aInterfaceUid);
       
   125 	}
       
   126 
       
   127 #endif /* __RESOLVER_H__ */
       
   128