• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

  • tdehtml
  • dom
dom2_events.h
1/*
2 * This file is part of the DOM implementation for KDE.
3 *
4 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2003 Apple Computer, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#ifndef _DOM_Events_h_
25#define _DOM_Events_h_
26
27#include <dom/dom_node.h>
28#include <dom/dom_misc.h>
29
30namespace DOM {
31
32class Event;
33class EventException;
34class UIEvent;
35class MouseEvent;
36class TextEvent;
37class MutationEvent;
38class AbstractView;
39
40class EventListenerImpl;
41class EventImpl;
42class UIEventImpl;
43class MouseEventImpl;
44class KeyEventBaseImpl;
45class MutationEventImpl;
46
47
48
64class TDEHTML_EXPORT EventListener : public DomShared {
65public:
66 EventListener();
67 virtual ~EventListener();
68
78 virtual void handleEvent(Event &evt);
79
88 virtual DOMString eventListenerType();
89
90protected:
95 EventListenerImpl *impl;
96};
97
98
111class TDEHTML_EXPORT Event {
112 friend class Document;
113 friend class NodeImpl;
114 friend class DocumentImpl;
115public:
116 Event();
117 Event(const Event &other);
118 virtual ~Event();
119
120 Event & operator = (const Event &other);
121
133 enum PhaseType {
134 CAPTURING_PHASE = 1,
135 AT_TARGET = 2,
136 BUBBLING_PHASE = 3
137 };
138
143 DOMString type() const;
144
150 Node target() const;
151
158 Node currentTarget() const;
159
164 unsigned short eventPhase() const;
165
171 bool bubbles() const;
172
179 bool cancelable() const;
180
189 DOMTimeStamp timeStamp() const;
190
199 void stopPropagation();
200
213 void preventDefault();
214
240 void initEvent(const DOMString &eventTypeArg, bool canBubbleArg, bool cancelableArg);
241
246 EventImpl *handle() const;
247 bool isNull() const;
248
249protected:
250 Event(EventImpl *i);
251 EventImpl *impl;
252};
253
254
262class TDEHTML_EXPORT EventException
263{
264public:
265 EventException(unsigned short _code);
266 EventException(const EventException &other);
267 EventException & operator = (const EventException &other);
268 virtual ~EventException() {}
269
279 enum EventExceptionCode {
280 UNSPECIFIED_EVENT_TYPE_ERR = 0
281 };
282
283 unsigned short code;
284};
285
286
294class TDEHTML_EXPORT UIEvent : public Event {
295public:
296 UIEvent();
297 UIEvent(const UIEvent &other);
298 UIEvent(const Event &other);
299 UIEvent & operator = (const UIEvent &other);
300 UIEvent & operator = (const Event &other);
301 virtual ~UIEvent();
302
308 AbstractView view() const;
309
315 long detail() const;
316
321 int keyCode() const;
322
327 int charCode() const;
328
333 int pageX() const;
334 int pageY() const;
335
340 int layerX() const;
341 int layerY() const;
342
347 int which() const;
348
369 void initUIEvent(const DOMString &typeArg,
370 bool canBubbleArg,
371 bool cancelableArg,
372 const AbstractView &viewArg,
373 long detailArg);
374protected:
375 UIEvent(UIEventImpl *impl);
376};
377
378
379
380
399class TDEHTML_EXPORT MouseEvent : public UIEvent {
400public:
401 MouseEvent();
402 MouseEvent(const MouseEvent &other);
403 MouseEvent(const Event &other);
404 MouseEvent & operator = (const MouseEvent &other);
405 MouseEvent & operator = (const Event &other);
406 virtual ~MouseEvent();
407
413 long screenX() const;
414
420 long screenY() const;
421
427 long clientX() const;
428
434 long clientY() const;
435
440 bool ctrlKey() const;
441
447 bool shiftKey() const;
448
455 bool altKey() const;
456
463 bool metaKey() const;
464
475 unsigned short button() const;
476
484 Node relatedTarget() const;
485
525 void initMouseEvent(const DOMString &typeArg,
526 bool canBubbleArg,
527 bool cancelableArg,
528 const AbstractView &viewArg,
529 long detailArg,
530 long screenXArg,
531 long screenYArg,
532 long clientXArg,
533 long clientYArg,
534 bool ctrlKeyArg,
535 bool altKeyArg,
536 bool shiftKeyArg,
537 bool metaKeyArg,
538 unsigned short buttonArg,
539 const Node &relatedTargetArg);
540protected:
541 MouseEvent(MouseEventImpl *impl);
542};
543
544// Introduced in DOM Level 3:
555class TDEHTML_EXPORT TextEvent : public UIEvent {
556public:
557 TextEvent();
558 TextEvent(const TextEvent &other);
559 TextEvent(const Event &other);
560 TextEvent & operator = (const TextEvent &other);
561 TextEvent & operator = (const Event &other);
562 virtual ~TextEvent();
563
601 void initTextEvent(const DOMString &typeArg,
602 bool canBubbleArg,
603 bool cancelableArg,
604 const AbstractView &viewArg,
605 long detailArg,
606 const DOMString &outputStringArg,
607 unsigned long keyValArg,
608 unsigned long virtKeyValArg,
609 bool inputGeneratedArg,
610 bool numPadArg);
611
639 void initModifier(unsigned long modifierArg, bool valueArg);
640
657 bool inputGenerated() const;
658
666 unsigned long keyVal() const;
667
675 bool numPad() const;
676
686 DOMString outputString() const;
695 unsigned long virtKeyVal() const;
696
724 bool checkModifier(unsigned long modifierArg); // ### KDE 4: const!
725
726protected:
727 TextEvent(KeyEventBaseImpl *impl);
728};
729
730
738class TDEHTML_EXPORT MutationEvent : public Event {
739public:
740 MutationEvent();
741 MutationEvent(const MutationEvent &other);
742 MutationEvent(const Event &other);
743 MutationEvent & operator = (const MutationEvent &other);
744 MutationEvent & operator = (const Event &other);
745 virtual ~MutationEvent();
746
757 enum attrChangeType {
758 MODIFICATION = 1,
759 ADDITION = 2,
760 REMOVAL = 3
761 };
762
763
774 Node relatedNode() const;
775
782 DOMString prevValue() const;
783
789 DOMString newValue() const;
790
796 DOMString attrName() const;
797
804 unsigned short attrChange() const;
805
831 void initMutationEvent(const DOMString &typeArg,
832 bool canBubbleArg,
833 bool cancelableArg,
834 const Node &relatedNodeArg,
835 const DOMString &prevValueArg,
836 const DOMString &newValueArg,
837 const DOMString &attrNameArg,
838 unsigned short attrChangeArg);
839protected:
840 MutationEvent(MutationEventImpl *impl);
841};
842
843
844
845} //namespace
846#endif
DOM::AbstractView
Introduced in DOM Level 2.
Definition: dom2_views.h:41
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOM::EventException
Introduced in DOM Level 2:
Definition: dom2_events.h:263
DOM::EventException::EventExceptionCode
EventExceptionCode
An integer indicating the type of error generated.
Definition: dom2_events.h:279
DOM::EventListener
Introduced in DOM Level 2.
Definition: dom2_events.h:64
DOM::Event
Introduced in DOM Level 2.
Definition: dom2_events.h:111
DOM::Event::PhaseType
PhaseType
An integer indicating which phase of event flow is being processed.
Definition: dom2_events.h:133
DOM::MouseEvent
Introduced in DOM Level 2.
Definition: dom2_events.h:399
DOM::MutationEvent
Introduced in DOM Level 2.
Definition: dom2_events.h:738
DOM::MutationEvent::attrChangeType
attrChangeType
An integer indicating in which way the Attr was changed.
Definition: dom2_events.h:757
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:275
DOM::TextEvent
DOM::TextEvent The detail attribute inherited from UIEvent is used to indicate the number of keypress...
Definition: dom2_events.h:555
DOM::UIEvent
Introduced in DOM Level 2.
Definition: dom2_events.h:294
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:57
DOM::DOMTimeStamp
unsigned long long DOMTimeStamp
A DOMTimeStamp represents a number of milliseconds.
Definition: dom_node.h:987

tdehtml

Skip menu "tdehtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.9.4
This website is maintained by Timothy Pearson.