001: /*
002: ItsNat Java Web Application Framework
003: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004: Author: Jose Maria Arranz Santamaria
005:
006: This program is free software: you can redistribute it and/or modify
007: it under the terms of the GNU Affero General Public License as published by
008: the Free Software Foundation, either version 3 of the License, or
009: (at your option) any later version. See the GNU Affero General Public
010: License for more details. See the copy of the GNU Affero General Public License
011: included in this program. If not, see <http://www.gnu.org/licenses/>.
012: */
013:
014: package org.itsnat.impl.core.event.client2serv.dom.msie;
015:
016: import org.itsnat.impl.core.event.client2serv.dom.MSIEEventFactory;
017: import org.w3c.dom.Node;
018:
019: /**
020: *
021: * @author jmarranz
022: */
023: public class MSIEOriginalEventImpl {
024: /*
025: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events.asp
026: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects.asp
027:
028: http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/eventobj/eventobj.asp
029: http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/eventobj2/eventobj2.asp
030: http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/eventobj3/ihtmleventobj3.asp
031: http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/eventobj4/ihtmleventobj4.asp
032:
033: Lista completa de atributos:
034:
035: altKey, altLeft, button, clientX, clientY, ctrlKey, ctrlLeft, dataFld,
036: offsetX, offsetY, propertyName, qualifier, reason, repeat, screenX,
037: screenY, shiftKey, shiftLeft, srcUrn, type, x, y
038: returnValue, cancelBubble, keyCode, fromElement, toElement, button
039: offsetX, offsetY, srcFilter, dataTransfer, contentOverflow, behaviorCookie
040: behaviorPart, nextPage, wheelDelta
041:
042: Atributos presentes pero no documentados por Microsoft:
043:
044: imeCompositionChange,imeNotifyCommand,imeNotifyData,imeRequest,imeRequestData
045: keyboardLayout
046: **/
047:
048: protected MSIEEventImpl event;
049: protected MSIEEventFactory factory;
050:
051: /** Creates a new instance of MSIEOriginalEventImpl */
052: public MSIEOriginalEventImpl(MSIEEventImpl event,
053: MSIEEventFactory factory) {
054: this .event = event;
055: this .factory = factory;
056: }
057:
058: public boolean getAltKey() {
059: return event.getDOMEventParamBoolean("altKey");
060: }
061:
062: public short getButton() {
063: return event.getDOMEventParamShort("button");
064: }
065:
066: public boolean getCancelBubble() {
067: return event.getDOMEventParamBoolean("cancelBubble");
068: }
069:
070: public int getClientX() {
071: return event.getDOMEventParamInt("clientX");
072: }
073:
074: public int getClientY() {
075: return event.getDOMEventParamInt("clientY");
076: }
077:
078: public boolean getCtrlKey() {
079: return event.getDOMEventParamBoolean("ctrlKey");
080: }
081:
082: public Node getFromElement() {
083: return event.getDOMEventParamNode("fromElement");
084: }
085:
086: public long getKeyCode() {
087: return event.getDOMEventParamLong("keyCode");
088: }
089:
090: public int getOffsetX() {
091: return event.getDOMEventParamInt("offsetX");
092: }
093:
094: public int getOffsetY() {
095: return event.getDOMEventParamInt("offsetY");
096: }
097:
098: public String getQualifier() {
099: return event.getDOMEventParam("qualifier");
100: }
101:
102: public int getReason() {
103: return event.getDOMEventParamInt("reason");
104: }
105:
106: public boolean getReturnValue() {
107: // En realidad debería ser Object (Variant) pero su uso habitual es true/false como únicos valores
108: // returnValue es especial porque es una propiedad del evento
109: // que puede no existir pero que si se define tiene significado
110: // para MSIE
111: String value = event.getDOMEventParam("returnValue");
112: if (value.equals("undefined"))
113: return true; // No está definida por lo que el retorno de true suele significa que se siga con el comportamiento normal
114: else
115: return Boolean.valueOf(value).booleanValue();
116: }
117:
118: public int getScreenX() {
119: return event.getDOMEventParamInt("screenX");
120: }
121:
122: public int getScreenY() {
123: return event.getDOMEventParamInt("screenY");
124: }
125:
126: public boolean getShiftKey() {
127: return event.getDOMEventParamBoolean("shiftKey");
128: }
129:
130: public Node getSrcElement() {
131: return event.getDOMEventParamNode("srcElement");
132: }
133:
134: public Node getSrcFilter() {
135: return event.getDOMEventParamNode("srcFilter");
136: }
137:
138: public Node getToElement() {
139: return event.getDOMEventParamNode("toElement");
140: }
141:
142: public String getType() {
143: return event.getDOMEventParam("type");
144: }
145:
146: public int getX() {
147: return event.getDOMEventParamInt("x");
148: }
149:
150: public int getY() {
151: return event.getDOMEventParamInt("y");
152: }
153:
154: }
|