Type: recommended
         Title: new: css.document.XDocumentEventBroadcaster/Listener / 
DocumentEvent
     Posted by: [EMAIL PROTECTED]
      Affected: [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],-
         TaskId: i49133
<http://www.openoffice.org/issues/show_bug.cgi?id=49133>
Effective from: CWS odbmacros3
           CWS:
<http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300/odbmacros3>
    CWS status: ready for QA


*Summary*
--------
in css.document:
+ XDocumentEventBroadcaster
+   .add/removeDocumentEventListener
+   .notifyDocumentEvent( string, css.frame.XController2, any )
+ XDocumentEventListener
+   .documentEventOccured( DocumentEvent );
+ DocumentEvent
+   .EventName
+   .ViewController
+   .Supplement

*Description*
-------------
To replace the insufficient
css.document.XEventBroadcaster/XEventListener/EventObject, which were
previously used to notify document-related events (OnLoad,
OnViewConnected, etc, as described in css.document.Events), new
interfaces XDocumentEventBroadcaster/Listener together with the new
DocumentEvent have been introduced.

The advantages of the new types:

- the do not name-clash with existing interfaces/structs in other
namespaces,
  which is a pain during development

- the XDocumentEventBroadcaster::notifyDocumentEvent (which is allowed
  to throw a NoSupportException) makes the previously used hack to
  query the GlobalEventBroadcaster (and other implementations) for
  XEventListener, and call  its notifyEvent method, superfluous.
  In other words, externally triggering the notification of a document
event
  is no an officially supported feature at the broadcaster interface,
instead
  of a hacky hidden secret mis-using the listener interface of a given
  implementation.

- The DocumentEvent carries more information than the EventObject, in
  particular it can carry the controller which an event applies to, and
  arbitrary supplemental information. For instance, for an OnSaveAs
  event, this could be the URL to which the document is about to be saved.

Existing implementations of the XEventBroadcaster have been extended
to also support the XDocumentEventBroadcaster interface, though not
all information which can be passed via the new DocumentEvent is being
broadcasted, yet - this is left for the framework team as an exercise :).

This includes SFX-based documents, and the GlobalEventBroadcaster.

The XEventBroadcaster/Listener interfaces have been declared
deprecated in favour of the new types, but are still supported in
existing implementations for compatibility reasons.


Send feedback to [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to