Bug 359675 - provide an option to manually fill forms and log in. p=poshannessy@mozil...
[wine-gecko.git] / content / events / src / nsDOMEvent.h
blobb5b60cc1d569455d73e9df8903fd0880fadf75e5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsDOMEvent_h__
39 #define nsDOMEvent_h__
41 #include "nsIDOMEvent.h"
42 #include "nsIDOMNSEvent.h"
43 #include "nsISupports.h"
44 #include "nsIPrivateDOMEvent.h"
45 #include "nsCOMPtr.h"
46 #include "nsIDOMEventTarget.h"
47 #include "nsPIDOMWindow.h"
48 #include "nsPresContext.h"
49 #include "nsPoint.h"
50 #include "nsGUIEvent.h"
51 #include "nsCycleCollectionParticipant.h"
53 class nsIContent;
54 class nsIScrollableView;
56 class nsDOMEvent : public nsIDOMEvent,
57 public nsIDOMNSEvent,
58 public nsIPrivateDOMEvent
60 public:
62 // Note: this enum must be kept in sync with mEventNames in nsDOMEvent.cpp
63 enum nsDOMEvents {
64 eDOMEvents_mousedown=0,
65 eDOMEvents_mouseup,
66 eDOMEvents_click,
67 eDOMEvents_dblclick,
68 eDOMEvents_mouseover,
69 eDOMEvents_mouseout,
70 eDOMEvents_mousemove,
71 eDOMEvents_contextmenu,
72 eDOMEvents_keydown,
73 eDOMEvents_keyup,
74 eDOMEvents_keypress,
75 eDOMEvents_focus,
76 eDOMEvents_blur,
77 eDOMEvents_load,
78 eDOMEvents_beforeunload,
79 eDOMEvents_unload,
80 eDOMEvents_abort,
81 eDOMEvents_error,
82 eDOMEvents_submit,
83 eDOMEvents_reset,
84 eDOMEvents_change,
85 eDOMEvents_select,
86 eDOMEvents_input,
87 eDOMEvents_paint,
88 eDOMEvents_text,
89 eDOMEvents_compositionstart,
90 eDOMEvents_compositionend,
91 eDOMEvents_popupShowing,
92 eDOMEvents_popupShown,
93 eDOMEvents_popupHiding,
94 eDOMEvents_popupHidden,
95 eDOMEvents_close,
96 eDOMEvents_command,
97 eDOMEvents_broadcast,
98 eDOMEvents_commandupdate,
99 eDOMEvents_dragenter,
100 eDOMEvents_dragover,
101 eDOMEvents_dragexit,
102 eDOMEvents_dragdrop,
103 eDOMEvents_draggesture,
104 eDOMEvents_drag,
105 eDOMEvents_dragend,
106 eDOMEvents_resize,
107 eDOMEvents_scroll,
108 eDOMEvents_overflow,
109 eDOMEvents_underflow,
110 eDOMEvents_overflowchanged,
111 eDOMEvents_subtreemodified,
112 eDOMEvents_nodeinserted,
113 eDOMEvents_noderemoved,
114 eDOMEvents_noderemovedfromdocument,
115 eDOMEvents_nodeinsertedintodocument,
116 eDOMEvents_attrmodified,
117 eDOMEvents_characterdatamodified,
118 eDOMEvents_DOMActivate,
119 eDOMEvents_DOMFocusIn,
120 eDOMEvents_DOMFocusOut,
121 eDOMEvents_pageshow,
122 eDOMEvents_pagehide,
123 eDOMEvents_DOMMouseScroll,
124 eDOMEvents_offline,
125 eDOMEvents_online,
126 eDOMEvents_copy,
127 eDOMEvents_cut,
128 eDOMEvents_paste
129 #ifdef MOZ_SVG
131 eDOMEvents_SVGLoad,
132 eDOMEvents_SVGUnload,
133 eDOMEvents_SVGAbort,
134 eDOMEvents_SVGError,
135 eDOMEvents_SVGResize,
136 eDOMEvents_SVGScroll,
137 eDOMEvents_SVGZoom
138 #endif // MOZ_SVG
141 nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent);
142 virtual ~nsDOMEvent();
144 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
145 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMEvent, nsIDOMEvent)
147 // nsIDOMEvent Interface
148 NS_DECL_NSIDOMEVENT
150 // nsIDOMNSEvent Interface
151 NS_DECL_NSIDOMNSEVENT
153 // nsIPrivateDOMEvent interface
154 NS_IMETHOD DuplicatePrivateData();
155 NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget);
156 NS_IMETHOD SetCurrentTarget(nsIDOMEventTarget* aCurrentTarget);
157 NS_IMETHOD SetOriginalTarget(nsIDOMEventTarget* aOriginalTarget);
158 NS_IMETHOD IsDispatchStopped(PRBool* aIsDispatchStopped);
159 NS_IMETHOD GetInternalNSEvent(nsEvent** aNSEvent);
160 NS_IMETHOD HasOriginalTarget(PRBool* aResult);
161 NS_IMETHOD SetTrusted(PRBool aTrusted);
163 static PopupControlState GetEventPopupControlState(nsEvent *aEvent);
165 static void PopupAllowedEventsChanged();
167 static void Shutdown();
169 protected:
171 // Internal helper functions
172 nsresult SetEventType(const nsAString& aEventTypeArg);
173 static const char* GetEventName(PRUint32 aEventType);
174 already_AddRefed<nsIDOMEventTarget> GetTargetFromFrame();
176 nsEvent* mEvent;
177 nsCOMPtr<nsPresContext> mPresContext;
178 nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget;
179 nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
180 PRPackedBool mEventIsInternal;
181 PRPackedBool mPrivateDataDuplicated;
184 #define NS_FORWARD_TO_NSDOMEVENT \
185 NS_FORWARD_NSIDOMEVENT(nsDOMEvent::)
187 #endif // nsDOMEvent_h__