• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
khtml_events.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef __khtml_events_h__
20#define __khtml_events_h__
21
22#include <kparts/event.h>
23
24#include "dom/dom_node.h"
25#include "dom/dom_string.h"
26
27namespace khtml
28{
29
30class KHTML_EXPORT MouseEvent : public KParts::Event
31{
32public:
33 MouseEvent( const char *name, QMouseEvent *qmouseEvent, int x, int y,
34 const DOM::DOMString &url, const DOM::DOMString& target,
35 const DOM::Node &innerNode);
36 virtual ~MouseEvent();
37
38 QMouseEvent *qmouseEvent() const { return m_qmouseEvent; }
39 int x() const { return m_x; }
40 int y() const { return m_y; }
41 int absX() const { return m_nodeAbsX; }
42 int absY() const { return m_nodeAbsY; }
43
44 DOM::DOMString url() const { return m_url; }
45 DOM::DOMString target() const { return m_target; }
46 DOM::Node innerNode() const { return m_innerNode; }
47
48 // return the offset of innerNode
49 long offset() const;
50
51private:
52 QMouseEvent *m_qmouseEvent;
53 int m_x;
54 int m_y;
55 int m_nodeAbsX, m_nodeAbsY;
56 DOM::DOMString m_url;
57 DOM::DOMString m_target;
58 DOM::Node m_innerNode;
59 class MouseEventPrivate;
60 MouseEventPrivate *d;
61};
62
63class KHTML_EXPORT MousePressEvent : public MouseEvent
64{
65public:
66 MousePressEvent( QMouseEvent *mouseEvent, int x, int y,
67 const DOM::DOMString &url, const DOM::DOMString& target,
68 const DOM::Node &innerNode)
69 : MouseEvent( s_strMousePressEvent, mouseEvent, x, y, url, target, innerNode )
70 {}
71
72 static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMousePressEvent ); }
73
74
75private:
76 static const char *s_strMousePressEvent;
77};
78
79class KHTML_EXPORT MouseDoubleClickEvent : public MouseEvent
80{
81public:
82 // clickCount is 3 for a triple-click event
83 MouseDoubleClickEvent( QMouseEvent *mouseEvent, int x, int y,
84 const DOM::DOMString &url, const DOM::DOMString& target,
85 const DOM::Node &innerNode, int clickCount = 2 )
86 : MouseEvent( s_strMouseDoubleClickEvent, mouseEvent, x, y, url, target, innerNode ),
87 m_clickCount( clickCount )
88 {}
89
90 static bool test( const QEvent *event )
91 { return KParts::Event::test( event, s_strMouseDoubleClickEvent ); }
92
93 int clickCount() const { return m_clickCount; }
94
95private:
96 int m_clickCount;
97 static const char *s_strMouseDoubleClickEvent;
98};
99
100class KHTML_EXPORT MouseMoveEvent : public MouseEvent
101{
102public:
103 MouseMoveEvent( QMouseEvent *mouseEvent, int x, int y,
104 const DOM::DOMString &url, const DOM::DOMString& target,
105 const DOM::Node &innerNode)
106 : MouseEvent( s_strMouseMoveEvent, mouseEvent, x, y, url, target, innerNode )
107 {}
108
109 static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMouseMoveEvent ); }
110
111private:
112 static const char *s_strMouseMoveEvent;
113};
114
115class KHTML_EXPORT MouseReleaseEvent : public MouseEvent
116{
117public:
118 MouseReleaseEvent( QMouseEvent *mouseEvent, int x, int y,
119 const DOM::DOMString &url, const DOM::DOMString& target,
120 const DOM::Node &innerNode, long = 0 )
121 : MouseEvent( s_strMouseReleaseEvent, mouseEvent, x, y, url, target, innerNode )
122 {}
123
124 static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMouseReleaseEvent ); }
125
126private:
127 static const char *s_strMouseReleaseEvent;
128};
129
130class KHTML_EXPORT DrawContentsEvent : public KParts::Event
131{
132public:
133 DrawContentsEvent( QPainter *painter, int clipx, int clipy, int clipw, int cliph );
134 virtual ~DrawContentsEvent();
135
136 QPainter *painter() const { return m_painter; }
137 int clipx() const { return m_clipx; }
138 int clipy() const { return m_clipy; }
139 int clipw() const { return m_clipw; }
140 int cliph() const { return m_cliph; }
141
142 static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strDrawContentsEvent ); }
143
144private:
145 QPainter *m_painter;
146 int m_clipx;
147 int m_clipy;
148 int m_clipw;
149 int m_cliph;
150 class DrawContentsEventPrivate;
151 DrawContentsEventPrivate *d;
152 static const char *s_strDrawContentsEvent;
153};
154
155}
156
157#endif
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:271
KParts::Event
KParts::Event::test
static bool test(const QEvent *event)
QEvent
khtml::DrawContentsEvent
Definition: khtml_events.h:131
khtml::DrawContentsEvent::test
static bool test(const QEvent *event)
Definition: khtml_events.h:142
khtml::DrawContentsEvent::clipx
int clipx() const
Definition: khtml_events.h:137
khtml::DrawContentsEvent::painter
QPainter * painter() const
Definition: khtml_events.h:136
khtml::DrawContentsEvent::cliph
int cliph() const
Definition: khtml_events.h:140
khtml::DrawContentsEvent::clipw
int clipw() const
Definition: khtml_events.h:139
khtml::DrawContentsEvent::clipy
int clipy() const
Definition: khtml_events.h:138
khtml::MouseDoubleClickEvent
Definition: khtml_events.h:80
khtml::MouseDoubleClickEvent::test
static bool test(const QEvent *event)
Definition: khtml_events.h:90
khtml::MouseDoubleClickEvent::clickCount
int clickCount() const
Definition: khtml_events.h:93
khtml::MouseDoubleClickEvent::MouseDoubleClickEvent
MouseDoubleClickEvent(QMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString &target, const DOM::Node &innerNode, int clickCount=2)
Definition: khtml_events.h:83
khtml::MouseEvent
Definition: khtml_events.h:31
khtml::MouseEvent::x
int x() const
Definition: khtml_events.h:39
khtml::MouseEvent::qmouseEvent
QMouseEvent * qmouseEvent() const
Definition: khtml_events.h:38
khtml::MouseEvent::y
int y() const
Definition: khtml_events.h:40
khtml::MouseEvent::target
DOM::DOMString target() const
Definition: khtml_events.h:45
khtml::MouseEvent::innerNode
DOM::Node innerNode() const
Definition: khtml_events.h:46
khtml::MouseEvent::url
DOM::DOMString url() const
Definition: khtml_events.h:44
khtml::MouseEvent::absY
int absY() const
Definition: khtml_events.h:42
khtml::MouseEvent::absX
int absX() const
Definition: khtml_events.h:41
khtml::MouseMoveEvent
Definition: khtml_events.h:101
khtml::MouseMoveEvent::test
static bool test(const QEvent *event)
Definition: khtml_events.h:109
khtml::MouseMoveEvent::MouseMoveEvent
MouseMoveEvent(QMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString &target, const DOM::Node &innerNode)
Definition: khtml_events.h:103
khtml::MousePressEvent
Definition: khtml_events.h:64
khtml::MousePressEvent::test
static bool test(const QEvent *event)
Definition: khtml_events.h:72
khtml::MousePressEvent::MousePressEvent
MousePressEvent(QMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString &target, const DOM::Node &innerNode)
Definition: khtml_events.h:66
khtml::MouseReleaseEvent
Definition: khtml_events.h:116
khtml::MouseReleaseEvent::test
static bool test(const QEvent *event)
Definition: khtml_events.h:124
khtml::MouseReleaseEvent::MouseReleaseEvent
MouseReleaseEvent(QMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString &target, const DOM::Node &innerNode, long=0)
Definition: khtml_events.h:118
dom_node.h
dom_string.h
event.h
d
#define d
Definition: khtmlfind.cpp:42
name
const char * name(StandardAction id)
khtml
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal