lowlevellibsandfws/pluginfw/Framework/Example/ExampleResolver.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 //
       
    15 
       
    16 
       
    17 #ifndef __EXAMPLERESOLVER_H__
       
    18 #define __VRESOLVER_H__
       
    19 
       
    20 #include "Resolver.h"
       
    21 #include "RegistryData.h"
       
    22 
       
    23 class TEComResolverParams;
       
    24 
       
    25 /**
       
    26 	@since 7.0
       
    27 	Controls the identification, (resolution), of which implementation 
       
    28 	will be used to satisfy an interface implementation instantiation.
       
    29  */
       
    30 class CExampleResolver : public CResolver
       
    31 {
       
    32 public:
       
    33 /**
       
    34 	@fn				NewL(MPublicRegistry& aRegistry)
       
    35 	Intended Usage	: Standardized safe construction which leaves nothing 
       
    36 					on the cleanup stack.	
       
    37 	Error Condition	: Cannot fully construct because of memory limitations.	
       
    38 	@leave  		KErrNoMemory
       
    39 	@since			7.0
       
    40 	@return			A pointer to the new class
       
    41 	@post			CExampleResolver is fully constructed, 
       
    42 					and initialized.
       
    43  */
       
    44 	static CExampleResolver* NewL(MPublicRegistry& aRegistry);
       
    45 
       
    46 /**
       
    47 	@fn				~CExampleResolver()
       
    48 	Intended Usage	: Standard default d'tor	
       
    49 	Error Condition	: None	
       
    50 	@since			7.0
       
    51  */
       
    52 	~CExampleResolver();
       
    53 
       
    54 /**
       
    55 	@fn				IdentifyImplementationL(TUid aInterfaceUid, 
       
    56 											const TEComResolverParams& aAdditionalParameters) const
       
    57 	Intended Usage	:	Request that the resolver identify the most appropriate 
       
    58 						interface implementation.
       
    59 	Error Condition	:	
       
    60 	@since			7.0
       
    61 	@param			aInterfaceUid The interface for which implementations are requested
       
    62 	@param			aAdditionalParameters Data to be used to refine the search further
       
    63 	@return			The Uid of the best fit interface implementation - KNullUid if no match is found
       
    64 	@pre 			Object is fully constructed and initialized
       
    65 	@post			Registry contents are not modified but registry keys may be updated
       
    66  */
       
    67 	TUid IdentifyImplementationL(TUid aInterfaceUid, const TEComResolverParams& aAdditionalParameters) const;
       
    68 
       
    69 /**
       
    70 	@fn				ListAllL(TUid aInterfaceUid, const TEComResolverParams& aAdditionalParameters) const
       
    71 	Intended Usage	:	List all the implementations which satisfy the specified interface.
       
    72 	Error Condition	:	
       
    73 	@since			7.0
       
    74 	@param			aInterfaceUid The interface for which implementations are requested
       
    75 	@param			aAdditionalParameters Data to be used to refine the search further
       
    76 	@return			Pointer to an array of suitable implementations. Ownership of this array
       
    77 	is passed to the calling function.
       
    78 	@pre 			Object is fully constructed and initialized
       
    79 	@post			Registry contents are not modified but registry keys may be updated
       
    80  */
       
    81 	RImplInfoArray* ListAllL(TUid aInterfaceUid, 
       
    82 							 const TEComResolverParams& aAdditionalParameters)const ;
       
    83 
       
    84 private:
       
    85 /**
       
    86 	@internalComponent
       
    87 	@fn				CExampleResolver(MPublicRegistry& aRegistry)
       
    88 	Intended Usage	: Standardized default c'tor	
       
    89 	Error Condition	: None	
       
    90 	@since			7.0
       
    91 	@post			CExampleResolver is fully constructed
       
    92  */
       
    93 	explicit CExampleResolver(MPublicRegistry& aRegistry);
       
    94 
       
    95 /**
       
    96 	@fn				Resolve(const RImplInfoArray& aImplementationsInfo, 
       
    97 							const TEComResolverParams& aAdditionalParameters) const
       
    98 	Intended Usage	:	Called by IdentifyImplementationL to select an appropriate 
       
    99 					implementation from a list of possibles
       
   100 	@since			7.0
       
   101 	@param			aImplementationsInfo Information on the potential implementations
       
   102 	@param			aAdditionalParameters The data to match against to detemine the 
       
   103 					implementation
       
   104 	@return			The Uid of the selected implementation - KNullUid if no match is found
       
   105 	@pre 			This object is fully constructed
       
   106  */
       
   107 	TUid Resolve(const RImplInfoArray& aImplementationsInfo, 
       
   108 				 const TEComResolverParams& aAdditionalParameters) const;
       
   109 
       
   110 /**
       
   111 	@fn				Match(const TDesC8& aImplementationType, 
       
   112 						  const TDesC8& aMatchType, 
       
   113 						  TBool aUseWildcards) const
       
   114 	Intended Usage	:	Searches for a match of a data type on an implementation type.
       
   115 	Match returns ETrue if aMatchType is found within aImplementationType according to 
       
   116 	the following rules:
       
   117 	1) aImplementationType is treated as a series of descriptors separated by double 
       
   118 	bars (||). ETrue is returned if aMatchType matches exactly any of the short 
       
   119 	descriptors.  If no double bar is present then aImplementationType is treated as a
       
   120 	single descriptor.
       
   121 	2) If aUseWildcards == ETrue then a '?' in aMatchType will be matched to any single
       
   122 	character and '*' will be matched to any series of characters.
       
   123 	@leave  		KErrNoMemory
       
   124 	@since			7.0
       
   125 	@param			aImplementationType The implementation data type to search for a match
       
   126 	@param			aMatchType The data to search for
       
   127 	@param			aUseWildcards ETrue if wildcard matching should be allowed
       
   128 	@return			ETrue if a match was found, EFalse otherwise
       
   129 	@pre 			This object is fully constructed
       
   130  */
       
   131 	TBool Match(const TDesC8& aImplementationType, 
       
   132 				const TDesC8& aMatchType, 
       
   133 				TBool aUseWildcards) const;
       
   134 
       
   135 private:
       
   136 	mutable RImplInfoArray* iImplementationInfoArray;
       
   137 };
       
   138 
       
   139 #endif // __EXAMPLERESOLVER_H__
       
   140