1 | using System;
|
---|
2 |
|
---|
3 | using SharpVectors.Dom.Views;
|
---|
4 |
|
---|
5 | namespace SharpVectors.Dom.Events
|
---|
6 | {
|
---|
7 | /// <summary>
|
---|
8 | /// The <see cref="IKeyboardEvent">IKeyboardEvent</see> interface provides
|
---|
9 | /// specific contextual information associated with keyboard devices.
|
---|
10 | /// </summary>
|
---|
11 | /// <remarks>
|
---|
12 | /// <para>
|
---|
13 | /// Each keyboard event reference a key using an identifier.
|
---|
14 | /// </para>
|
---|
15 | /// <para>
|
---|
16 | /// Each modifier attribute
|
---|
17 | /// (<see cref="CtrlKey">CtrlKey</see>,
|
---|
18 | /// <see cref="ShiftKey">ShiftKey</see>,
|
---|
19 | /// <see cref="AltKey">AltKey</see>,
|
---|
20 | /// <see cref="MetaKey">MetaKey</see>,
|
---|
21 | /// and <see cref="AltGraphKey">AltGraphKey</see>) is activated when the
|
---|
22 | /// key modifier is being pressed down or maintained pressed, i.e. the
|
---|
23 | /// modifier attribute is not in use when the key modifier is being
|
---|
24 | /// released.
|
---|
25 | /// </para>
|
---|
26 | /// <para>
|
---|
27 | /// Note: To create an instance of the
|
---|
28 | /// <see cref="IKeyboardEvent">IKeyboardEvent</see> interface, use the
|
---|
29 | /// feature string <c>"KeyboardEvent"</c> as the value of the input
|
---|
30 | /// parameter used with the
|
---|
31 | /// <see cref="IDocumentEvent.CreateEvent">IDocumentEvent.CreateEvent</see>
|
---|
32 | /// method.
|
---|
33 | /// </para>
|
---|
34 | /// </remarks>
|
---|
35 | public interface IKeyboardEvent
|
---|
36 | : IUiEvent
|
---|
37 | {
|
---|
38 | /// <summary>
|
---|
39 | /// Holds the identifier of the key.
|
---|
40 | /// </summary>
|
---|
41 | /// <remarks>
|
---|
42 | /// <para>
|
---|
43 | /// For a list of possible values, refer to
|
---|
44 | /// <see href="http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/keyset.html#KeySet">Key identifiers for keyboard events</see>.
|
---|
45 | /// </para>
|
---|
46 | /// <para>
|
---|
47 | /// Note: Implementations that are unable to identify a key must use the key identifier "Unidentified".
|
---|
48 | /// </para>
|
---|
49 | /// </remarks>
|
---|
50 | string KeyIdentifier
|
---|
51 | {
|
---|
52 | get;
|
---|
53 | }
|
---|
54 |
|
---|
55 | /// <summary>
|
---|
56 | /// Contains an indication of the location of they key on the device.
|
---|
57 | /// </summary>
|
---|
58 | KeyLocationCode KeyLocation
|
---|
59 | {
|
---|
60 | get;
|
---|
61 | }
|
---|
62 |
|
---|
63 | /// <summary>
|
---|
64 | /// <c>true</c> if the control (Ctrl) key modifier is activated.
|
---|
65 | /// </summary>
|
---|
66 | bool CtrlKey
|
---|
67 | {
|
---|
68 | get;
|
---|
69 | }
|
---|
70 |
|
---|
71 | /// <summary>
|
---|
72 | /// <c>true</c> if the shift (Shift) key modifier is activated.
|
---|
73 | /// </summary>
|
---|
74 | bool ShiftKey
|
---|
75 | {
|
---|
76 | get;
|
---|
77 | }
|
---|
78 |
|
---|
79 | /// <summary>
|
---|
80 | /// <c>true</c> if the alt (alternative) key modifier is activated.
|
---|
81 | /// </summary>
|
---|
82 | bool AltKey
|
---|
83 | {
|
---|
84 | get;
|
---|
85 | }
|
---|
86 |
|
---|
87 | /// <summary>
|
---|
88 | /// <c>true</c> if the meta (Meta) key modifier is activated.
|
---|
89 | /// </summary>
|
---|
90 | /// <remarks>
|
---|
91 | /// Note: The Command key modifier on Macintosh system must be
|
---|
92 | /// represented using this key modifier.
|
---|
93 | /// </remarks>
|
---|
94 | bool MetaKey
|
---|
95 | {
|
---|
96 | get;
|
---|
97 | }
|
---|
98 |
|
---|
99 | /// <summary>
|
---|
100 | /// true if the alt-graph (Alt Gr) key modifier is activated.
|
---|
101 | /// </summary>
|
---|
102 | /// <remarks>
|
---|
103 | /// Note: Some operating systems simulate the alt-graph key modifier
|
---|
104 | /// with the combinaison of alt and ctrl key modifiers.
|
---|
105 | /// Implementations are encouraged to use this modifier instead.
|
---|
106 | /// </remarks>
|
---|
107 | bool AltGraphKey
|
---|
108 | {
|
---|
109 | get;
|
---|
110 | }
|
---|
111 |
|
---|
112 | /// <summary>
|
---|
113 | /// The <see cref="InitKeyboardEvent">InitKeyboardEvent</see> method
|
---|
114 | /// is used to initialize the value of a
|
---|
115 | /// <see cref="IKeyboardEvent">IKeyboardEvent</see> created using the
|
---|
116 | /// <see cref="IDocumentEvent.CreateEvent">IDocumentEvent.CreateEvent</see>
|
---|
117 | /// method.
|
---|
118 | /// </summary>
|
---|
119 | /// <remarks>
|
---|
120 | /// This method may only be called before the
|
---|
121 | /// <see cref="IKeyboardEvent">IKeyboardEvent</see> has been
|
---|
122 | /// dispatched via the
|
---|
123 | /// <see cref="IEventTarget.DispatchEvent">IEventTarget.DispatchEvent</see>
|
---|
124 | /// method, though it may be called multiple times before being
|
---|
125 | /// dispatched if necessary. If called multiple times, the final
|
---|
126 | /// invocation takes precedence. This method has no effect if called
|
---|
127 | /// after the event has been dispatched.
|
---|
128 | /// </remarks>
|
---|
129 | /// <param name="typeArg">
|
---|
130 | /// Specifies the event type.
|
---|
131 | /// </param>
|
---|
132 | /// <param name="canBubbleArg">
|
---|
133 | /// Specifies whether or not the event can bubble. This parameter
|
---|
134 | /// overrides the intrinsic bubbling behavior of the event.
|
---|
135 | /// </param>
|
---|
136 | /// <param name="cancelableArg">
|
---|
137 | /// Specifies whether or not the event's default action can be
|
---|
138 | /// prevent. This parameter overrides the intrinsic cancelable
|
---|
139 | /// behavior of the event.
|
---|
140 | /// </param>
|
---|
141 | /// <param name="viewArg">
|
---|
142 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
143 | /// <see cref="IAbstractView">IAbstractView</see>.
|
---|
144 | /// </param>
|
---|
145 | /// <param name="keyIdentifierArg">
|
---|
146 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
147 | /// <see cref="KeyIdentifier">KeyIdentifier</see> attribute.
|
---|
148 | /// </param>
|
---|
149 | /// <param name="keyLocationArg">
|
---|
150 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
151 | /// <see cref="KeyLocation">KeyLocation</see> attribute.
|
---|
152 | /// </param>
|
---|
153 | /// <param name="ctrlKeyArg">
|
---|
154 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
155 | /// <see cref="CtrlKey">CtrlKey</see> attribute.
|
---|
156 | /// </param>
|
---|
157 | /// <param name="shiftKeyArg">
|
---|
158 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
159 | /// <see cref="ShiftKey">ShiftKey</see> attribute.
|
---|
160 | /// </param>
|
---|
161 | /// <param name="altKeyArg">
|
---|
162 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
163 | /// <see cref="AltKey">AltKey</see> attribute.
|
---|
164 | /// </param>
|
---|
165 | /// <param name="metaKeyArg">
|
---|
166 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
167 | /// <see cref="MetaKey">MetaKey</see> attribute.
|
---|
168 | /// </param>
|
---|
169 | /// <param name="altGraphKeyArg">
|
---|
170 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
171 | /// <see cref="AltGraphKey">AltGraphKey</see> attribute.
|
---|
172 | /// </param>
|
---|
173 | void InitKeyboardEvent(
|
---|
174 | string typeArg,
|
---|
175 | bool canBubbleArg,
|
---|
176 | bool cancelableArg,
|
---|
177 | IAbstractView viewArg,
|
---|
178 | string keyIdentifierArg,
|
---|
179 | KeyLocationCode keyLocationArg,
|
---|
180 | bool ctrlKeyArg,
|
---|
181 | bool shiftKeyArg,
|
---|
182 | bool altKeyArg,
|
---|
183 | bool metaKeyArg,
|
---|
184 | bool altGraphKeyArg);
|
---|
185 |
|
---|
186 | /// <summary>
|
---|
187 | /// The <see cref="InitKeyboardEventNs">InitKeyboardEventNs</see>
|
---|
188 | /// method is used to initialize the value of a
|
---|
189 | /// <see cref="IKeyboardEvent">IKeyboardEvent</see> created using the
|
---|
190 | /// <see cref="IDocumentEvent.CreateEvent">IDocumentEvent.CreateEvent</see>
|
---|
191 | /// method.
|
---|
192 | /// </summary>
|
---|
193 | /// <remarks>
|
---|
194 | /// This method may only be called before the
|
---|
195 | /// <see cref="IKeyboardEvent">IKeyboardEvent</see> has been
|
---|
196 | /// dispatched via the
|
---|
197 | /// <see cref="IEventTarget.DispatchEvent">IEventTarget.DispatchEvent</see>
|
---|
198 | /// method, though it may be called multiple times during that phase
|
---|
199 | /// if necessary. If called multiple times, the final invocation
|
---|
200 | /// takes precedence. This method has no effect if called after the
|
---|
201 | /// event has been dispatched.
|
---|
202 | /// </remarks>
|
---|
203 | /// <param name="namespaceUri">
|
---|
204 | /// Specifies the
|
---|
205 | /// <see href="http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/glossary.html#dt-namespaceURI">namespace URI</see>
|
---|
206 | /// associated with this event, or null if the applications wish to
|
---|
207 | /// have no namespace.
|
---|
208 | /// </param>
|
---|
209 | /// <param name="type">
|
---|
210 | /// Specifies the event type.
|
---|
211 | /// </param>
|
---|
212 | /// <param name="canBubbleArg">
|
---|
213 | /// Specifies whether or not the event can bubble.
|
---|
214 | /// </param>
|
---|
215 | /// <param name="cancelableArg">
|
---|
216 | /// Specifies whether or not the event's default action can be
|
---|
217 | /// prevent.
|
---|
218 | /// </param>
|
---|
219 | /// <param name="viewArg">
|
---|
220 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
221 | /// <see cref="IAbstractView">IAbstractView</see>.
|
---|
222 | /// </param>
|
---|
223 | /// <param name="keyIdentifierArg">
|
---|
224 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
225 | /// <see cref="KeyIdentifier">KeyIdentifier</see> attribute.
|
---|
226 | /// </param>
|
---|
227 | /// <param name="keyLocationArg">
|
---|
228 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
229 | /// <see cref="KeyLocation">KeyLocation</see> attribute.
|
---|
230 | /// </param>
|
---|
231 | /// <param name="ctrlKeyArg">
|
---|
232 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
233 | /// <see cref="CtrlKey">CtrlKey</see> attribute.
|
---|
234 | /// </param>
|
---|
235 | /// <param name="shiftKeyArg">
|
---|
236 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
237 | /// <see cref="ShiftKey">ShiftKey</see> attribute.
|
---|
238 | /// </param>
|
---|
239 | /// <param name="altKeyArg">
|
---|
240 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
241 | /// <see cref="AltKey">AltKey</see> attribute.
|
---|
242 | /// </param>
|
---|
243 | /// <param name="metaKeyArg">
|
---|
244 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
245 | /// <see cref="MetaKey">MetaKey</see> attribute.
|
---|
246 | /// </param>
|
---|
247 | /// <param name="altGraphKeyArg">
|
---|
248 | /// Specifies the <see cref="IKeyboardEvent">IKeyboardEvent</see>'s
|
---|
249 | /// <see cref="AltGraphKey">AltGraphKey</see> attribute.
|
---|
250 | /// </param>
|
---|
251 | void InitKeyboardEventNs(
|
---|
252 | string namespaceUri,
|
---|
253 | string type,
|
---|
254 | bool canBubbleArg,
|
---|
255 | bool cancelableArg,
|
---|
256 | IAbstractView viewArg,
|
---|
257 | string keyIdentifierArg,
|
---|
258 | KeyLocationCode keyLocationArg,
|
---|
259 | bool ctrlKeyArg,
|
---|
260 | bool shiftKeyArg,
|
---|
261 | bool altKeyArg,
|
---|
262 | bool metaKeyArg,
|
---|
263 | bool altGraphKeyArg);
|
---|
264 | }
|
---|
265 | }
|
---|