29 namespace JSEventUtils
31 KJS::JSObject *
event( KJS::ExecState *exec,
const QEvent *ev )
41 case QEvent::MouseButtonPress:
42 case QEvent::MouseButtonRelease:
43 case QEvent::MouseButtonDblClick:
44 case QEvent::MouseMove:
49 case QEvent::KeyPress:
50 case QEvent::KeyRelease:
54 case QEvent::FocusOut:
71 case QEvent::ParentChange:
72 case QEvent::ParentAboutToChange:
73 case QEvent::ThreadChange:
74 case QEvent::WindowActivate:
75 case QEvent::WindowDeactivate:
76 case QEvent::ShowToParent:
77 case QEvent::HideToParent:
79 case QEvent::WindowTitleChange:
80 case QEvent::WindowIconChange:
81 case QEvent::ApplicationWindowIconChange:
82 case QEvent::ApplicationFontChange:
83 case QEvent::ApplicationLayoutDirectionChange:
84 case QEvent::ApplicationPaletteChange:
85 case QEvent::PaletteChange:
86 case QEvent::Clipboard:
88 case QEvent::MetaCall:
91 case QEvent::DeferredDelete:
92 case QEvent::DragEnter:
93 case QEvent::DragMove:
94 case QEvent::DragLeave:
96 case QEvent::DragResponse:
97 case QEvent::ChildAdded:
98 case QEvent::ChildPolished:
99 case QEvent::ChildRemoved:
100 case QEvent::ShowWindowRequest:
101 case QEvent::PolishRequest:
103 case QEvent::LayoutRequest:
104 case QEvent::UpdateRequest:
105 case QEvent::EmbeddingControl:
106 case QEvent::ActivateControl:
107 case QEvent::DeactivateControl:
108 case QEvent::ContextMenu:
109 case QEvent::InputMethod:
110 case QEvent::AccessibilityPrepare:
111 case QEvent::TabletMove:
112 case QEvent::LocaleChange:
113 case QEvent::LanguageChange:
114 case QEvent::LayoutDirectionChange:
116 case QEvent::TabletPress:
117 case QEvent::TabletRelease:
118 case QEvent::OkRequest:
119 case QEvent::HelpRequest:
120 case QEvent::IconDrag:
121 case QEvent::FontChange:
122 case QEvent::EnabledChange:
123 case QEvent::ActivationChange:
124 case QEvent::StyleChange:
125 case QEvent::IconTextChange:
126 case QEvent::ModifiedChange:
127 case QEvent::MouseTrackingChange:
128 case QEvent::WindowBlocked:
129 case QEvent::WindowUnblocked:
130 case QEvent::WindowStateChange:
131 case QEvent::ToolTip:
132 case QEvent::WhatsThis:
133 case QEvent::StatusTip:
134 case QEvent::ActionChanged:
135 case QEvent::ActionAdded:
136 case QEvent::ActionRemoved:
137 case QEvent::FileOpen:
138 case QEvent::Shortcut:
139 case QEvent::ShortcutOverride:
140 case QEvent::WhatsThisClicked:
141 case QEvent::ToolBarChange:
142 case QEvent::ApplicationActivated:
143 case QEvent::ApplicationDeactivated:
144 case QEvent::QueryWhatsThis:
145 case QEvent::EnterWhatsThisMode:
146 case QEvent::LeaveWhatsThisMode:
147 case QEvent::ZOrderChange:
148 case QEvent::HoverEnter:
149 case QEvent::HoverLeave:
150 case QEvent::HoverMove:
151 case QEvent::AccessibilityHelp:
152 case QEvent::AccessibilityDescription:
162 evnt->put( exec,
"type", KJS::jsNumber( (
int) ev->
type()) );
163 evnt->put( exec,
"spontaneous", KJS::jsBoolean(ev->
spontaneous()) );
164 evnt->put( exec,
"isAccepted", KJS::jsBoolean(ev->
isAccepted()) );
171 iev->put( exec,
"modifiers", KJS::jsNumber( ev->
modifiers() ));
180 mev->put( exec,
"x", KJS::jsNumber( ev->
x() ));
181 mev->put( exec,
"y", KJS::jsNumber( ev->
y() ));
184 mev->put( exec,
"globalX", KJS::jsNumber( ev->
globalX() ));
185 mev->put( exec,
"globalY", KJS::jsNumber( ev->
globalY() ));
187 mev->put( exec,
"button", KJS::jsNumber(ev->
button()) );
188 mev->put( exec,
"buttons", KJS::jsNumber(ev->
buttons()) );
206 kev->put( exec,
"key", KJS::jsNumber(ev->
key()) );
208 kev->put( exec,
"isAutoRepeat", KJS::jsBoolean(ev->
isAutoRepeat()) );
209 kev->put( exec,
"count", KJS::jsNumber( ev->
count()) );
220 qev->put( exec,
"replacementStart", KJS::jsNumber(ev->
replacementStart()) );
237 cev->put( exec,
"isAccepted", KJS::jsBoolean(ev->
isAccepted()) );
254 wev->put( exec,
"delta", KJS::jsNumber(ev->
delta()) );
257 wev->put( exec,
"x", KJS::jsNumber(ev->
x()) );
258 wev->put( exec,
"y", KJS::jsNumber(ev->
y()) );
259 wev->put( exec,
"globalX", KJS::jsNumber(ev->
globalX()) );
260 wev->put( exec,
"globalY", KJS::jsNumber(ev->
globalY()) );
261 wev->put( exec,
"orientation", KJS::jsNumber(ev->
orientation()) );
262 wev->put( exec,
"buttons", KJS::jsNumber(ev->
buttons()) );
272 dev->put( exec,
"dropAction", KJS::jsNumber( (
int)(ev->
dropAction()) ) );
273 dev->put( exec,
"keyboardModifiers", KJS::jsNumber( (
int)(ev->
keyboardModifiers()) ) );
274 dev->put( exec,
"possibleActions", KJS::jsNumber( (
int)(ev->
possibleActions()) ) );
275 dev->put( exec,
"proposedAction", KJS::jsNumber( (
int)(ev->
proposedAction()) ) );
289 dev->put( exec,
"timerId", KJS::jsNumber(ev->
timerId()) );
296 cxev->put( exec,
"x", KJS::jsNumber(ev->
x()) );
297 cxev->put( exec,
"y", KJS::jsNumber(ev->
y()) );
298 cxev->put( exec,
"globalX", KJS::jsNumber(ev->
globalX()) );
299 cxev->put( exec,
"globalY", KJS::jsNumber(ev->
globalY()) );
302 cxev->put( exec,
"reason", KJS::jsNumber((
int)ev->
reason()) );
309 dev->put( exec,
"gotFocus", KJS::jsBoolean( ev->
gotFocus() ) );
310 dev->put( exec,
"lostFocus", KJS::jsBoolean( ev->
lostFocus() ));
312 dev->put( exec,
"reason", KJS::jsNumber((
int) const_cast<QFocusEvent*>( ev )->reason() ) );
const QPoint & pos() const
Qt::DropActions possibleActions() const
Qt::DropAction proposedAction() const
const QPoint & globalPos() const
const QPoint & pos() const
const QPoint & oldPos() const
bool isAutoRepeat() const
const QPoint & pos() const
KJS::JSObject * event(KJS::ExecState *exec, const QEvent *ev)
const QRect & rect() const
const QPoint & globalPos() const
KJS::JSObject * convertEvent(KJS::ExecState *exec, const QEvent *ev)
Qt::Orientation orientation() const
const QSize & oldSize() const
const QSize & size() const
KJS::JSCell * jsString(const QString &s)
Qt::DropAction dropAction() const
KJSEMBED_EXPORT KJS::JSValue * convertToValue(KJS::ExecState *exec, const QVariant &value)
Convert a QVariant to a KJS::JSValue.
const QPoint & pos() const
Qt::KeyboardModifiers keyboardModifiers() const