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

kjsembed

  • KJSEmbed
  • JSEventMapper
Public Member Functions | Static Public Member Functions | List of all members
KJSEmbed::JSEventMapper Class Reference

#include <jseventmapper.h>

Public Member Functions

virtual ~JSEventMapper ()
 
void addEvent (const KJS::Identifier &name, QEvent::Type t)
 
KJS::Identifier findEventHandler (QEvent::Type t) const
 
QEvent::Type findEventType (const KJS::Identifier &name) const
 
bool isEventHandler (const KJS::Identifier &name) const
 

Static Public Member Functions

static JSEventMapper * mapper ()
 

Detailed Description

Maintains a map between the types of QEvent and the names of their event handlers.

This class handles all of the built in Qt events. To add your own custom events you can simply call mapper()->addEvent(KJS::Identifier("onMyCustomEvent"), QEvent::User + 1). Then in your javascript you can just do the following:

var myQObject = new QObjectBinding(this);
myQObject.onMyCustomEvent = function () { //do stuff ;}

In cases where you need to handle properties on your custom event, you will need to provide a binding to that event and KJSEmbed will create an instance of it for you as the argument in your event handler.

Author
Richard Moore, rich@.nosp@m.kde..nosp@m.org
Ian Reinhart Geiser, geise.nosp@m.ri@k.nosp@m.de.or.nosp@m.g

Definition at line 49 of file jseventmapper.h.

Constructor & Destructor Documentation

KJSEmbed::JSEventMapper::~JSEventMapper ( )
virtual

Definition at line 259 of file jseventmapper.cpp.

Member Function Documentation

void KJSEmbed::JSEventMapper::addEvent ( const KJS::Identifier &  name,
QEvent::Type  t 
)

Adds an event to the map.

The event handler has the specified name, and the event has the specified type.

Definition at line 263 of file jseventmapper.cpp.

KJS::Identifier KJSEmbed::JSEventMapper::findEventHandler ( QEvent::Type  t) const

Returns the name of the handler method for the specified event type.

Definition at line 279 of file jseventmapper.cpp.

QEvent::Type KJSEmbed::JSEventMapper::findEventType ( const KJS::Identifier &  name) const

Returns the type of the events handled by the specified handler.

Definition at line 269 of file jseventmapper.cpp.

bool KJSEmbed::JSEventMapper::isEventHandler ( const KJS::Identifier &  name) const

Returns true iff the specified name is the identifier for an event handler.

Definition at line 274 of file jseventmapper.cpp.

JSEventMapper * KJSEmbed::JSEventMapper::mapper ( )
static

Return the global event mapper.

Definition at line 284 of file jseventmapper.cpp.


The documentation for this class was generated from the following files:
  • jseventmapper.h
  • jseventmapper.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjsembed

Skip menu "kjsembed"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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