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
27 using System.Drawing;
\r
28 using System.ComponentModel;
\r
29 namespace System.Windows.Forms
\r
31 public sealed class HtmlElementEventArgs : EventArgs
\r
34 private bool alt_key_pressed;
\r
35 private bool bubble_event;
\r
36 private Point client_mouse_position;
\r
37 private bool ctrl_key_pressed;
\r
38 private string event_type;
\r
39 private HtmlElement from_element;
\r
40 private int key_pressed_code;
\r
41 private MouseButtons mouse_buttons_pressed;
\r
42 private Point mouse_position;
\r
43 private Point offset_mouse_position;
\r
44 private bool return_value;
\r
45 private bool shift_key_pressed;
\r
46 private HtmlElement to_element;
\r
50 internal HtmlElementEventArgs ()
\r
52 alt_key_pressed = false;
\r
53 bubble_event = false;
\r
54 client_mouse_position = Point.Empty;
\r
55 ctrl_key_pressed = false;;
\r
57 from_element = null;
\r
58 key_pressed_code = 0;
\r
59 mouse_buttons_pressed = MouseButtons.None;
\r
60 mouse_position = Point.Empty;
\r
61 offset_mouse_position = Point.Empty;
\r
62 return_value = false;
\r
63 shift_key_pressed = false;
\r
68 #region Public Properties
\r
69 public bool AltKeyPressed {
\r
70 get { return alt_key_pressed; }
\r
73 public bool BubbleEvent {
\r
74 get { return bubble_event; }
\r
75 set { bubble_event = value; }
\r
78 public Point ClientMousePosition {
\r
79 get { return client_mouse_position; }
\r
82 public bool CtrlKeyPressed {
\r
83 get { return ctrl_key_pressed; }
\r
86 public string EventType {
\r
87 get { return event_type; }
\r
91 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
92 public HtmlElement FromElement {
\r
93 get { return from_element; }
\r
96 public int KeyPressedCode {
\r
97 get { return key_pressed_code; }
\r
100 public MouseButtons MouseButtonsPressed {
\r
101 get { return mouse_buttons_pressed; }
\r
104 public Point MousePosition {
\r
105 get { return mouse_position; }
\r
108 public Point OffsetMousePosition {
\r
109 get { return offset_mouse_position; }
\r
112 public bool ReturnValue {
\r
113 get { return return_value; }
\r
114 set { return_value = value; }
\r
117 public bool ShiftKeyPressed {
\r
118 get { return shift_key_pressed; }
\r
121 [Browsable (false)]
\r
122 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
123 public HtmlElement ToElement {
\r
124 get { return to_element; }
\r