williamr@4: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // ULogger plug-in base class williamr@4: // williamr@4: // williamr@4: williamr@4: /** williamr@4: @file williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: williamr@4: #ifndef ULOGGERPLUGIN_H williamr@4: #define ULOGGERPLUGIN_H williamr@4: williamr@4: #include williamr@4: #include williamr@4: #include williamr@4: #include williamr@4: williamr@4: namespace Ulogger williamr@4: { williamr@4: //! Base class for all ULogger plug-ins. williamr@4: /*! williamr@4: ULogger is extensible through a plug-in framework that uses ECom for plug-in williamr@4: discovery. Deriving from this class means that all the ECom-specific logic is williamr@4: already provided for the plug-in implementer, out-of-the-box, leaving the williamr@4: plug-in code to deal with the domain-specific logic that the plug-in is supposed williamr@4: to implement only. williamr@4: williamr@4: Among the plug-in types that are currently supported are output plug-ins (see williamr@4: class ULogger::MOutputPlugin in uloggeroutputplugin.h) and input plug-ins (see williamr@4: class ULogger::MInputPlugin in uloggerinputplugin.h). williamr@4: williamr@4: Plug-ins must derive from this class in order to be compatible with ULogger. williamr@4: */ williamr@4: class CPlugin : public CBase williamr@4: { williamr@4: public: williamr@4: /** williamr@4: Enum to signify plug-in interface types. Used by each specific plug-in williamr@4: interface (M-class) to identify itself as being of a particular type. williamr@4: */ williamr@4: enum TPluginInterface williamr@4: { williamr@4: EOutput,//!< output plug-in interface type williamr@4: EInput //!< input plug-in interface type williamr@4: }; williamr@4: williamr@4: public: williamr@4: /** williamr@4: Creates a CPlugin instance of the specified type and returns a pointer to williamr@4: it. The type is specified as the name of the ECom plug-in DLL (without the williamr@4: dll extension). williamr@4: williamr@4: @param aCue a descriptor containing the name of the plug-in to be created williamr@4: @return A pointer to the newly created CPlugin object. williamr@4: */ williamr@4: static CPlugin* NewL(const TDesC8& aCue); williamr@4: williamr@4: /** williamr@4: Virtual destructor. williamr@4: */ williamr@4: virtual ~CPlugin(); williamr@4: williamr@4: /** williamr@4: Return pointer to requested interface. williamr@4: If plug-in implements multiple interfaces, it should return pointer to williamr@4: proper interface trough this method. williamr@4: williamr@4: @param aInterfaceId Number of requested interface. williamr@4: @return Pointer to requested interface or NULL if requested interface is not williamr@4: supported. williamr@4: */ williamr@4: virtual TAny* GetInterfaceL(TPluginInterface aInterfaceId) = 0; williamr@4: williamr@4: private: williamr@4: TUid iDtor_ID_Key; williamr@4: }; williamr@4: williamr@4: } //end of namespace williamr@4: williamr@4: #include "uloggerplugin.inl" // Our own base implementations for ECOM williamr@4: williamr@4: #endif /* ULOGGERPLUGIN_H */