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