DocumentEvent.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // DocumentEvent.h
  3. //
  4. // Library: XML
  5. // Package: DOM
  6. // Module: DOM
  7. //
  8. // Definition of the DOM DocumentEvent interface.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef DOM_DocumentEvent_INCLUDED
  16. #define DOM_DocumentEvent_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/XML/XMLString.h"
  19. namespace Poco {
  20. namespace XML {
  21. class Event;
  22. class XML_API DocumentEvent
  23. /// The DocumentEvent interface provides a mechanism by which the user can create
  24. /// an Event of a type supported by the implementation. It is expected that
  25. /// the DocumentEvent interface will be implemented on the same object which
  26. /// implements the Document interface in an implementation which supports the
  27. /// Event model.
  28. {
  29. public:
  30. virtual Event* createEvent(const XMLString& eventType) const = 0;
  31. /// Creates an event of the specified type.
  32. ///
  33. /// The eventType parameter specifies the type of Event interface to be created.
  34. /// If the Event interface specified is supported by the implementation this
  35. /// method will return a new Event of the interface type requested. If the Event
  36. /// is to be dispatched via the dispatchEvent method the appropriate event init
  37. /// method must be called after creation in order to initialize the Event's
  38. /// values. As an example, a user wishing to synthesize some kind of UIEvent
  39. /// would call createEvent with the parameter "UIEvents". The initUIEvent method
  40. /// could then be called on the newly created UIEvent to set the specific type
  41. /// of UIEvent to be dispatched and set its context information.
  42. /// The createEvent method is used in creating Events when it is either inconvenient
  43. /// or unnecessary for the user to create an Event themselves. In cases where
  44. /// the implementation provided Event is insufficient, users may supply their
  45. /// own Event implementations for use with the dispatchEvent method.
  46. protected:
  47. virtual ~DocumentEvent();
  48. };
  49. } } // namespace Poco::XML
  50. #endif // DOM_DocumentEvent_INCLUDED