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