applicationinterworkingfw/ServiceHandler/inc/AiwResolver.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2003-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:     Declares custom ECom resolver.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _AIW_RESOLVER_H
       
    22 #define _AIW_RESOLVER_H
       
    23 
       
    24 #include "AiwUids.hrh"
       
    25 #include <ecom/resolver.h>
       
    26 #include <ecom/publicregistry.h>
       
    27 #include <ecom/implementationproxy.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class TEComResolverParams;
       
    31 
       
    32 // DynFeature resolver's UID
       
    33 const TUid KAiwResolverImplUid = { KAiwResolverImplUidValue };
       
    34 
       
    35 /**
       
    36  * Implements a non-default resolver.
       
    37  *
       
    38  * This controls the identification, (resolution), of which implementation
       
    39  * will be used to satisfy an interface implementation instantiation.
       
    40  */
       
    41 class CAiwResolver : public CResolver
       
    42     {
       
    43     public:
       
    44 
       
    45         /**
       
    46         * Factory function
       
    47         * @param aRegistry <add description>
       
    48         */
       
    49         static CAiwResolver* NewL(MPublicRegistry& aRegistry);
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CAiwResolver();
       
    55 
       
    56         /**
       
    57         * Request that the resolver identify the most appropriate interface implementation.
       
    58         * 
       
    59         * @param aInterfaceUid          The interface for which implementations are requested.
       
    60         * @param aAdditionalParameters  Data to be used to refine the search further.
       
    61         * @return                       The Uid of the best fit interface implementation - 
       
    62         *                               KNullUid if no match is found.
       
    63         */
       
    64         TUid IdentifyImplementationL(TUid aInterfaceUid, 
       
    65             const TEComResolverParams& aAdditionalParameters) const;
       
    66 
       
    67         /**
       
    68         * List all the implementations which satisfy the specified interface.
       
    69         *
       
    70         * @param aInterfaceUid          The interface for which implementations are requested
       
    71         * @param aAdditionalParameters  Data to be used to refine the search further
       
    72         * @return                       Pointer to an array of suitable implementations. 
       
    73         *                               Ownership of this array is passed to the calling function.
       
    74         */
       
    75         RImplInfoArray* ListAllL(TUid aInterfaceUid, 
       
    76             const TEComResolverParams& aAdditionalParameters) const;
       
    77 
       
    78     private:
       
    79 
       
    80         /**
       
    81         * Constructor.
       
    82         * @param aRegistry <add description>
       
    83         */
       
    84         explicit CAiwResolver(MPublicRegistry& aRegistry);
       
    85 
       
    86         /**
       
    87         * Called by IdentifyImplementationL to select an appropriate implementation from a 
       
    88         * list of possibles.
       
    89         *
       
    90         * @param aImplementationsInfo   Information on the potential implementations
       
    91         * @param aAdditionalParameters  The data to match against to detemine the implementation
       
    92         * @return                       The Uid of the selected implementation - 
       
    93         *                               KNullUid if no match is found
       
    94         */
       
    95         TUid Resolve(const RImplInfoArray& aImplementationsInfo, 
       
    96             const TEComResolverParams& aAdditionalParameters) const;
       
    97 
       
    98         /**
       
    99         * Searches for a match of a data type on an implementation type.
       
   100         * Match returns ETrue if aMatchType is found within aImplementationType according 
       
   101         * to the following rules:
       
   102         *
       
   103         * 1) aImplementationType is treated as a series of descriptors separated by double
       
   104         * bars (||). ETrue is returned if aMatchType matches exactly any of the short
       
   105         * descriptors.  If no double bar is present then aImplementationType is treated as a
       
   106         * single descriptor.
       
   107         *
       
   108         * 2) If aUseWildcards == ETrue then a '?' in aMatchType will be matched to any single
       
   109         * character and '*' will be matched to any series of characters.
       
   110         *
       
   111         * @param aImplementationType  The implementation data type to search for a match
       
   112         * @param aMatchType           The data to search for
       
   113         * @param aUseWildcards        ETrue if wildcard matching should be allowed
       
   114         * @return                     ETrue if a match was found, EFalse otherwise
       
   115         */
       
   116         TBool Match(const TDesC8& aImplementationType, const TDesC8& aMatchType, 
       
   117             TBool aUseWildcards) const;
       
   118 
       
   119         TBool MatchServiceCmd(const TDesC8& aOpaqueData, const TDesC8& aServiceCmd) const;
       
   120 
       
   121         void ParseInput(const TDesC8& aParam, TDes8& aContent, TDes8& aOpaque) const;
       
   122 
       
   123     private:
       
   124 
       
   125         mutable RImplInfoArray* iImplementationInfoArray;
       
   126     };
       
   127 
       
   128 
       
   129 #endif  // AIW_RESOLVER_H
       
   130 
       
   131 // End of file
       
   132