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
16
17#ifndef DOM_DocumentEvent_INCLUDED
18#define DOM_DocumentEvent_INCLUDED
19
20
21#include "Poco/XML/XML.h"
22#include "Poco/XML/XMLString.h"
23
24
25namespace Poco {
26namespace XML {
27
28
29class Event;
30
31
32class XML_API DocumentEvent
33 /// The DocumentEvent interface provides a mechanism by which the user can create
34 /// an Event of a type supported by the implementation. It is expected that
35 /// the DocumentEvent interface will be implemented on the same object which
36 /// implements the Document interface in an implementation which supports the
37 /// Event model.
38{
39public:
40 virtual Event* createEvent(const XMLString& eventType) const = 0;
41 /// Creates an event of the specified type.
42 ///
43 /// The eventType parameter specifies the type of Event interface to be created.
44 /// If the Event interface specified is supported by the implementation this
45 /// method will return a new Event of the interface type requested. If the Event
46 /// is to be dispatched via the dispatchEvent method the appropriate event init
47 /// method must be called after creation in order to initialize the Event's
48 /// values. As an example, a user wishing to synthesize some kind of UIEvent
49 /// would call createEvent with the parameter "UIEvents". The initUIEvent method
50 /// could then be called on the newly created UIEvent to set the specific type
51 /// of UIEvent to be dispatched and set its context information.
52 /// The createEvent method is used in creating Events when it is either inconvenient
53 /// or unnecessary for the user to create an Event themselves. In cases where
54 /// the implementation provided Event is insufficient, users may supply their
55 /// own Event implementations for use with the dispatchEvent method.
56
57protected:
58 virtual ~DocumentEvent();
59};
60
61
62} } // namespace Poco::XML
63
64
65#endif // DOM_DocumentEvent_INCLUDED
66