• 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
685
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::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::handleEvent
virtual void handleEvent(Event &evt)
This method is called whenever an event occurs of the type for which the EventListener interface was ...
Definition dom2_events.cpp:37
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::MouseEvent::clientX
long clientX() const
The horizontal coordinate at which the event occurred relative to the DOM implementation's client are...
Definition dom2_events.cpp:399
DOM::MouseEvent::altKey
bool altKey() const
Used to indicate whether the 'alt' key was depressed during the firing of the event.
Definition dom2_events.cpp:431
DOM::MouseEvent::clientY
long clientY() const
The vertical coordinate at which the event occurred relative to the DOM implementation's client area.
Definition dom2_events.cpp:407
DOM::MouseEvent::screenX
long screenX() const
The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate...
Definition dom2_events.cpp:383
DOM::MouseEvent::relatedTarget
Node relatedTarget() const
Used to identify a secondary EventTarget related to a UI event.
Definition dom2_events.cpp:455
DOM::MouseEvent::shiftKey
bool shiftKey() const
Used to indicate whether the 'shift' key was depressed during the firing of the event.
Definition dom2_events.cpp:423
DOM::MouseEvent::metaKey
bool metaKey() const
Used to indicate whether the 'meta' key was depressed during the firing of the event.
Definition dom2_events.cpp:439
DOM::MouseEvent::initMouseEvent
void initMouseEvent(const DOMString &typeArg, bool canBubbleArg, bool cancelableArg, const AbstractView &viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, unsigned short buttonArg, const Node &relatedTargetArg)
The initMouseEvent method is used to initialize the value of a MouseEvent created through the Documen...
Definition dom2_events.cpp:463
DOM::MouseEvent::button
unsigned short button() const
During mouse events caused by the depression or release of a mouse button, button is used to indicate...
Definition dom2_events.cpp:447
DOM::MouseEvent::ctrlKey
bool ctrlKey() const
Used to indicate whether the 'ctrl' key was depressed during the firing of the event.
Definition dom2_events.cpp:415
DOM::MouseEvent::screenY
long screenY() const
The vertical coordinate at which the event occurred relative to the origin of the screen coordinate s...
Definition dom2_events.cpp:391
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::TextEvent::numPad
bool numPad() const
numPad of type boolean
Definition dom2_events.cpp:616
DOM::TextEvent::keyVal
unsigned long keyVal() const
keyVal of type unsigned long
Definition dom2_events.cpp:560
DOM::TextEvent::initModifier
void initModifier(unsigned long modifierArg, bool valueArg)
initModifier
Definition dom2_events.cpp:592
DOM::TextEvent::outputString
DOMString outputString() const
outputString of type DOMString
Definition dom2_events.cpp:568
DOM::TextEvent::initTextEvent
void initTextEvent(const DOMString &typeArg, bool canBubbleArg, bool cancelableArg, const AbstractView &viewArg, long detailArg, const DOMString &outputStringArg, unsigned long keyValArg, unsigned long virtKeyValArg, bool inputGeneratedArg, bool numPadArg)
initTextEvent
Definition dom2_events.cpp:529
DOM::TextEvent::virtKeyVal
unsigned long virtKeyVal() const
virtKeyVal of type unsigned long
Definition dom2_events.cpp:584
DOM::TextEvent::inputGenerated
bool inputGenerated() const
inputGenerated of type boolean
Definition dom2_events.cpp:608
DOM::UIEvent
Introduced in DOM Level 2.
Definition dom2_events.h:294
DOM::UIEvent::view
AbstractView view() const
The view attribute identifies the AbstractView from which the event was generated.
Definition dom2_events.cpp:234
DOM::UIEvent::layerX
int layerX() const
Non-standard extensions to support Netscape-style layerX and layerY event properties.
Definition dom2_events.cpp:293
DOM::UIEvent::detail
long detail() const
Specifies some detail information about the Event, depending on the type of event.
Definition dom2_events.cpp:242
DOM::UIEvent::charCode
int charCode() const
Non-standard extension to support IE-style charCode event property.
Definition dom2_events.cpp:260
DOM::UIEvent::keyCode
int keyCode() const
Non-standard extension to support IE-style keyCode event property.
Definition dom2_events.cpp:250
DOM::UIEvent::which
int which() const
Non-standard extension to support Netscape-style "which" event property.
Definition dom2_events.cpp:313
DOM::UIEvent::initUIEvent
void initUIEvent(const DOMString &typeArg, bool canBubbleArg, bool cancelableArg, const AbstractView &viewArg, long detailArg)
The initUIEvent method is used to initialize the value of a UIEvent created through the DocumentEvent...
Definition dom2_events.cpp:329
DOM::UIEvent::pageX
int pageX() const
Non-standard extensions to support Netscape-style pageX and pageY event properties.
Definition dom2_events.cpp:271
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.15.0
This website is maintained by Timothy Pearson.