eventwrapper.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2009 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview Definition of the goog.events.EventWrapper interface.
  16. *
  17. * @author eae@google.com (Emil A Eklund)
  18. */
  19. goog.provide('goog.events.EventWrapper');
  20. /**
  21. * Interface for event wrappers.
  22. * @interface
  23. */
  24. goog.events.EventWrapper = function() {};
  25. /**
  26. * Adds an event listener using the wrapper on a DOM Node or an object that has
  27. * implemented {@link goog.events.EventTarget}. A listener can only be added
  28. * once to an object.
  29. *
  30. * @param {goog.events.ListenableType} src The node to listen to events on.
  31. * @param {function(?):?|{handleEvent:function(?):?}|null} listener Callback
  32. * method, or an object with a handleEvent function.
  33. * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to
  34. * false).
  35. * @param {Object=} opt_scope Element in whose scope to call the listener.
  36. * @param {goog.events.EventHandler=} opt_eventHandler Event handler to add
  37. * listener to.
  38. */
  39. goog.events.EventWrapper.prototype.listen = function(
  40. src, listener, opt_capt, opt_scope, opt_eventHandler) {};
  41. /**
  42. * Removes an event listener added using goog.events.EventWrapper.listen.
  43. *
  44. * @param {goog.events.ListenableType} src The node to remove listener from.
  45. * @param {function(?):?|{handleEvent:function(?):?}|null} listener Callback
  46. * method, or an object with a handleEvent function.
  47. * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to
  48. * false).
  49. * @param {Object=} opt_scope Element in whose scope to call the listener.
  50. * @param {goog.events.EventHandler=} opt_eventHandler Event handler to remove
  51. * listener from.
  52. */
  53. goog.events.EventWrapper.prototype.unlisten = function(
  54. src, listener, opt_capt, opt_scope, opt_eventHandler) {};