01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core.event;
15:
16: import org.itsnat.core.ItsNatDocument;
17: import org.itsnat.core.ItsNatUserData;
18: import org.itsnat.core.ItsNatServletRequest;
19: import org.itsnat.core.ItsNatServletResponse;
20:
21: /**
22: * This interface is the parent of any ItsNat event interface: normal
23: * and remote view/control events.
24: *
25: * <p>Any <code>org.w3c.dom.events.Event</code> object managed by ItsNat
26: * implements this interface.</p>
27: *
28: * <p>Current implementation inherits from <code>java.util.EventObject</code>.</p>
29: *
30: * @author Jose Maria Arranz Santamaria
31: */
32: public interface ItsNatEvent extends ItsNatUserData {
33: /**
34: * Returns the associated ItsNat Servlet Request of this event.
35: *
36: * @return the current request.
37: */
38: public ItsNatServletRequest getItsNatServletRequest();
39:
40: /**
41: * Returns the associated ItsNat Servlet Response of this event.
42: *
43: * @return the current response.
44: */
45: public ItsNatServletResponse getItsNatServletResponse();
46:
47: /**
48: * Returns the associated ItsNat document target of this event.
49: *
50: * @return the ItsNat document.
51: */
52: public ItsNatDocument getItsNatDocument();
53:
54: /**
55: * Returns the AJAX synchronous mode used to send this event.
56: *
57: * @return the synchronous mode.
58: */
59: public int getSyncMode();
60:
61: /**
62: * Returns the remote value carried alongside this event with the specified name.
63: *
64: * <p>Usually these name/value pairs are declared using {@link org.itsnat.core.event.ParamTransport} objects.
65: *
66: * <p>Current implementation calls: <code>ServletRequest.getParameter(String)</code> with
67: * the specified name if the name/value pair was not set calling
68: * {@link #setExtraParam(String,Object)}.</p>
69: *
70: *
71: * @param name the name to search for.
72: * @return the value carried with the specified name.
73: */
74: public Object getExtraParam(String name);
75:
76: /**
77: * Sets the specified name and value as a remote browser data carried by this event.
78: *
79: * <p>This method may be useful to simulate data transportation from the browser
80: * in an event directly (locally) dispatched to the server DOM calling
81: * {@link org.itsnat.core.ItsNatDocument#dispatchEventLocally(EventTarget,Event)}.
82: * </p>
83: * @param name the name of the value.
84: * @param value the value associated the specified name.
85: */
86: public void setExtraParam(String name, Object value);
87: }
|