Back to index

lightning-sunbird  0.9+nobinonly
nsGUIEvent.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Makoto Kato  <m_kato@ga2.so-net.ne.jp>
00024  *   Dean Tessman <dean_tessman@hotmail.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef nsGUIEvent_h__
00041 #define nsGUIEvent_h__
00042 
00043 #include "nsPoint.h"
00044 #include "nsRect.h"
00045 #include "nsEvent.h"
00046 #include "nsHashtable.h"
00047 #include "nsString.h"
00048 
00049 // nsIDOMEvent contains a long enum which includes a member called ERROR,
00050 // which conflicts with something that Windows defines somewhere.
00051 // So, undefine it:
00052 #ifdef WIN32
00053 #undef ERROR
00054 #endif
00055 #include "nsCOMPtr.h"
00056 #include "nsIDOMKeyEvent.h"
00057 #include "nsWeakPtr.h"
00058 
00059 class nsIRenderingContext;
00060 class nsIRegion;
00061 class nsIWidget;
00062 class nsIMenuItem;
00063 class nsIAccessible;
00064 class nsIContent;
00065 class nsIURI;
00066 class nsIDOMEvent;
00067            
00071 #define NS_EVENT                           1
00072 #define NS_GUI_EVENT                       2
00073 #define NS_SIZE_EVENT                      3
00074 #define NS_SIZEMODE_EVENT                  4
00075 #define NS_ZLEVEL_EVENT                    5
00076 #define NS_PAINT_EVENT                     6
00077 #define NS_SCROLLBAR_EVENT                 7
00078 #define NS_INPUT_EVENT                     8
00079 #define NS_KEY_EVENT                       9
00080 #define NS_MOUSE_EVENT                    10
00081 #define NS_MENU_EVENT                     11
00082 #define NS_SCRIPT_ERROR_EVENT             12
00083 #define NS_TEXT_EVENT                     13
00084 #define NS_COMPOSITION_EVENT              14
00085 #define NS_RECONVERSION_EVENT             15
00086 #define NS_MOUSE_SCROLL_EVENT             16
00087 #define NS_SCROLLPORT_EVENT               18
00088 #define NS_MUTATION_EVENT                 19 // |nsMutationEvent| in content
00089 #define NS_ACCESSIBLE_EVENT               20
00090 #define NS_FORM_EVENT                     21
00091 #define NS_FOCUS_EVENT                    22
00092 #define NS_POPUP_EVENT                    23
00093 #define NS_APPCOMMAND_EVENT               24
00094 #define NS_POPUPBLOCKED_EVENT             25
00095 #define NS_BEFORE_PAGE_UNLOAD_EVENT       26
00096 #define NS_UI_EVENT                       27
00097 #define NS_QUERYCARETRECT_EVENT           28
00098 #define NS_PAGETRANSITION_EVENT               29
00099 #ifdef MOZ_SVG
00100 #define NS_SVG_EVENT                      30
00101 #define NS_SVGZOOM_EVENT                  31
00102 #endif // MOZ_SVG
00103 #define NS_XUL_COMMAND_EVENT              32
00104 
00105 // These flags are sort of a mess. They're sort of shared between event
00106 // listener flags and event flags, but only some of them. You've been
00107 // warned!
00108 #define NS_EVENT_FLAG_NONE                0x0000
00109 #define NS_EVENT_FLAG_INIT                0x0001
00110 #define NS_EVENT_FLAG_BUBBLE              0x0002
00111 #define NS_EVENT_FLAG_CAPTURE             0x0004
00112 #define NS_EVENT_FLAG_STOP_DISPATCH       0x0008
00113 #define NS_EVENT_FLAG_NO_DEFAULT          0x0010
00114 #define NS_EVENT_FLAG_CANT_CANCEL         0x0020
00115 #define NS_EVENT_FLAG_CANT_BUBBLE         0x0040
00116 #define NS_PRIV_EVENT_FLAG_SCRIPT         0x0080
00117 #define NS_EVENT_FLAG_NO_CONTENT_DISPATCH 0x0100
00118 #define NS_EVENT_FLAG_SYSTEM_EVENT        0x0200
00119 #define NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY 0x0400 // @see nsIDOM3Event::stopImmediatePropagation()
00120 #define NS_EVENT_FLAG_DISPATCHING         0x0800
00121 
00122 #define NS_PRIV_EVENT_UNTRUSTED_PERMITTED 0x8000
00123 
00124 #define NS_EVENT_CAPTURE_MASK             (~(NS_EVENT_FLAG_INIT | NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
00125 #define NS_EVENT_BUBBLE_MASK              (~(NS_EVENT_FLAG_INIT | NS_EVENT_FLAG_CAPTURE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
00126 
00127 // Flags for internalAppFlags
00128 
00129 #define NS_APP_EVENT_FLAG_NONE      0x00000000
00130 
00131 // Similar to NS_EVENT_FLAG_NO_DEFAULT, but it allows focus
00132 #define NS_APP_EVENT_FLAG_HANDLED   0x00000001
00133 
00134 // True if the event came from a trusted source
00135 #define NS_APP_EVENT_FLAG_TRUSTED   0x00000002
00136 
00137 #define NS_EVENT_TYPE_NULL                   0
00138 
00143 #define NS_EVENT_NULL                   0
00144 
00145 
00146 #define NS_WINDOW_START                 100
00147 
00148 // Widget is being created
00149 #define NS_CREATE                       (NS_WINDOW_START)
00150 // Widget may be destroyed
00151 #define NS_XUL_CLOSE                    (NS_WINDOW_START + 1)
00152 // Widget is being destroyed
00153 #define NS_DESTROY                      (NS_WINDOW_START + 2)
00154 // Widget was resized
00155 #define NS_SIZE                         (NS_WINDOW_START + 3)
00156 // Widget size mode was changed
00157 #define NS_SIZEMODE                     (NS_WINDOW_START + 4)
00158 // Widget gained focus
00159 #define NS_GOTFOCUS                     (NS_WINDOW_START + 5)
00160 // Widget lost focus
00161 #define NS_LOSTFOCUS                    (NS_WINDOW_START + 6)
00162 // Widget got activated
00163 #define NS_ACTIVATE                     (NS_WINDOW_START + 7)
00164 // Widget got deactivated
00165 #define NS_DEACTIVATE                   (NS_WINDOW_START + 8)
00166 // top-level window z-level change request
00167 #define NS_SETZLEVEL                    (NS_WINDOW_START + 9)
00168 // Widget needs to be repainted
00169 #define NS_PAINT                        (NS_WINDOW_START + 30)
00170 // Key is pressed within a window
00171 #define NS_KEY_PRESS                    (NS_WINDOW_START + 31)
00172 // Key is released within a window
00173 #define NS_KEY_UP                       (NS_WINDOW_START + 32)
00174 // Key is pressed within a window
00175 #define NS_KEY_DOWN                     (NS_WINDOW_START + 33)
00176 // Window has been moved to a new location.
00177 // The events point contains the x, y location in screen coordinates
00178 #define NS_MOVE                         (NS_WINDOW_START + 34) 
00179 
00180 // Tab control's selected tab has changed
00181 #define NS_TABCHANGE                    (NS_WINDOW_START + 35)
00182 
00183 #define NS_OS_TOOLBAR                   (NS_WINDOW_START + 36)
00184 
00185 // Menu item selected
00186 #define NS_MENU_SELECTED                (NS_WINDOW_START + 38)
00187 
00188 // Form control changed: currently == combo box selection changed
00189 // but could be expanded to mean textbox, checkbox changed, etc.
00190 // This is a GUI specific event that does not necessarily correspond
00191 // directly to a mouse click or a key press.
00192 #define NS_CONTROL_CHANGE                (NS_WINDOW_START + 39)
00193 
00194 // Indicates the display has changed depth
00195 #define NS_DISPLAYCHANGED                (NS_WINDOW_START + 40)
00196 
00197 // Indicates a theme change has occurred
00198 #define NS_THEMECHANGED                 (NS_WINDOW_START + 41)
00199 
00200 // Indicates a System color has changed. It is the platform
00201 // toolkits responsibility to invalidate the window to 
00202 // ensure that it is drawn using the current system colors.
00203 #define NS_SYSCOLORCHANGED              (NS_WINDOW_START + 42)
00204 
00205 // Indicates a script error has occurred
00206 #define NS_SCRIPT_ERROR                 (NS_WINDOW_START + 50)
00207 
00208 #define NS_RESIZE_EVENT                 (NS_WINDOW_START + 60)
00209 #define NS_SCROLL_EVENT                 (NS_WINDOW_START + 61)
00210 
00211 #define NS_PLUGIN_ACTIVATE               (NS_WINDOW_START + 62)
00212 
00213 #define NS_MOUSE_MESSAGE_START          300
00214 #define NS_MOUSE_MOVE                   (NS_MOUSE_MESSAGE_START)
00215 #define NS_MOUSE_LEFT_BUTTON_UP         (NS_MOUSE_MESSAGE_START + 1)
00216 #define NS_MOUSE_LEFT_BUTTON_DOWN       (NS_MOUSE_MESSAGE_START + 2)
00217 #define NS_MOUSE_MIDDLE_BUTTON_UP       (NS_MOUSE_MESSAGE_START + 10)
00218 #define NS_MOUSE_MIDDLE_BUTTON_DOWN     (NS_MOUSE_MESSAGE_START + 11)
00219 #define NS_MOUSE_RIGHT_BUTTON_UP        (NS_MOUSE_MESSAGE_START + 20)
00220 #define NS_MOUSE_RIGHT_BUTTON_DOWN      (NS_MOUSE_MESSAGE_START + 21)
00221 #define NS_MOUSE_ENTER                  (NS_MOUSE_MESSAGE_START + 22)
00222 #define NS_MOUSE_EXIT                   (NS_MOUSE_MESSAGE_START + 23)
00223 #define NS_MOUSE_LEFT_DOUBLECLICK       (NS_MOUSE_MESSAGE_START + 24)
00224 #define NS_MOUSE_MIDDLE_DOUBLECLICK     (NS_MOUSE_MESSAGE_START + 25)
00225 #define NS_MOUSE_RIGHT_DOUBLECLICK      (NS_MOUSE_MESSAGE_START + 26)
00226 #define NS_MOUSE_LEFT_CLICK             (NS_MOUSE_MESSAGE_START + 27)
00227 #define NS_MOUSE_MIDDLE_CLICK           (NS_MOUSE_MESSAGE_START + 28)
00228 #define NS_MOUSE_RIGHT_CLICK            (NS_MOUSE_MESSAGE_START + 29)
00229 #define NS_MOUSE_ACTIVATE               (NS_MOUSE_MESSAGE_START + 30)
00230 #define NS_MOUSE_ENTER_SYNTH            (NS_MOUSE_MESSAGE_START + 31)
00231 #define NS_MOUSE_EXIT_SYNTH             (NS_MOUSE_MESSAGE_START + 32)
00232 
00233 #define NS_CONTEXTMENU_MESSAGE_START    500
00234 #define NS_CONTEXTMENU                  (NS_CONTEXTMENU_MESSAGE_START)
00235 #define NS_CONTEXTMENU_KEY              (NS_CONTEXTMENU_MESSAGE_START + 1)
00236 
00237 #define NS_SCROLLBAR_MESSAGE_START      1000
00238 #define NS_SCROLLBAR_POS                (NS_SCROLLBAR_MESSAGE_START)
00239 #define NS_SCROLLBAR_PAGE_NEXT          (NS_SCROLLBAR_MESSAGE_START + 1)
00240 #define NS_SCROLLBAR_PAGE_PREV          (NS_SCROLLBAR_MESSAGE_START + 2)
00241 #define NS_SCROLLBAR_LINE_NEXT          (NS_SCROLLBAR_MESSAGE_START + 3)
00242 #define NS_SCROLLBAR_LINE_PREV          (NS_SCROLLBAR_MESSAGE_START + 4)
00243 
00244 #define NS_STREAM_EVENT_START           1100
00245 #define NS_PAGE_LOAD                    (NS_STREAM_EVENT_START)
00246 #define NS_PAGE_UNLOAD                  (NS_STREAM_EVENT_START + 1)
00247 #define NS_IMAGE_LOAD                   (NS_STREAM_EVENT_START + 2)
00248 #define NS_IMAGE_ABORT                  (NS_STREAM_EVENT_START + 3)
00249 #define NS_IMAGE_ERROR                  (NS_STREAM_EVENT_START + 4)
00250 #define NS_SCRIPT_LOAD                  (NS_STREAM_EVENT_START + 5)
00251 #define NS_BEFORE_PAGE_UNLOAD           (NS_STREAM_EVENT_START + 6)
00252 #define NS_PAGE_RESTORE                 (NS_STREAM_EVENT_START + 7)
00253  
00254 #define NS_FORM_EVENT_START             1200
00255 #define NS_FORM_SUBMIT                  (NS_FORM_EVENT_START)
00256 #define NS_FORM_RESET                   (NS_FORM_EVENT_START + 1)
00257 #define NS_FORM_CHANGE                  (NS_FORM_EVENT_START + 2)
00258 #define NS_FORM_SELECTED                (NS_FORM_EVENT_START + 3)
00259 #define NS_FORM_INPUT                   (NS_FORM_EVENT_START + 4)
00260 
00261 //Need separate focus/blur notifications for non-native widgets
00262 #define NS_FOCUS_EVENT_START            1300
00263 #define NS_FOCUS_CONTENT                (NS_FOCUS_EVENT_START)
00264 #define NS_BLUR_CONTENT                 (NS_FOCUS_EVENT_START + 1)
00265 
00266 
00267 #define NS_DRAGDROP_EVENT_START         1400
00268 #define NS_DRAGDROP_ENTER               (NS_DRAGDROP_EVENT_START)
00269 #define NS_DRAGDROP_OVER                (NS_DRAGDROP_EVENT_START + 1)
00270 #define NS_DRAGDROP_EXIT                (NS_DRAGDROP_EVENT_START + 2)
00271 #define NS_DRAGDROP_DROP                (NS_DRAGDROP_EVENT_START + 3)
00272 #define NS_DRAGDROP_GESTURE             (NS_DRAGDROP_EVENT_START + 4)
00273 #define NS_DRAGDROP_OVER_SYNTH          (NS_DRAGDROP_EVENT_START + 1)
00274 #define NS_DRAGDROP_EXIT_SYNTH          (NS_DRAGDROP_EVENT_START + 2)
00275 
00276 // Events for popups
00277 #define NS_XUL_EVENT_START            1500
00278 #define NS_XUL_POPUP_SHOWING          (NS_XUL_EVENT_START)
00279 #define NS_XUL_POPUP_SHOWN            (NS_XUL_EVENT_START+1)
00280 #define NS_XUL_POPUP_HIDING           (NS_XUL_EVENT_START+2)
00281 #define NS_XUL_POPUP_HIDDEN           (NS_XUL_EVENT_START+3)
00282 // NS_XUL_COMMAND used to be here     (NS_XUL_EVENT_START+4)
00283 #define NS_XUL_BROADCAST              (NS_XUL_EVENT_START+5)
00284 #define NS_XUL_COMMAND_UPDATE         (NS_XUL_EVENT_START+6)
00285 #define NS_XUL_CLICK                  (NS_XUL_EVENT_START+7)
00286 
00287 
00288 // Scroll events
00289 #define NS_MOUSE_SCROLL_START         1600
00290 #define NS_MOUSE_SCROLL               (NS_MOUSE_SCROLL_START)
00291 
00292 #define NS_SCROLLPORT_START           1700
00293 #define NS_SCROLLPORT_UNDERFLOW       (NS_SCROLLPORT_START)
00294 #define NS_SCROLLPORT_OVERFLOW        (NS_SCROLLPORT_START+1)
00295 #define NS_SCROLLPORT_OVERFLOWCHANGED (NS_SCROLLPORT_START+2)
00296 
00297 // Mutation events defined elsewhere starting at 1800
00298 
00299 // accessible events
00300 #define NS_ACCESSIBLE_START           1900
00301 #define NS_GETACCESSIBLE              (NS_ACCESSIBLE_START)
00302 
00303 #define NS_USER_DEFINED_EVENT         2000
00304 
00305 // custom OS events
00306 #define NS_APPCOMMAND_START           2100
00307 #define NS_APPCOMMAND                 (NS_APPCOMMAND_START)
00308 #define NS_APPCOMMAND_BACK            (NS_APPCOMMAND_START + 1)
00309 #define NS_APPCOMMAND_FORWARD         (NS_APPCOMMAND_START + 2)
00310 #define NS_APPCOMMAND_REFRESH         (NS_APPCOMMAND_START + 3)
00311 #define NS_APPCOMMAND_STOP            (NS_APPCOMMAND_START + 4)
00312 #define NS_APPCOMMAND_SEARCH          (NS_APPCOMMAND_START + 5)
00313 #define NS_APPCOMMAND_FAVORITES       (NS_APPCOMMAND_START + 6)
00314 #define NS_APPCOMMAND_HOME            (NS_APPCOMMAND_START + 7)
00315  
00316 // composition events
00317 #define NS_COMPOSITION_EVENT_START    2200
00318 #define NS_COMPOSITION_START          (NS_COMPOSITION_EVENT_START)
00319 #define NS_COMPOSITION_END            (NS_COMPOSITION_EVENT_START + 1)
00320 #define NS_COMPOSITION_QUERY          (NS_COMPOSITION_EVENT_START + 2)
00321 
00322 // reconversion events
00323 #define NS_RECONVERSION_START         2300
00324 #define NS_RECONVERSION_QUERY         (NS_RECONVERSION_START)
00325 
00326 // text events
00327 #define NS_TEXT_START                 2400
00328 #define NS_TEXT_TEXT                  (NS_TEXT_START)
00329 
00330 // UI events
00331 #define NS_UI_EVENT_START          2500
00332 // this is not to be confused with NS_ACTIVATE!
00333 #define NS_UI_ACTIVATE             (NS_UI_EVENT_START)
00334 #define NS_UI_FOCUSIN              (NS_UI_EVENT_START + 1)
00335 #define NS_UI_FOCUSOUT             (NS_UI_EVENT_START + 2)
00336 
00337 // query caret rect events
00338 #define NS_QUERYCARETRECT_START    2600
00339 #define NS_QUERYCARETRECT          (NS_QUERYCARETRECT_START)
00340 
00341 // pagetransition events
00342 #define NS_PAGETRANSITION_START    2700
00343 #define NS_PAGE_SHOW               (NS_PAGETRANSITION_START + 1)
00344 #define NS_PAGE_HIDE               (NS_PAGETRANSITION_START + 2)
00345 
00346 #ifdef MOZ_SVG
00347 // SVG events
00348 #define NS_SVG_EVENT_START              2800
00349 #define NS_SVG_LOAD                     (NS_SVG_EVENT_START)
00350 #define NS_SVG_UNLOAD                   (NS_SVG_EVENT_START + 1)
00351 #define NS_SVG_ABORT                    (NS_SVG_EVENT_START + 2)
00352 #define NS_SVG_ERROR                    (NS_SVG_EVENT_START + 3)
00353 #define NS_SVG_RESIZE                   (NS_SVG_EVENT_START + 4)
00354 #define NS_SVG_SCROLL                   (NS_SVG_EVENT_START + 5)
00355 
00356 // SVG Zoom events
00357 #define NS_SVGZOOM_EVENT_START          2900
00358 #define NS_SVG_ZOOM                     (NS_SVGZOOM_EVENT_START)
00359 #endif // MOZ_SVG
00360 
00361 // XUL command events
00362 #define NS_XULCOMMAND_EVENT_START       3000
00363 #define NS_XUL_COMMAND                  (NS_XULCOMMAND_EVENT_START)
00364 
00373 enum nsSizeMode {
00374   nsSizeMode_Normal = 0,
00375   nsSizeMode_Minimized,
00376   nsSizeMode_Maximized
00377 };
00378 
00382 enum nsWindowZ {
00383   nsWindowZTop = 0,   // on top
00384   nsWindowZBottom,    // on bottom
00385   nsWindowZRelative   // just below some specified widget
00386 };
00387 
00392 class nsEvent
00393 {
00394 protected:
00395   nsEvent(PRBool isTrusted, PRUint32 msg, PRUint8 structType)
00396     : eventStructType(structType),
00397       message(msg),
00398       point(0, 0),
00399       refPoint(0, 0),
00400       time(0),
00401       flags(0),
00402       internalAppFlags(isTrusted ? NS_APP_EVENT_FLAG_TRUSTED :
00403                        NS_APP_EVENT_FLAG_NONE),
00404       userType(0)
00405   {
00406   }
00407 
00408 public:
00409   nsEvent(PRBool isTrusted, PRUint32 msg)
00410     : eventStructType(NS_EVENT),
00411       message(msg),
00412       point(0, 0),
00413       refPoint(0, 0),
00414       time(0),
00415       flags(0),
00416       internalAppFlags(isTrusted ? NS_APP_EVENT_FLAG_TRUSTED :
00417                        NS_APP_EVENT_FLAG_NONE),
00418       userType(0)
00419   {
00420   }
00421 
00422   // See event struct types
00423   PRUint8     eventStructType;
00424   // See GUI MESSAGES,
00425   PRUint32    message;              
00426   // In widget relative coordinates, modified to be relative to
00427   // current view in layout.
00428   nsPoint     point;               
00429   // In widget relative coordinates, not modified by layout code.
00430   nsPoint     refPoint;               
00431   // Elapsed time, in milliseconds, from the time the system was
00432   // started to the time the message was created
00433   PRUint32    time;      
00434   // Flags to hold event flow stage and capture/bubble cancellation
00435   // status
00436   PRUint32    flags;
00437   // Flags for indicating more event state for Mozilla applications.
00438   PRUint32    internalAppFlags;
00439   // Additional type info for user defined events
00440   nsHashKey*  userType;
00441 };
00442 
00447 class nsGUIEvent : public nsEvent
00448 {
00449 protected:
00450   nsGUIEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 structType)
00451     : nsEvent(isTrusted, msg, structType),
00452       widget(w), nativeMsg(nsnull)
00453   {
00454   }
00455 
00456 public:
00457   nsGUIEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00458     : nsEvent(isTrusted, msg, NS_GUI_EVENT),
00459       widget(w), nativeMsg(nsnull)
00460   {
00461   }
00462 
00464   nsIWidget*  widget;           
00466   void*     nativeMsg;        
00467 };
00468 
00473 class nsScriptErrorEvent : public nsEvent
00474 {
00475 public:
00476   nsScriptErrorEvent(PRBool isTrusted, PRUint32 msg)
00477     : nsEvent(isTrusted, msg, NS_SCRIPT_ERROR_EVENT),
00478       lineNr(0), errorMsg(nsnull), fileName(nsnull)
00479   {
00480   }
00481 
00482   PRInt32           lineNr;
00483   const PRUnichar*  errorMsg;
00484   const PRUnichar*  fileName;
00485 };
00486 
00487 class nsBeforePageUnloadEvent : public nsEvent
00488 {
00489 public:
00490   nsBeforePageUnloadEvent(PRBool isTrusted, PRUint32 msg)
00491     : nsEvent(isTrusted, msg, NS_BEFORE_PAGE_UNLOAD_EVENT)
00492   {
00493   }
00494 
00495   nsString text;
00496 };
00497 
00502 class nsSizeEvent : public nsGUIEvent
00503 {
00504 public:
00505   nsSizeEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00506     : nsGUIEvent(isTrusted, msg, w, NS_SIZE_EVENT),
00507       windowSize(nsnull), mWinWidth(0), mWinHeight(0)
00508   {
00509   }
00510 
00512   nsRect          *windowSize;    
00514   PRInt32         mWinWidth;    
00516   PRInt32         mWinHeight;    
00517 };
00518 
00523 class nsSizeModeEvent : public nsGUIEvent
00524 {
00525 public:
00526   nsSizeModeEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00527     : nsGUIEvent(isTrusted, msg, w, NS_SIZEMODE_EVENT),
00528       mSizeMode(nsSizeMode_Normal)
00529   {
00530   }
00531 
00532   nsSizeMode      mSizeMode;
00533 };
00534 
00539 class nsZLevelEvent : public nsGUIEvent
00540 {
00541 public:
00542   nsZLevelEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00543     : nsGUIEvent(isTrusted, msg, w, NS_ZLEVEL_EVENT),
00544       mPlacement(nsWindowZTop), mReqBelow(nsnull), mActualBelow(nsnull),
00545       mImmediate(PR_FALSE), mAdjusted(PR_FALSE)
00546   {
00547   }
00548 
00549   nsWindowZ  mPlacement;
00550   nsIWidget *mReqBelow,    // widget we request being below, if any
00551             *mActualBelow; // widget to be below, returned by handler
00552   PRBool     mImmediate,   // handler should make changes immediately
00553              mAdjusted;    // handler changed placement
00554 };
00555 
00560 class nsPaintEvent : public nsGUIEvent
00561 {
00562 public:
00563   nsPaintEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00564     : nsGUIEvent(isTrusted, msg, w, NS_PAINT_EVENT),
00565       renderingContext(nsnull), region(nsnull), rect(nsnull)
00566   {
00567   }
00568 
00570   nsIRenderingContext *renderingContext;
00572   nsIRegion           *region;
00574   nsRect              *rect;      
00575 };
00576 
00581 class nsScrollbarEvent : public nsGUIEvent
00582 {
00583 public:
00584   nsScrollbarEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00585     : nsGUIEvent(isTrusted, msg, w, NS_SCROLLBAR_EVENT),
00586       position(0)
00587   {
00588   }
00589 
00591   PRUint32        position; 
00592 };
00593 
00594 class nsScrollPortEvent : public nsGUIEvent
00595 {
00596 public:
00597   enum orientType {
00598     vertical   = 0,
00599     horizontal = 1,
00600     both       = 2
00601   };
00602 
00603   nsScrollPortEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00604     : nsGUIEvent(isTrusted, msg, w, NS_SCROLLPORT_EVENT),
00605       orient(vertical)
00606   {
00607   }
00608 
00609   orientType orient;
00610 };
00611 
00612 class nsInputEvent : public nsGUIEvent
00613 {
00614 protected:
00615   nsInputEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w,
00616                PRUint8 structType)
00617     : nsGUIEvent(isTrusted, msg, w, structType),
00618       isShift(PR_FALSE), isControl(PR_FALSE), isAlt(PR_FALSE), isMeta(PR_FALSE)
00619   {
00620   }
00621 
00622 public:
00623   nsInputEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00624     : nsGUIEvent(isTrusted, msg, w, NS_INPUT_EVENT),
00625       isShift(PR_FALSE), isControl(PR_FALSE), isAlt(PR_FALSE), isMeta(PR_FALSE)
00626   {
00627   }
00628 
00630   PRBool          isShift;        
00632   PRBool          isControl;      
00634   PRBool          isAlt;          
00636   PRBool          isMeta;
00637 };
00638 
00643 class nsMouseEvent : public nsInputEvent
00644 {
00645 public:
00646   enum reasonType { eReal, eSynthesized };
00647 
00648   nsMouseEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w,
00649                reasonType aReason)
00650     : nsInputEvent(isTrusted, msg, w, NS_MOUSE_EVENT),
00651       clickCount(0), acceptActivation(PR_FALSE), reason(aReason)
00652   {
00653     if (msg == NS_MOUSE_MOVE) {
00654       flags |= NS_EVENT_FLAG_CANT_CANCEL;
00655     }
00656   }
00657 
00659   PRUint32        clickCount;          
00662   PRPackedBool    acceptActivation;           
00663   reasonType      reason : 8;
00664 };
00665 
00670 class nsAccessibleEvent : public nsInputEvent
00671 {
00672 public:
00673   nsAccessibleEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00674     : nsInputEvent(isTrusted, msg, w, NS_ACCESSIBLE_EVENT),
00675       accessible(nsnull)
00676   {
00677   }
00678 
00679   nsIAccessible*  accessible;     
00680 };
00681 
00686 class nsKeyEvent : public nsInputEvent
00687 {
00688 public:
00689   nsKeyEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00690     : nsInputEvent(isTrusted, msg, w, NS_KEY_EVENT),
00691       keyCode(0), charCode(0), isChar(0)
00692   {
00693   }
00694 
00696   PRUint32        keyCode;   
00698   PRUint32        charCode;
00699   // indicates whether the event signifies a printable character
00700   PRBool          isChar;
00701 };
00702 
00706 struct nsTextRange
00707 {
00708   nsTextRange()
00709     : mStartOffset(0), mEndOffset(0), mRangeType(0)
00710   {
00711   }
00712 
00713   PRUint32 mStartOffset;
00714   PRUint32 mEndOffset;
00715   PRUint32 mRangeType;
00716 };
00717 
00718 typedef nsTextRange* nsTextRangeArray;
00719 
00720 struct nsTextEventReply
00721 {
00722   nsTextEventReply()
00723     : mCursorIsCollapsed(PR_FALSE)
00724   {
00725   }
00726 
00727   nsRect mCursorPosition;
00728   PRBool mCursorIsCollapsed;
00729 };
00730 
00731 typedef struct nsTextEventReply nsTextEventReply;
00732 
00733 class nsTextEvent : public nsInputEvent
00734 {
00735 public:
00736   nsTextEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00737     : nsInputEvent(isTrusted, msg, w, NS_TEXT_EVENT),
00738       theText(nsnull), rangeCount(0), rangeArray(nsnull), isChar(PR_FALSE)
00739   {
00740   }
00741 
00742   const PRUnichar*  theText;
00743   nsTextEventReply  theReply;
00744   PRUint32          rangeCount;
00745   nsTextRangeArray  rangeArray;
00746   PRBool            isChar;
00747 };
00748 
00749 class nsCompositionEvent : public nsInputEvent
00750 {
00751 public:
00752   nsCompositionEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00753     : nsInputEvent(isTrusted, msg, w, NS_COMPOSITION_EVENT)
00754   {
00755   }
00756 
00757   nsTextEventReply theReply;
00758 };
00759 
00760 class nsMouseScrollEvent : public nsInputEvent
00761 {
00762 public:
00763   enum nsMouseScrollFlags {
00764     kIsFullPage =   1 << 0,
00765     kIsVertical =   1 << 1,
00766     kIsHorizontal = 1 << 2,
00767     kIsPixels =     1 << 3
00768   };
00769 
00770   nsMouseScrollEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00771     : nsInputEvent(isTrusted, msg, w, NS_MOUSE_SCROLL_EVENT),
00772       scrollFlags(0), delta(0)
00773   {
00774   }
00775 
00776   PRInt32 scrollFlags;
00777   PRInt32 delta;
00778 };
00779 
00780 struct nsReconversionEventReply {
00781   nsReconversionEventReply()
00782     : mReconversionString(nsnull)
00783   {
00784   }
00785 
00786   PRUnichar *mReconversionString;
00787 };
00788 
00789 class nsReconversionEvent : public nsInputEvent
00790 {
00791 public:
00792   nsReconversionEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00793     : nsInputEvent(isTrusted, msg, w, NS_RECONVERSION_EVENT)
00794   {
00795   }
00796 
00797   nsReconversionEventReply  theReply;
00798 };
00799 
00800 struct nsQueryCaretRectEventReply
00801 {
00802   nsQueryCaretRectEventReply()
00803     : mRectIsValid(PR_FALSE)
00804   {
00805   }
00806 
00807   PRBool mRectIsValid;
00808   nsRect mCaretRect;
00809 };
00810 
00811 class nsQueryCaretRectEvent : public nsInputEvent
00812 {
00813 public:
00814   nsQueryCaretRectEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00815     : nsInputEvent(isTrusted, msg, w, NS_QUERYCARETRECT_EVENT)
00816   {
00817   }
00818 
00819   nsQueryCaretRectEventReply theReply;
00820 };
00821 
00829 class nsMenuEvent : public nsGUIEvent
00830 {
00831 public:
00832   nsMenuEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00833     : nsGUIEvent(isTrusted, msg, w, NS_MENU_EVENT),
00834       mMenuItem(nsnull), mCommand(0)
00835   {
00836   }
00837 
00838   nsIMenuItem * mMenuItem;
00839   PRUint32      mCommand;
00840 };
00841 
00849 class nsFormEvent : public nsEvent
00850 {
00851 public:
00852   nsFormEvent(PRBool isTrusted, PRUint32 msg)
00853     : nsEvent(isTrusted, msg, NS_FORM_EVENT),
00854       originator(nsnull)
00855   {
00856   }
00857 
00858   nsIContent *originator;
00859 };
00860 
00864 class nsFocusEvent : public nsGUIEvent
00865 {
00866 public:
00867   nsFocusEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00868     : nsGUIEvent(isTrusted, msg, w, NS_FOCUS_EVENT),
00869       isMozWindowTakingFocus(PR_FALSE)
00870   {
00871   }
00872 
00873   PRBool isMozWindowTakingFocus;
00874 };
00875 
00882 class nsAppCommandEvent : public nsInputEvent
00883 {
00884 public:
00885   nsAppCommandEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00886     : nsInputEvent(isTrusted, msg, w, NS_APPCOMMAND_EVENT),
00887       appCommand(0)
00888   {
00889   }
00890 
00891   PRUint32     appCommand;
00892 };
00893 
00897 class nsPopupBlockedEvent : public nsEvent
00898 {
00899 public:
00900   nsPopupBlockedEvent(PRBool isTrusted, PRUint32 msg)
00901     : nsEvent(isTrusted, msg, NS_POPUPBLOCKED_EVENT),
00902       mRequestingWindowURI(nsnull), mPopupWindowURI(nsnull)
00903   {
00904   }
00905 
00906   nsIURI* mRequestingWindowURI; // owning reference
00907   nsWeakPtr mRequestingWindow;
00908   nsIURI* mPopupWindowURI;      // owning reference
00909   nsString mPopupWindowFeatures;
00910 };
00911 
00915 class nsUIEvent : public nsEvent
00916 {
00917 public:
00918   nsUIEvent(PRBool isTrusted, PRUint32 msg, PRInt32 d)
00919     : nsEvent(isTrusted, msg, NS_UI_EVENT),
00920       detail(d)
00921   {
00922   }
00923 
00924   PRInt32 detail;
00925 };
00926 
00930 class nsPageTransitionEvent : public nsEvent
00931 {
00932 public:
00933   nsPageTransitionEvent(PRBool isTrusted, PRUint32 msg, PRBool p)
00934     : nsEvent(isTrusted, msg, NS_PAGETRANSITION_EVENT),
00935       persisted(p)
00936   {
00937   }
00938 
00939   PRBool persisted;
00940 };
00941 
00945 class nsXULCommandEvent : public nsInputEvent
00946 {
00947 public:
00948   nsXULCommandEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
00949     : nsInputEvent(isTrusted, msg, w, NS_XUL_COMMAND_EVENT)
00950   {
00951   }
00952 
00953   nsCOMPtr<nsIDOMEvent> sourceEvent;
00954 };
00955 
00959 enum nsDragDropEventStatus {  
00961   nsDragDropEventStatus_eDragEntered,            
00963   nsDragDropEventStatus_eDragExited, 
00965   nsDragDropEventStatus_eDrop  
00966 };
00967 
00968 
00969 #define NS_IS_MOUSE_EVENT(evnt) \
00970        (((evnt)->message == NS_MOUSE_LEFT_BUTTON_DOWN) || \
00971         ((evnt)->message == NS_MOUSE_LEFT_BUTTON_UP) || \
00972         ((evnt)->message == NS_MOUSE_LEFT_CLICK) || \
00973         ((evnt)->message == NS_MOUSE_LEFT_DOUBLECLICK) || \
00974         ((evnt)->message == NS_MOUSE_MIDDLE_BUTTON_DOWN) || \
00975         ((evnt)->message == NS_MOUSE_MIDDLE_BUTTON_UP) || \
00976         ((evnt)->message == NS_MOUSE_MIDDLE_CLICK) || \
00977         ((evnt)->message == NS_MOUSE_MIDDLE_DOUBLECLICK) || \
00978         ((evnt)->message == NS_MOUSE_RIGHT_BUTTON_DOWN) || \
00979         ((evnt)->message == NS_MOUSE_RIGHT_BUTTON_UP) || \
00980         ((evnt)->message == NS_MOUSE_RIGHT_CLICK) || \
00981         ((evnt)->message == NS_MOUSE_RIGHT_DOUBLECLICK) || \
00982         ((evnt)->message == NS_MOUSE_ENTER) || \
00983         ((evnt)->message == NS_MOUSE_EXIT) || \
00984         ((evnt)->message == NS_MOUSE_ENTER) || \
00985         ((evnt)->message == NS_MOUSE_EXIT) || \
00986         ((evnt)->message == NS_MOUSE_ENTER_SYNTH) || \
00987         ((evnt)->message == NS_MOUSE_EXIT_SYNTH) || \
00988         ((evnt)->message == NS_MOUSE_MOVE))
00989 
00990 #define NS_IS_DRAG_EVENT(evnt) \
00991        (((evnt)->message == NS_DRAGDROP_ENTER) || \
00992         ((evnt)->message == NS_DRAGDROP_OVER) || \
00993         ((evnt)->message == NS_DRAGDROP_EXIT) || \
00994         ((evnt)->message == NS_DRAGDROP_DROP) || \
00995         ((evnt)->message == NS_DRAGDROP_GESTURE) || \
00996         ((evnt)->message == NS_DRAGDROP_OVER_SYNTH) || \
00997         ((evnt)->message == NS_DRAGDROP_EXIT_SYNTH))
00998 
00999 #define NS_IS_KEY_EVENT(evnt) \
01000        (((evnt)->message == NS_KEY_DOWN) ||  \
01001         ((evnt)->message == NS_KEY_PRESS) || \
01002         ((evnt)->message == NS_KEY_UP))
01003 
01004 #define NS_IS_IME_EVENT(evnt) \
01005        (((evnt)->message == NS_TEXT_TEXT) ||  \
01006         ((evnt)->message == NS_COMPOSITION_START) ||  \
01007         ((evnt)->message == NS_COMPOSITION_END) || \
01008         ((evnt)->message == NS_RECONVERSION_QUERY) || \
01009         ((evnt)->message == NS_QUERYCARETRECT) || \
01010         ((evnt)->message == NS_COMPOSITION_QUERY))
01011 
01012 #define NS_IS_FOCUS_EVENT(evnt) \
01013        (((evnt)->message == NS_GOTFOCUS) ||  \
01014         ((evnt)->message == NS_LOSTFOCUS) ||  \
01015         ((evnt)->message == NS_ACTIVATE) || \
01016         ((evnt)->message == NS_DEACTIVATE) || \
01017         ((evnt)->message == NS_PLUGIN_ACTIVATE))
01018 
01019 #define NS_IS_TRUSTED_EVENT(event) \
01020   (((event)->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED) != 0)
01021 
01022 // Mark an event as being dispatching.
01023 #define NS_MARK_EVENT_DISPATCH_STARTED(event) \
01024   (event)->flags |= NS_EVENT_FLAG_DISPATCHING;
01025 
01026 #define NS_IS_EVENT_IN_DISPATCH(event) \
01027   (((event)->flags & NS_EVENT_FLAG_DISPATCHING) != 0)
01028 
01029 // Mark an event as being done dispatching.
01030 #define NS_MARK_EVENT_DISPATCH_DONE(event) \
01031   NS_ASSERTION(NS_IS_EVENT_IN_DISPATCH(event), \
01032                "Event never got marked for dispatch!"); \
01033   (event)->flags &= ~NS_EVENT_FLAG_DISPATCHING; \
01034   (event)->flags |= NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY;
01035 
01036 /*
01037  * Virtual key bindings for keyboard events.
01038  * These come from nsIDOMKeyEvent.h, which is generated from MouseKeyEvent.idl.
01039  * Really, it would be better if we phased out the NS_VK symbols altogether
01040  * in favor of the DOM ones, but at least this way they'll be in sync.
01041  */
01042 
01043 #define NS_VK_CANCEL         nsIDOMKeyEvent::DOM_VK_CANCEL
01044 #define NS_VK_BACK           nsIDOMKeyEvent::DOM_VK_BACK_SPACE
01045 #define NS_VK_TAB            nsIDOMKeyEvent::DOM_VK_TAB
01046 #define NS_VK_CLEAR          nsIDOMKeyEvent::DOM_VK_CLEAR
01047 #define NS_VK_RETURN         nsIDOMKeyEvent::DOM_VK_RETURN
01048 #define NS_VK_ENTER          nsIDOMKeyEvent::DOM_VK_ENTER
01049 #define NS_VK_SHIFT          nsIDOMKeyEvent::DOM_VK_SHIFT
01050 #define NS_VK_CONTROL        nsIDOMKeyEvent::DOM_VK_CONTROL
01051 #define NS_VK_ALT            nsIDOMKeyEvent::DOM_VK_ALT
01052 #define NS_VK_PAUSE          nsIDOMKeyEvent::DOM_VK_PAUSE
01053 #define NS_VK_CAPS_LOCK      nsIDOMKeyEvent::DOM_VK_CAPS_LOCK
01054 #define NS_VK_ESCAPE         nsIDOMKeyEvent::DOM_VK_ESCAPE
01055 #define NS_VK_SPACE          nsIDOMKeyEvent::DOM_VK_SPACE
01056 #define NS_VK_PAGE_UP        nsIDOMKeyEvent::DOM_VK_PAGE_UP
01057 #define NS_VK_PAGE_DOWN      nsIDOMKeyEvent::DOM_VK_PAGE_DOWN
01058 #define NS_VK_END            nsIDOMKeyEvent::DOM_VK_END
01059 #define NS_VK_HOME           nsIDOMKeyEvent::DOM_VK_HOME
01060 #define NS_VK_LEFT           nsIDOMKeyEvent::DOM_VK_LEFT
01061 #define NS_VK_UP             nsIDOMKeyEvent::DOM_VK_UP
01062 #define NS_VK_RIGHT          nsIDOMKeyEvent::DOM_VK_RIGHT
01063 #define NS_VK_DOWN           nsIDOMKeyEvent::DOM_VK_DOWN
01064 #define NS_VK_PRINTSCREEN    nsIDOMKeyEvent::DOM_VK_PRINTSCREEN
01065 #define NS_VK_INSERT         nsIDOMKeyEvent::DOM_VK_INSERT
01066 #define NS_VK_DELETE         nsIDOMKeyEvent::DOM_VK_DELETE
01067 
01068 // NS_VK_0 - NS_VK_9 match their ascii values
01069 #define NS_VK_0              nsIDOMKeyEvent::DOM_VK_0
01070 #define NS_VK_1              nsIDOMKeyEvent::DOM_VK_1
01071 #define NS_VK_2              nsIDOMKeyEvent::DOM_VK_2
01072 #define NS_VK_3              nsIDOMKeyEvent::DOM_VK_3
01073 #define NS_VK_4              nsIDOMKeyEvent::DOM_VK_4
01074 #define NS_VK_5              nsIDOMKeyEvent::DOM_VK_5
01075 #define NS_VK_6              nsIDOMKeyEvent::DOM_VK_6
01076 #define NS_VK_7              nsIDOMKeyEvent::DOM_VK_7
01077 #define NS_VK_8              nsIDOMKeyEvent::DOM_VK_8
01078 #define NS_VK_9              nsIDOMKeyEvent::DOM_VK_9
01079 
01080 #define NS_VK_SEMICOLON      nsIDOMKeyEvent::DOM_VK_SEMICOLON
01081 #define NS_VK_EQUALS         nsIDOMKeyEvent::DOM_VK_EQUALS
01082 
01083 // NS_VK_A - NS_VK_Z match their ascii values
01084 #define NS_VK_A              nsIDOMKeyEvent::DOM_VK_A
01085 #define NS_VK_B              nsIDOMKeyEvent::DOM_VK_B
01086 #define NS_VK_C              nsIDOMKeyEvent::DOM_VK_C
01087 #define NS_VK_D              nsIDOMKeyEvent::DOM_VK_D
01088 #define NS_VK_E              nsIDOMKeyEvent::DOM_VK_E
01089 #define NS_VK_F              nsIDOMKeyEvent::DOM_VK_F
01090 #define NS_VK_G              nsIDOMKeyEvent::DOM_VK_G
01091 #define NS_VK_H              nsIDOMKeyEvent::DOM_VK_H
01092 #define NS_VK_I              nsIDOMKeyEvent::DOM_VK_I
01093 #define NS_VK_J              nsIDOMKeyEvent::DOM_VK_J
01094 #define NS_VK_K              nsIDOMKeyEvent::DOM_VK_K
01095 #define NS_VK_L              nsIDOMKeyEvent::DOM_VK_L
01096 #define NS_VK_M              nsIDOMKeyEvent::DOM_VK_M
01097 #define NS_VK_N              nsIDOMKeyEvent::DOM_VK_N
01098 #define NS_VK_O              nsIDOMKeyEvent::DOM_VK_O
01099 #define NS_VK_P              nsIDOMKeyEvent::DOM_VK_P
01100 #define NS_VK_Q              nsIDOMKeyEvent::DOM_VK_Q
01101 #define NS_VK_R              nsIDOMKeyEvent::DOM_VK_R
01102 #define NS_VK_S              nsIDOMKeyEvent::DOM_VK_S
01103 #define NS_VK_T              nsIDOMKeyEvent::DOM_VK_T
01104 #define NS_VK_U              nsIDOMKeyEvent::DOM_VK_U
01105 #define NS_VK_V              nsIDOMKeyEvent::DOM_VK_V
01106 #define NS_VK_W              nsIDOMKeyEvent::DOM_VK_W
01107 #define NS_VK_X              nsIDOMKeyEvent::DOM_VK_X
01108 #define NS_VK_Y              nsIDOMKeyEvent::DOM_VK_Y
01109 #define NS_VK_Z              nsIDOMKeyEvent::DOM_VK_Z
01110 
01111 #define NS_VK_CONTEXT_MENU   nsIDOMKeyEvent::DOM_VK_CONTEXT_MENU
01112 
01113 #define NS_VK_NUMPAD0        nsIDOMKeyEvent::DOM_VK_NUMPAD0
01114 #define NS_VK_NUMPAD1        nsIDOMKeyEvent::DOM_VK_NUMPAD1
01115 #define NS_VK_NUMPAD2        nsIDOMKeyEvent::DOM_VK_NUMPAD2
01116 #define NS_VK_NUMPAD3        nsIDOMKeyEvent::DOM_VK_NUMPAD3
01117 #define NS_VK_NUMPAD4        nsIDOMKeyEvent::DOM_VK_NUMPAD4
01118 #define NS_VK_NUMPAD5        nsIDOMKeyEvent::DOM_VK_NUMPAD5
01119 #define NS_VK_NUMPAD6        nsIDOMKeyEvent::DOM_VK_NUMPAD6
01120 #define NS_VK_NUMPAD7        nsIDOMKeyEvent::DOM_VK_NUMPAD7
01121 #define NS_VK_NUMPAD8        nsIDOMKeyEvent::DOM_VK_NUMPAD8
01122 #define NS_VK_NUMPAD9        nsIDOMKeyEvent::DOM_VK_NUMPAD9
01123 #define NS_VK_MULTIPLY       nsIDOMKeyEvent::DOM_VK_MULTIPLY
01124 #define NS_VK_ADD            nsIDOMKeyEvent::DOM_VK_ADD
01125 #define NS_VK_SEPARATOR      nsIDOMKeyEvent::DOM_VK_SEPARATOR
01126 #define NS_VK_SUBTRACT       nsIDOMKeyEvent::DOM_VK_SUBTRACT
01127 #define NS_VK_DECIMAL        nsIDOMKeyEvent::DOM_VK_DECIMAL
01128 #define NS_VK_DIVIDE         nsIDOMKeyEvent::DOM_VK_DIVIDE
01129 #define NS_VK_F1             nsIDOMKeyEvent::DOM_VK_F1
01130 #define NS_VK_F2             nsIDOMKeyEvent::DOM_VK_F2
01131 #define NS_VK_F3             nsIDOMKeyEvent::DOM_VK_F3
01132 #define NS_VK_F4             nsIDOMKeyEvent::DOM_VK_F4
01133 #define NS_VK_F5             nsIDOMKeyEvent::DOM_VK_F5
01134 #define NS_VK_F6             nsIDOMKeyEvent::DOM_VK_F6
01135 #define NS_VK_F7             nsIDOMKeyEvent::DOM_VK_F7
01136 #define NS_VK_F8             nsIDOMKeyEvent::DOM_VK_F8
01137 #define NS_VK_F9             nsIDOMKeyEvent::DOM_VK_F9
01138 #define NS_VK_F10            nsIDOMKeyEvent::DOM_VK_F10
01139 #define NS_VK_F11            nsIDOMKeyEvent::DOM_VK_F11
01140 #define NS_VK_F12            nsIDOMKeyEvent::DOM_VK_F12
01141 #define NS_VK_F13            nsIDOMKeyEvent::DOM_VK_F13
01142 #define NS_VK_F14            nsIDOMKeyEvent::DOM_VK_F14
01143 #define NS_VK_F15            nsIDOMKeyEvent::DOM_VK_F15
01144 #define NS_VK_F16            nsIDOMKeyEvent::DOM_VK_F16
01145 #define NS_VK_F17            nsIDOMKeyEvent::DOM_VK_F17
01146 #define NS_VK_F18            nsIDOMKeyEvent::DOM_VK_F18
01147 #define NS_VK_F19            nsIDOMKeyEvent::DOM_VK_F19
01148 #define NS_VK_F20            nsIDOMKeyEvent::DOM_VK_F20
01149 #define NS_VK_F21            nsIDOMKeyEvent::DOM_VK_F21
01150 #define NS_VK_F22            nsIDOMKeyEvent::DOM_VK_F22
01151 #define NS_VK_F23            nsIDOMKeyEvent::DOM_VK_F23
01152 #define NS_VK_F24            nsIDOMKeyEvent::DOM_VK_F24
01153 
01154 #define NS_VK_NUM_LOCK       nsIDOMKeyEvent::DOM_VK_NUM_LOCK
01155 #define NS_VK_SCROLL_LOCK    nsIDOMKeyEvent::DOM_VK_SCROLL_LOCK
01156 
01157 #define NS_VK_COMMA          nsIDOMKeyEvent::DOM_VK_COMMA
01158 #define NS_VK_PERIOD         nsIDOMKeyEvent::DOM_VK_PERIOD
01159 #define NS_VK_SLASH          nsIDOMKeyEvent::DOM_VK_SLASH
01160 #define NS_VK_BACK_QUOTE     nsIDOMKeyEvent::DOM_VK_BACK_QUOTE
01161 #define NS_VK_OPEN_BRACKET   nsIDOMKeyEvent::DOM_VK_OPEN_BRACKET
01162 #define NS_VK_BACK_SLASH     nsIDOMKeyEvent::DOM_VK_BACK_SLASH
01163 #define NS_VK_CLOSE_BRACKET  nsIDOMKeyEvent::DOM_VK_CLOSE_BRACKET
01164 #define NS_VK_QUOTE          nsIDOMKeyEvent::DOM_VK_QUOTE
01165 
01166 #define NS_VK_META           nsIDOMKeyEvent::DOM_VK_META
01167 
01168 // IME Constants  -- keep in synch with nsIDOMTextRange.h
01169 #define NS_TEXTRANGE_CARETPOSITION                      0x01
01170 #define NS_TEXTRANGE_RAWINPUT                                  0X02
01171 #define NS_TEXTRANGE_SELECTEDRAWTEXT                    0x03
01172 #define NS_TEXTRANGE_CONVERTEDTEXT                      0x04
01173 #define NS_TEXTRANGE_SELECTEDCONVERTEDTEXT              0x05
01174 
01175 #endif // nsGUIEvent_h__