author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 2 |
// All rights reserved. |
williamr@4 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@4 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 7 |
// |
williamr@4 | 8 |
// Initial Contributors: |
williamr@4 | 9 |
// Nokia Corporation - initial contribution. |
williamr@4 | 10 |
// |
williamr@4 | 11 |
// Contributors: |
williamr@4 | 12 |
// |
williamr@4 | 13 |
// Description: |
williamr@4 | 14 |
// ULogger plug-in base class |
williamr@4 | 15 |
// |
williamr@4 | 16 |
// |
williamr@4 | 17 |
|
williamr@4 | 18 |
/** |
williamr@4 | 19 |
@file |
williamr@4 | 20 |
@publishedPartner |
williamr@4 | 21 |
@prototype |
williamr@4 | 22 |
*/ |
williamr@4 | 23 |
|
williamr@4 | 24 |
#ifndef ULOGGERPLUGIN_H |
williamr@4 | 25 |
#define ULOGGERPLUGIN_H |
williamr@4 | 26 |
|
williamr@4 | 27 |
#include <e32base.h> |
williamr@4 | 28 |
#include <ecom/implementationinformation.h> |
williamr@4 | 29 |
#include <ecom/ecomresolverparams.h> |
williamr@4 | 30 |
#include <ecom/ecom.h> |
williamr@4 | 31 |
|
williamr@4 | 32 |
namespace Ulogger |
williamr@4 | 33 |
{ |
williamr@4 | 34 |
//! Base class for all ULogger plug-ins. |
williamr@4 | 35 |
/*! |
williamr@4 | 36 |
ULogger is extensible through a plug-in framework that uses ECom for plug-in |
williamr@4 | 37 |
discovery. Deriving from this class means that all the ECom-specific logic is |
williamr@4 | 38 |
already provided for the plug-in implementer, out-of-the-box, leaving the |
williamr@4 | 39 |
plug-in code to deal with the domain-specific logic that the plug-in is supposed |
williamr@4 | 40 |
to implement only. |
williamr@4 | 41 |
|
williamr@4 | 42 |
Among the plug-in types that are currently supported are output plug-ins (see |
williamr@4 | 43 |
class ULogger::MOutputPlugin in uloggeroutputplugin.h) and input plug-ins (see |
williamr@4 | 44 |
class ULogger::MInputPlugin in uloggerinputplugin.h). |
williamr@4 | 45 |
|
williamr@4 | 46 |
Plug-ins must derive from this class in order to be compatible with ULogger. |
williamr@4 | 47 |
*/ |
williamr@4 | 48 |
class CPlugin : public CBase |
williamr@4 | 49 |
{ |
williamr@4 | 50 |
public: |
williamr@4 | 51 |
/** |
williamr@4 | 52 |
Enum to signify plug-in interface types. Used by each specific plug-in |
williamr@4 | 53 |
interface (M-class) to identify itself as being of a particular type. |
williamr@4 | 54 |
*/ |
williamr@4 | 55 |
enum TPluginInterface |
williamr@4 | 56 |
{ |
williamr@4 | 57 |
EOutput,//!< output plug-in interface type |
williamr@4 | 58 |
EInput //!< input plug-in interface type |
williamr@4 | 59 |
}; |
williamr@4 | 60 |
|
williamr@4 | 61 |
public: |
williamr@4 | 62 |
/** |
williamr@4 | 63 |
Creates a CPlugin instance of the specified type and returns a pointer to |
williamr@4 | 64 |
it. The type is specified as the name of the ECom plug-in DLL (without the |
williamr@4 | 65 |
dll extension). |
williamr@4 | 66 |
|
williamr@4 | 67 |
@param aCue a descriptor containing the name of the plug-in to be created |
williamr@4 | 68 |
@return A pointer to the newly created CPlugin object. |
williamr@4 | 69 |
*/ |
williamr@4 | 70 |
static CPlugin* NewL(const TDesC8& aCue); |
williamr@4 | 71 |
|
williamr@4 | 72 |
/** |
williamr@4 | 73 |
Virtual destructor. |
williamr@4 | 74 |
*/ |
williamr@4 | 75 |
virtual ~CPlugin(); |
williamr@4 | 76 |
|
williamr@4 | 77 |
/** |
williamr@4 | 78 |
Return pointer to requested interface. |
williamr@4 | 79 |
If plug-in implements multiple interfaces, it should return pointer to |
williamr@4 | 80 |
proper interface trough this method. |
williamr@4 | 81 |
|
williamr@4 | 82 |
@param aInterfaceId Number of requested interface. |
williamr@4 | 83 |
@return Pointer to requested interface or NULL if requested interface is not |
williamr@4 | 84 |
supported. |
williamr@4 | 85 |
*/ |
williamr@4 | 86 |
virtual TAny* GetInterfaceL(TPluginInterface aInterfaceId) = 0; |
williamr@4 | 87 |
|
williamr@4 | 88 |
private: |
williamr@4 | 89 |
TUid iDtor_ID_Key; |
williamr@4 | 90 |
}; |
williamr@4 | 91 |
|
williamr@4 | 92 |
} //end of namespace |
williamr@4 | 93 |
|
williamr@4 | 94 |
#include "uloggerplugin.inl" // Our own base implementations for ECOM |
williamr@4 | 95 |
|
williamr@4 | 96 |
#endif /* ULOGGERPLUGIN_H */ |