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
30
namespace
DOM {
31
32
class
Event;
33
class
EventException;
34
class
UIEvent;
35
class
MouseEvent;
36
class
TextEvent;
37
class
MutationEvent;
38
class
AbstractView;
39
40
class
EventListenerImpl;
41
class
EventImpl;
42
class
UIEventImpl;
43
class
MouseEventImpl;
44
class
KeyEventBaseImpl;
45
class
MutationEventImpl;
46
47
48
64
class
TDEHTML_EXPORT
EventListener
:
public
DomShared {
65
public
:
66
EventListener
();
67
virtual
~
EventListener
();
68
78
virtual
void
handleEvent(
Event
&evt);
79
88
virtual
DOMString
eventListenerType();
89
90
protected
:
95
EventListenerImpl *impl;
96
};
97
98
111
class
TDEHTML_EXPORT
Event
{
112
friend
class
Document
;
113
friend
class
NodeImpl;
114
friend
class
DocumentImpl;
115
public
:
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
249
protected
:
250
Event
(EventImpl *i);
251
EventImpl *impl;
252
};
253
254
262
class
TDEHTML_EXPORT
EventException
263
{
264
public
:
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
294
class
TDEHTML_EXPORT
UIEvent
:
public
Event
{
295
public
:
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);
374
protected
:
375
UIEvent
(UIEventImpl *impl);
376
};
377
378
379
380
399
class
TDEHTML_EXPORT
MouseEvent
:
public
UIEvent
{
400
public
:
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);
540
protected
:
541
MouseEvent
(MouseEventImpl *impl);
542
};
543
544
// Introduced in DOM Level 3:
555
class
TDEHTML_EXPORT
TextEvent
:
public
UIEvent
{
556
public
:
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
726
protected
:
727
TextEvent
(KeyEventBaseImpl *impl);
728
};
729
730
738
class
TDEHTML_EXPORT
MutationEvent
:
public
Event
{
739
public
:
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);
839
protected
:
840
MutationEvent
(MutationEventImpl *impl);
841
};
842
843
844
845
}
//namespace
846
#endif
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
tdecore
tdeabc
tdecmshell
tdecore
tdefx
tdehtml
tdeinit
tdeio
bookmarks
httpfilter
kpasswdserver
kssl
tdeioslave
http
tdefile
tdeio
tdeioexec
tdemdi
tdemdi
tdenewstuff
tdeparts
tdeprint
tderandr
tderesources
tdespell2
tdesu
tdeui
tdeunittest
tdeutils
tdewallet