The plug-in framework has a default resolver that selects an appropriate implementation to suit the client requests. If the algorithm used by the custom resolver is inappropriate, an interface definition can provide its own custom resolver.
Custom resolvers are interface implementations that implement the CResolver interface. They are instantiated by the framework in response to the REComSession::CreateImplementationL() calls that specify to use a particular custom resolver. Custom resolvers must confirm to other aspects of interface implementations, including providing registration resource information, and publishing its UID and factory function in an implementation proxy table.
A custom resolver class must derive from CResolver. The derived class must implement the following inherited functions:
The following code depicts a sample customer resolver.
class CExampleResolver : public CResolver { public: // Factory function: static CExampleResolver* NewL(MPublicRegistry& aRegistry); ~CExampleResolver(); // Implement IdentifyImplementationL() TUid IdentifyImplementationL(TUid aInterfaceUid, const TEComResolverParams& aParameters) const; // Implement ListAllL RImplInfoArray* ListAllL(TUid aInterfaceUid, const TEComResolverParams& aParameters) const;
The following code shows a sample standard registration resource required by a custom resolver.
RESOURCE REGISTRY_INFO theInfo { dll_uid = 0x10009DB3; interfaces = { INTERFACE_INFO // interface_uid value is always 0x10009D90. { interface_uid = 0x10009D90; implementations = { IMPLEMENTATION_INFO { // uid value is specific to individual resolvers implementation_uid = 0x10009DB4; version_no = 1; // unused fields display_name = ""; default_data = ""; opaque_data = ""; } }; } }; }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.