001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.uif.component;
017
018/**
019 * Declares methods for determining which client side events are supported by a
020 * <code>Component</code> and methods for retrieving the event code
021 * 
022 * <p>
023 * The code returned by the get*Script methods will be wrapped in the
024 * appropriate event registration code, therefore only the body needs to be
025 * returned
026 * </p>
027 * 
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030public interface ScriptEventSupport {
031
032        /**
033         * Indicates whether the component supports the onLoad event
034         * 
035         * @return boolean true if event is supported, false if the event is not
036         *         supported
037         */
038        public boolean getSupportsOnLoad();
039
040        /**
041         * Script that should be executed when the component's onLoad event is fired
042         * 
043         * @return String JavaScript code
044         */
045        public String getOnLoadScript();
046
047    /**
048     * Setter for the onLoad script
049     *
050     * @param script - script for on load
051     */
052    public void setOnLoadScript(String script);
053
054        /**
055         * Indicates whether the component supports the document ready event
056         * 
057         * @return boolean true if event is supported, false if the event is not
058         *         supported
059         */
060        public boolean getSupportsOnDocumentReady();
061
062    /**
063     * Setter for the onDocumentReadyScript
064     *
065     * @param script - script for onDocumentReadyScript
066     */
067    public void setOnDocumentReadyScript(String script);
068
069        /**
070         * Script to be run when the document ready event is triggered
071         * 
072         * @return the onDocumentReadyScript
073         */
074        public String getOnDocumentReadyScript();
075
076        /**
077         * Indicates whether the component supports the onUnload event
078         * 
079         * @return boolean true if event is supported, false if the event is not
080         *         supported
081         */
082        public boolean getSupportsOnUnload();
083
084        /**
085         * Script that should be executed when the component's onUnload event is
086         * fired
087         * 
088         * @return String JavaScript code
089         */
090        public String getOnUnloadScript();
091
092        /**
093         * Indicates whether the component supports the onClose event
094         * 
095         * @return boolean true if event is supported, false if the event is not
096         *         supported
097         */
098        public boolean getSupportsOnClose();
099
100        /**
101         * Script that should be executed when the component's onClose event is
102         * fired
103         * 
104         * @return String JavaScript code
105         */
106        public String getOnCloseScript();
107
108        /**
109         * Indicates whether the component supports the onBlur event
110         * 
111         * @return boolean true if event is supported, false if the event is not
112         *         supported
113         */
114        public boolean getSupportsOnBlur();
115
116        /**
117         * Script that should be executed when the component's onBlur event is fired
118         * 
119         * @return String JavaScript code
120         */
121        public String getOnBlurScript();
122
123    /**
124     * Setter for the onblur script
125     *
126     * @param script
127     */
128    public void setOnBlurScript(String script);
129
130        /**
131         * Indicates whether the component supports the onChange event
132         * 
133         * @return boolean true if event is supported, false if the event is not
134         *         supported
135         */
136        public boolean getSupportsOnChange();
137
138        /**
139         * Script that should be executed when the component's onChange event is
140         * fired
141         * 
142         * @return String JavaScript code
143         */
144        public String getOnChangeScript();
145
146        /**
147         * Indicates whether the component supports the onClick event
148         * 
149         * @return boolean true if event is supported, false if the event is not
150         *         supported
151         */
152        public boolean getSupportsOnClick();
153
154        /**
155         * Script that should be executed when the component's onClick event is
156         * fired
157         * 
158         * @return String JavaScript code
159         */
160        public String getOnClickScript();
161
162        /**
163         * Indicates whether the component supports the onDblClick event
164         * 
165         * @return boolean true if event is supported, false if the event is not
166         *         supported
167         */
168        public boolean getSupportsOnDblClick();
169
170        /**
171         * Script that should be executed when the component's onDblClick event is
172         * fired
173         * 
174         * @return String JavaScript code
175         */
176        public String getOnDblClickScript();
177
178        /**
179         * Indicates whether the component supports the onFocus event
180         * 
181         * @return boolean true if event is supported, false if the event is not
182         *         supported
183         */
184        public boolean getSupportsOnFocus();
185
186        /**
187         * Script that should be executed when the component's onFocus event is
188         * fired
189         * 
190         * @return String JavaScript code
191         */
192        public String getOnFocusScript();
193
194        /**
195         * Indicates whether the component supports the onSubmit event
196         * 
197         * @return boolean true if event is supported, false if the event is not
198         *         supported
199         */
200        public boolean getSupportsOnSubmit();
201
202        /**
203         * Script that should be executed when the component's onSubmit event is
204         * fired
205         * 
206         * @return String JavaScript code
207         */
208        public String getOnSubmitScript();
209
210        /**
211         * Indicates whether the component supports the onKeyPress event
212         * 
213         * @return boolean true if event is supported, false if the event is not
214         *         supported
215         */
216        public boolean getSupportsOnKeyPress();
217
218        /**
219         * Script that should be executed when the component's onKeyPress event is
220         * fired
221         * 
222         * @return String JavaScript code
223         */
224        public String getOnKeyPressScript();
225
226        /**
227         * Indicates whether the component supports the onKeyUp event
228         * 
229         * @return boolean true if event is supported, false if the event is not
230         *         supported
231         */
232        public boolean getSupportsOnKeyUp();
233
234        /**
235         * Script that should be executed when the component's onKeyUp event is
236         * fired
237         * 
238         * @return String JavaScript code
239         */
240        public String getOnKeyUpScript();
241
242        /**
243         * Indicates whether the component supports the onKeyDown event
244         * 
245         * @return boolean true if event is supported, false if the event is not
246         *         supported
247         */
248        public boolean getSupportsOnKeyDown();
249
250        /**
251         * Script that should be executed when the component's onKeyDown event is
252         * fired
253         * 
254         * @return String JavaScript code
255         */
256        public String getOnKeyDownScript();
257
258        /**
259         * Indicates whether the component supports the onMouseOver event
260         * 
261         * @return boolean true if event is supported, false if the event is not
262         *         supported
263         */
264        public boolean getSupportsOnMouseOver();
265
266        /**
267         * Script that should be executed when the component's onMouseOver event is
268         * fired
269         * 
270         * @return String JavaScript code
271         */
272        public String getOnMouseOverScript();
273
274        /**
275         * Indicates whether the component supports the onMouseOut event
276         * 
277         * @return boolean true if event is supported, false if the event is not
278         *         supported
279         */
280        public boolean getSupportsOnMouseOut();
281
282        /**
283         * Script that should be executed when the component's onMouseOut event is
284         * fired
285         * 
286         * @return String JavaScript code
287         */
288        public String getOnMouseOutScript();
289
290        /**
291         * Indicates whether the component supports the onMouseUp event
292         * 
293         * @return boolean true if event is supported, false if the event is not
294         *         supported
295         */
296        public boolean getSupportsOnMouseUp();
297
298        /**
299         * Script that should be executed when the component's onMouseUp event is
300         * fired
301         * 
302         * @return String JavaScript code
303         */
304        public String getOnMouseUpScript();
305
306        /**
307         * Indicates whether the component supports the onMouseDown event
308         * 
309         * @return boolean true if event is supported, false if the event is not
310         *         supported
311         */
312        public boolean getSupportsOnMouseDown();
313
314        /**
315         * Script that should be executed when the component's onMouseDown event is
316         * fired
317         * 
318         * @return String JavaScript code
319         */
320        public String getOnMouseDownScript();
321
322        /**
323         * Indicates whether the component supports the onMouseMove event
324         * 
325         * @return boolean true if event is supported, false if the event is not
326         *         supported
327         */
328        public boolean getSupportsOnMouseMove();
329
330        /**
331         * Script that should be executed when the component's onMouseMove event is
332         * fired
333         * 
334         * @return String JavaScript code
335         */
336        public String getOnMouseMoveScript();
337
338}