1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/inc/Resolver.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,128 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// This file contains the definition of the CResolver
1.18 +// class.
1.19 +//
1.20 +//
1.21 +
1.22 +#if defined (_MSC_VER) && (_MSC_VER >= 1000)
1.23 +#pragma once
1.24 +#endif
1.25 +#ifndef __RESOLVER_H__
1.26 +#define __RESOLVER_H__
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <f32file.h>
1.30 +
1.31 +#include <ecom/ecom.h>
1.32 +#include <ecom/publicregistry.h>
1.33 +
1.34 +class TEComResolverParams;
1.35 +
1.36 +/**
1.37 +The UID idnetifying the ECOM Resolver plugin interface.
1.38 +
1.39 +@publishedAll
1.40 +@released
1.41 +*/
1.42 +const TUid KCustomResolverInterfaceUid = {0x10009D90};
1.43 +
1.44 +/**
1.45 +Abstract base class which is used to identify the correct interface implementation
1.46 +based on criteria supplied by the client.
1.47 +This base class can be used to write a client specific resolver, however this is not
1.48 +required as a default implementation is provided within ECom.
1.49 +
1.50 +@publishedAll
1.51 +@released
1.52 +*/
1.53 +
1.54 +class CResolver : public CBase
1.55 +{
1.56 +public:
1.57 + /**
1.58 + Intended Usage : Request that the resolver identify the most appropriate interface
1.59 + implementation.
1.60 + Error Condition : Depends on implementation.
1.61 + @since 7.0
1.62 + @param aInterfaceUid The interface for which an implementation is requested
1.63 + @param aAdditionalParameters The parameters which must match for an
1.64 + implementation to be suitable
1.65 + @return The unique Id of the implementation which satisfies the specified parameters.
1.66 + @pre This object is fully constructed.
1.67 + */
1.68 +
1.69 + virtual TUid IdentifyImplementationL(TUid aInterfaceUid,
1.70 + const TEComResolverParams& aAdditionalParameters) const = 0;
1.71 +
1.72 + /**
1.73 + Intended Usage : List all the implementations which satisfy the specified
1.74 + interface definition and the resolve parameters supplied.
1.75 + Error Condition : Depends on implementation.
1.76 + @since 7.0
1.77 + @param aInterfaceUid The interface for which implementations are requested
1.78 + @param aAdditionalParameters The parameters which must match for an
1.79 + implementation to be suitable
1.80 + @return Pointer to an array of suitable implementations. Ownership of this
1.81 + array is passed to the calling function.
1.82 + @pre Object is fully constructed and initialized
1.83 + @post Registry contents are not modified but registry keys may be updated
1.84 + */
1.85 +
1.86 + virtual RImplInfoArray* ListAllL(TUid aInterfaceUid,
1.87 + const TEComResolverParams& aAdditionalParameters) const = 0;
1.88 +
1.89 +
1.90 + inline RImplInfoArray& ListAllL(TUid aInterfaceUid)const;
1.91 +
1.92 +protected:
1.93 +
1.94 + explicit inline CResolver(MPublicRegistry& aRegistry);
1.95 +
1.96 + // Attributes
1.97 + /** A reference to the instantiated registry information */
1.98 +
1.99 + const MPublicRegistry& iRegistry;
1.100 +};
1.101 +
1.102 +/**
1.103 +@internalAll
1.104 +Intended Usage : Standardized default c'tor
1.105 +Error Condition : None
1.106 +@since 7.0
1.107 +@post CResolver is fully constructed
1.108 +*/
1.109 +CResolver::CResolver(MPublicRegistry& aRegistry) :
1.110 +CBase(),
1.111 +iRegistry(aRegistry)
1.112 + {
1.113 + // Do nothing
1.114 + }
1.115 +
1.116 +/**
1.117 +Intended Usage : List all the implementations which satisfy the specified interface.
1.118 +Error Condition : @see CRegistryData::ListImplementationsL
1.119 +@since 7.0
1.120 +@param aInterfaceUid The interface for which implementations are requested
1.121 +@return Array of suitable implementations
1.122 +@pre Object is fully constructed and initialized
1.123 +@post Registry contents are not modified but registry keys may be updated
1.124 +*/
1.125 +RImplInfoArray& CResolver::ListAllL(TUid aInterfaceUid)const
1.126 + {
1.127 + return iRegistry.ListImplementationsL(aInterfaceUid);
1.128 + }
1.129 +
1.130 +#endif /* __RESOLVER_H__ */
1.131 +