|
1 /* |
|
2 * Copyright (c) 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: HID Keyboard Layout ECOM interface definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __HIDLAYOUTPLUGININTERFACE_H__ |
|
20 #define __HIDLAYOUTPLUGININTERFACE_H__ |
|
21 |
|
22 #include <ecom/ecom.h> |
|
23 #include "hiddebug.h" |
|
24 #include "hiduids.h" |
|
25 |
|
26 // Constant for plugin interface: |
|
27 const TUid KHidLayoutPluginInterfaceUid = |
|
28 { |
|
29 LAYOUT_PLUGIN_IF |
|
30 }; |
|
31 |
|
32 /** |
|
33 * Interface class for HID Layout plugin. All plugins will implement this class. |
|
34 * |
|
35 * @lib kbdlayout.lib ? |
|
36 * @since ... |
|
37 */ |
|
38 class CHidLayoutPluginInterface : public CBase |
|
39 { |
|
40 public: |
|
41 // Constructors & destructors |
|
42 |
|
43 /** |
|
44 * Creates new plugin having the given UID. |
|
45 * Uses Leave code KErrNotFound if implementation is not found. |
|
46 * |
|
47 * @param aImplementationUid Implementation UID of the plugin to be |
|
48 * created. |
|
49 */ |
|
50 inline static CHidLayoutPluginInterface* NewL( |
|
51 const TUid aImplementationUid); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 inline ~CHidLayoutPluginInterface(); |
|
57 |
|
58 protected: |
|
59 // New |
|
60 |
|
61 /** |
|
62 * C++ constructor. |
|
63 */ |
|
64 inline CHidLayoutPluginInterface(); |
|
65 |
|
66 private: |
|
67 // Data |
|
68 |
|
69 /** |
|
70 * ECOM plugin instance UID. |
|
71 */ |
|
72 TUid iDtor_ID_Key; |
|
73 }; |
|
74 |
|
75 inline CHidLayoutPluginInterface::CHidLayoutPluginInterface() |
|
76 { |
|
77 } |
|
78 |
|
79 inline CHidLayoutPluginInterface::~CHidLayoutPluginInterface() |
|
80 { |
|
81 DBG(RDebug::Print(_L("[HID]\tCHidLayoutPluginInterface: destroying plugin 0x%08x"),iDtor_ID_Key)); |
|
82 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
83 } |
|
84 |
|
85 inline CHidLayoutPluginInterface* CHidLayoutPluginInterface::NewL( |
|
86 TUid aImplementationUid) |
|
87 { |
|
88 DBG(RDebug::Print(_L("[HID]\tCHidLayoutPluginInterface: Loading plugin 0x%08x"),aImplementationUid.iUid)); |
|
89 |
|
90 TAny* ptr; |
|
91 TInt32 keyOffset = _FOFF( CHidLayoutPluginInterface, iDtor_ID_Key ); |
|
92 |
|
93 ptr = REComSession::CreateImplementationL(aImplementationUid, keyOffset); |
|
94 |
|
95 DEBUG_PRINT( _L( "[HID]\tCHidLayoutPluginInterface: Loading done." ) ); |
|
96 |
|
97 return reinterpret_cast<CHidLayoutPluginInterface*> (ptr); |
|
98 } |
|
99 |
|
100 #endif |
|
101 |