|
1 /* |
|
2 * Copyright (c) 2007 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: The click maker plugin, which |
|
15 * handles key events at window server process. |
|
16 * Part of: Tactile Feedback. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef C_TACTILECLICKPLUGIN_H |
|
22 #define C_TACTILECLICKPLUGIN_H |
|
23 |
|
24 |
|
25 |
|
26 #include <w32click.h> |
|
27 |
|
28 #include "tactilefeedbackserver.h" |
|
29 |
|
30 |
|
31 |
|
32 /** |
|
33 * The click maker plugin to be used as stub when the real plugin is |
|
34 * not available. |
|
35 * |
|
36 * All connections fail with KErrNotSupported, which will essentially |
|
37 * disable feedback support on client side. |
|
38 * |
|
39 * @lib tactilefeedbackresolver.dll |
|
40 * @since S60 v5.0 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CTactileClickPlugin ): |
|
43 public CClickMaker, |
|
44 public MTactileFeedbackServer |
|
45 { |
|
46 public: |
|
47 |
|
48 static CTactileClickPlugin* NewL(); |
|
49 |
|
50 virtual ~CTactileClickPlugin(); |
|
51 |
|
52 // from base class CClickMaker |
|
53 |
|
54 /** |
|
55 * From CClickMaker. |
|
56 * This function is called by the window server whenever there is a |
|
57 * key event, to generate the sound. |
|
58 * |
|
59 * The key events are not used by this plugin actually, because this |
|
60 * plug-in's purpose is to handle only pointer events. |
|
61 * |
|
62 * @since S60 v5.0 |
|
63 * @param aType - The type of the key event. |
|
64 * @param aEvent - The key event details. |
|
65 */ |
|
66 void KeyEvent( TEventCode aType,const TKeyEvent& aEvent ); |
|
67 |
|
68 /** |
|
69 * From CClickMaker. |
|
70 * This function is called by the window server whenever there is a |
|
71 * pointer event, to generate the sound. |
|
72 * |
|
73 * Not used by this plug-in because there is not enough information in |
|
74 * the pointer event for resolving the actual area and window where |
|
75 * pointer event was hit. Intead pointer events are handled in |
|
76 * OtherEvent -function. |
|
77 * |
|
78 * @since S60 v5.0 |
|
79 * @param aEvent - The pointer event details. |
|
80 */ |
|
81 void PointerEvent( const TPointerEvent& aEvent ); |
|
82 |
|
83 /** |
|
84 * From CClickMaker. |
|
85 * This function is a "future expansion" or the original click maker API, |
|
86 * and it has been taken into use by this plugin for getting more |
|
87 * information about the pointer event than what is possible to pass as |
|
88 * parameter to PointerEvent -function. |
|
89 * |
|
90 * This stub ignores all events. |
|
91 * |
|
92 * @since S60 v5.0 |
|
93 * @param aType - The type of the event. |
|
94 * @param aParam - Pointer to data package containing the pointer event, |
|
95 * window identifier where pointer event hit, and window |
|
96 * group identifier of the window group where the window |
|
97 * belongs to. |
|
98 */ |
|
99 void OtherEvent( TInt aType, TAny* aParam=NULL ); |
|
100 |
|
101 /** |
|
102 * From CClickMaker. |
|
103 * Implemented to enable this plug-in to communicate with the window |
|
104 * server client. |
|
105 * |
|
106 * Area registry management communication (such as creating or closing |
|
107 * an application) is communicated through this function. |
|
108 * |
|
109 * In practice communication is done between this plug-in, and |
|
110 * Tactile Feedback Client API implementation. |
|
111 * |
|
112 * This plugin completes connect requests with KErrNotSupported, and all |
|
113 * other requests with KErrNone without actually doing any actions. |
|
114 * |
|
115 * @since S60 v5.0 |
|
116 * @param aOpcode - Opcode of the command sent by Client API |
|
117 * @param aArgs - Pointer to the data sent by client. |
|
118 */ |
|
119 TInt CommandReplyL( TInt aOpcode, TAny* aArgs ); |
|
120 |
|
121 |
|
122 // from base class MTactileFeedbackServer |
|
123 |
|
124 /** |
|
125 * From MTactileFeedbackServer. |
|
126 * Direct feedback service for Anim Dll plugins. |
|
127 * |
|
128 * This stub ignores all instant feedback requests. |
|
129 * |
|
130 * @since S60 v5.0 |
|
131 * @param aType - Logical feedback type to play. |
|
132 */ |
|
133 void InstantFeedback( TTouchLogicalFeedback aType ); |
|
134 |
|
135 private: |
|
136 |
|
137 CTactileClickPlugin(); |
|
138 |
|
139 void ConstructL(); |
|
140 |
|
141 /** |
|
142 * Handles data parsing when new client connects to this plugin. |
|
143 * |
|
144 * No real functionality in this stub. |
|
145 * |
|
146 * @param aArgs - Pointer to the data sent by client. |
|
147 * @return Always KErrNotSupported in this stub. |
|
148 */ |
|
149 TInt HandleConnectL( TAny* aArgs ); |
|
150 |
|
151 /** |
|
152 * Handles data parsing when new client connects to this plugin. |
|
153 * |
|
154 * No real functionality in this stub. |
|
155 * |
|
156 * @param aArgs - Pointer to the data sent by client. |
|
157 */ |
|
158 void HandleDisconnectL( TAny* aArgs ); |
|
159 |
|
160 /** |
|
161 * Handles direct feedback request from Tactile Client API. |
|
162 * |
|
163 * No real functionality in this stub. |
|
164 * |
|
165 * @param aArgs - Pointer to the data sent by client. |
|
166 * @return KErrNone if operation succeeded, otherwise one of standand |
|
167 * Symbian OS error codes. |
|
168 */ |
|
169 TInt HandleImmediateFeedbackL( TAny* aArgs ); |
|
170 }; |
|
171 |
|
172 |
|
173 #endif // C_TACTILECLICKPLUGIN_H |