|
1 /* |
|
2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Interface for plugin classes implementing custom interface |
|
15 * factory interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CIFACTORYINTFC_H |
|
22 #define CIFACTORYINTFC_H |
|
23 |
|
24 // Include files |
|
25 #include <mmf/common/mcustomcommand.h> |
|
26 |
|
27 /** |
|
28 * Mixin class for plugins creating Custom Interface objects. |
|
29 * |
|
30 * Instance of plugins implementing this interface will be used by |
|
31 * CCIExtnClientPlugin. |
|
32 * |
|
33 * @since S60 v3.2 |
|
34 * |
|
35 */ |
|
36 class MCIFactoryIntfc |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Called by framework after plugin construction. |
|
41 * The passed UID must be retained for the lifetime of the plugin and, on a |
|
42 * subsequent call to Close(), REComSession::DestroyedImplementation() must |
|
43 * be called by the plugin, using the stored UID. |
|
44 * The implementation should return KErrNone upon successful initialization. |
|
45 * Otherwise the plugin will be immediately destroyed. |
|
46 * |
|
47 * @param aCustomCommand Reference to implementation of MCustomCommand. |
|
48 * @param aDestructorKey The Uid returned by |
|
49 * REComSession::CreateImplementationL() or similar. |
|
50 */ |
|
51 virtual TInt Initialize( MCustomCommand& aCustomCommand, TUid aDestructorKey ) = 0; |
|
52 |
|
53 /** |
|
54 * Returns implementation UID of this plugin. |
|
55 * |
|
56 * @return aUid implementation UID of the plugin |
|
57 */ |
|
58 virtual TUid ImplementationUid() = 0; |
|
59 |
|
60 /** |
|
61 * Called by the framework to obtain a pointer to the Custom Interface. |
|
62 * |
|
63 * Note that ownership of the interface will be transferred to the caller. |
|
64 * |
|
65 * @param aUid UID of the required interface. |
|
66 * @param aInterface Used to return pointer to the interface. Must be set |
|
67 * to NULL if no matching interface. |
|
68 * @return an error code KErrNotFound if requested custom inteface is not |
|
69 * supported by this plugin. KErrNone when custom interface object is |
|
70 * successfully created and returned. Any other error code returned |
|
71 * implies that custom interface is supported but the plugin was |
|
72 * unable to instantiate it when requested. |
|
73 */ |
|
74 virtual TInt CreateInterface( TUid aUid, TAny*& aInterface ) = 0; |
|
75 |
|
76 /** |
|
77 * Called by the framework when plugin is to be destroyed. |
|
78 * Equivalent to destructor. Called to destroy plugin. |
|
79 */ |
|
80 virtual void Close() = 0; |
|
81 }; |
|
82 |
|
83 #endif // CIFACTORYINTFC_H |