{"size": 1844, "ext": "scrbl", "max_stars_repo_path": "scribblings/com-events.scrbl", "max_stars_repo_name": "LiberalArtist/mysterx", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "scribblings/com-events.scrbl", "max_issues_repo_name": "LiberalArtist/mysterx", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "scribblings/com-events.scrbl", "max_forks_repo_name": "LiberalArtist/mysterx", "max_forks_repo_forks_event_min_datetime": "2017-06-08T20:38:42.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-09T05:02:52.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 2, "avg_line_length": 32.350877193, "max_line_length": 70, "alphanum_fraction": 0.6686550976}
#lang scribble/doc
@(require "common.rkt")

@title[#:tag "com-events"]{COM Events}

  COM events are generated by COM objects.  Unlike
  HTML events, there is no fixed set of COM
  events, though there are ``stock'' events that
  many COM objects support.  MysterX allows the
  programmer to write handlers for both stock and
  custom events.

@defproc[(com-events [obj/type (or/c com-object? com-type?)])
         (listof string?)]{

  Returns a list of strings naming the events supported by
  @racket[obj/type].

  If calling this procedure results in an error indicating that the
  COM object's coclass is ambiguous, try using either
  @racket[set-coclass!] or @racket[set-coclass-from-progid!], then
  retry @racket[com-events].}


@defproc[(com-event-type [obj/type (or/c com-object? com-type?)]
                         [ev string?])
         (listof string?)]{

  Returns the type of an event handler for the
  event @racket[ev] generated by the particular
  COM object/type @racket[obj/type].  The return type of
  all COM event handlers is void.

  See also @racket[com-events] for dealing with a COM
  object that has an ambiguous class.}

@defproc[(com-register-event-handler 
          [obj com-object?]
          [ev string?]
          [f (any/c . -> . any)])
         void?]{

  Registers @racket[f] as event handler for the event @racket[ev] when
  generated by @racket[obj].  The type of argument supplied to
  @racket[f] depends on the event; the result of @racket[f] is always
  discarded.

  See also @racket[com-events] for dealing with a COM
  object that has an ambiguous class.}

@defproc[(com-unregister-event-handler [obj com-object?] 
                                       [ev string?])
         void?]{

  Unregisters any event handler for the event @racket[ev] that is
  generated by the COM object @racket[obj].}
