1 // Permission is hereby granted, free of charge, to any person obtaining
\r
2 // a copy of this software and associated documentation files (the
\r
3 // "Software"), to deal in the Software without restriction, including
\r
4 // without limitation the rights to use, copy, modify, merge, publish,
\r
5 // distribute, sublicense, and/or sell copies of the Software, and to
\r
6 // permit persons to whom the Software is furnished to do so, subject to
\r
7 // the following conditions:
\r
9 // The above copyright notice and this permission notice shall be
\r
10 // included in all copies or substantial portions of the Software.
\r
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
20 // Copyright (c) 2007 Novell, Inc.
\r
23 // Andreia Gaita avidigal@novell.com
\r
26 using System.Drawing;
\r
27 using System.ComponentModel;
\r
28 namespace System.Windows.Forms
\r
30 public sealed class HtmlElementEventArgs : EventArgs
\r
33 private bool alt_key_pressed;
\r
34 private bool bubble_event;
\r
35 private Point client_mouse_position;
\r
36 private bool ctrl_key_pressed;
\r
37 private string event_type;
\r
38 private HtmlElement from_element;
\r
39 private int key_pressed_code;
\r
40 private MouseButtons mouse_buttons_pressed;
\r
41 private Point mouse_position;
\r
42 private Point offset_mouse_position;
\r
43 private bool return_value;
\r
44 private bool shift_key_pressed;
\r
45 private HtmlElement to_element;
\r
49 internal HtmlElementEventArgs ()
\r
51 alt_key_pressed = false;
\r
52 bubble_event = false;
\r
53 client_mouse_position = Point.Empty;
\r
54 ctrl_key_pressed = false;;
\r
56 from_element = null;
\r
57 key_pressed_code = 0;
\r
58 mouse_buttons_pressed = MouseButtons.None;
\r
59 mouse_position = Point.Empty;
\r
60 offset_mouse_position = Point.Empty;
\r
61 return_value = false;
\r
62 shift_key_pressed = false;
\r
67 #region Public Properties
\r
68 public bool AltKeyPressed {
\r
69 get { return alt_key_pressed; }
\r
72 public bool BubbleEvent {
\r
73 get { return bubble_event; }
\r
74 set { bubble_event = value; }
\r
77 public Point ClientMousePosition {
\r
78 get { return client_mouse_position; }
\r
81 public bool CtrlKeyPressed {
\r
82 get { return ctrl_key_pressed; }
\r
85 public string EventType {
\r
86 get { return event_type; }
\r
90 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
91 public HtmlElement FromElement {
\r
92 get { return from_element; }
\r
95 public int KeyPressedCode {
\r
96 get { return key_pressed_code; }
\r
99 public MouseButtons MouseButtonsPressed {
\r
100 get { return mouse_buttons_pressed; }
\r
103 public Point MousePosition {
\r
104 get { return mouse_position; }
\r
107 public Point OffsetMousePosition {
\r
108 get { return offset_mouse_position; }
\r
111 public bool ReturnValue {
\r
112 get { return return_value; }
\r
113 set { return_value = value; }
\r
116 public bool ShiftKeyPressed {
\r
117 get { return shift_key_pressed; }
\r
120 [Browsable (false)]
\r
121 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
122 public HtmlElement ToElement {
\r
123 get { return to_element; }
\r