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

kjsembed

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

#include <qobject_binding.h>

Inheritance diagram for KJSEmbed::QObjectBinding:
Inheritance graph
[legend]

Public Types

enum  Access {
  None = 0x00, ScriptableSlots = 0x01, NonScriptableSlots = 0x02, PrivateSlots = 0x04,
  ProtectedSlots = 0x08, PublicSlots = 0x10, AllSlots = ScriptableSlots|NonScriptableSlots|PrivateSlots|ProtectedSlots|PublicSlots, ScriptableSignals = 0x100,
  NonScriptableSignals = 0x200, PrivateSignals = 0x400, ProtectedSignals = 0x800, PublicSignals = 0x1000,
  AllSignals = ScriptableSignals|NonScriptableSignals|PrivateSignals|ProtectedSignals|PublicSignals, ScriptableProperties = 0x10000, NonScriptableProperties = 0x20000, AllProperties = ScriptableProperties|NonScriptableProperties,
  GetParentObject = 0x100000, SetParentObject = 0x200000, ChildObjects = 0x400000, AllObjects = GetParentObject|SetParentObject|ChildObjects
}
 
- Public Types inherited from KJSEmbed::ObjectBinding
enum  Ownership { CPPOwned, QObjOwned, JSOwned }
 

Public Member Functions

 QObjectBinding (KJS::ExecState *exec, QObject *object)
 
virtual ~QObjectBinding ()
 
AccessFlags access () const
 
bool canPut (KJS::ExecState *exec, const KJS::Identifier &propertyName) const
 
KJS::UString className () const
 
bool getOwnPropertySlot (KJS::ExecState *exec, const KJS::Identifier &propertyName, KJS::PropertySlot &slot)
 
void put (KJS::ExecState *exec, const KJS::Identifier &propertyName, KJS::JSValue *value, int attr=KJS::None)
 
template<typename T >
T * qobject () const
 
void setAccess (AccessFlags access)
 
KJS::UString toString (KJS::ExecState *exec) const
 
void watchObject (QObject *object)
 
- Public Member Functions inherited from KJSEmbed::ObjectBinding
template<typename T >
 ObjectBinding (KJS::ExecState *exec, const char *typeName, T *ptr)
 
virtual ~ObjectBinding ()
 
KJS::UString className () const
 
template<typename T >
T * object () const
 
Ownership ownership () const
 
template<typename T >
void setObject (T *ptr)
 
void setOwnership (Ownership owner)
 
KJS::UString toString (KJS::ExecState *exec) const
 
KJS::JSType type () const
 
const char * typeName () const
 
void * voidStar () const
 
- Public Member Functions inherited from KJSEmbed::ProxyBinding
 ProxyBinding (KJS::ExecState *exec)
 
virtual ~ProxyBinding ()
 
bool implementsCall () const
 
bool implementsConstruct () const
 

Static Public Member Functions

static KJS::JSValue * propertyGetter (KJS::ExecState *exec, KJS::JSObject *, const KJS::Identifier &name, const KJS::PropertySlot &)
 
static void publishQObject (KJS::ExecState *exec, KJS::JSObject *target, QObject *object)
 

Additional Inherited Members

- Static Public Attributes inherited from KJSEmbed::ObjectBinding
static const KJS::ClassInfo info = { "ObjectBinding", 0, 0, 0 }
 

Detailed Description

Definition at line 79 of file qobject_binding.h.

Member Enumeration Documentation

enum KJSEmbed::QObjectBinding::Access

Enumeration of access-flags that could be OR-combined to define what parts of the QObject should be published.

Default is AllSlots|AllSignals|AllProperties|AllObjects what means that everything got published, even e.g. private slots.

Enumerator
None 

Don't publish anything.

ScriptableSlots 

Publish slots that have Q_SCRIPTABLE defined.

NonScriptableSlots 

Publish slots that don't have Q_SCRIPTABLE defined.

PrivateSlots 

Publish private slots.

ProtectedSlots 

Publish protected slots.

PublicSlots 

Publish public slots.

AllSlots 
ScriptableSignals 

Publish signals that have Q_SCRIPTABLE defined.

NonScriptableSignals 

Publish signals that don't have Q_SCRIPTABLE defined.

PrivateSignals 

Publish private signals.

ProtectedSignals 

Publish protected signals.

PublicSignals 

Publish public signals.

AllSignals 
ScriptableProperties 

Publish properties that have Q_SCRIPTABLE defined.

NonScriptableProperties 

Publish properties that don't have Q_SCRIPTABLE defined.

AllProperties 
GetParentObject 

Provide access to the parent QObject the QObject has.

SetParentObject 

Be able to set the parent QObject the QObject has.

ChildObjects 

Provide access to the child QObject's the QObject has.

AllObjects 

Definition at line 94 of file qobject_binding.h.

Constructor & Destructor Documentation

QObjectBinding::QObjectBinding ( KJS::ExecState *  exec,
QObject *  object 
)

Definition at line 229 of file qobject_binding.cpp.

QObjectBinding::~QObjectBinding ( )
virtual

Definition at line 253 of file qobject_binding.cpp.

Member Function Documentation

QObjectBinding::AccessFlags QObjectBinding::access ( ) const
Returns
the defined Access flags.

Definition at line 312 of file qobject_binding.cpp.

bool QObjectBinding::canPut ( KJS::ExecState *  exec,
const KJS::Identifier &  propertyName 
) const
Returns
true if the property propertyName can be changed else false is returned.

Definition at line 371 of file qobject_binding.cpp.

KJS::UString QObjectBinding::className ( ) const
Returns
the QObject's classname. For example for a QWidget-instance the string "QWidget" is returned.

Definition at line 387 of file qobject_binding.cpp.

bool QObjectBinding::getOwnPropertySlot ( KJS::ExecState *  exec,
const KJS::Identifier &  propertyName,
KJS::PropertySlot &  slot 
)

Called to ask if we have a callback for the named property.

We return the callback in the property slot.

Definition at line 281 of file qobject_binding.cpp.

KJS::JSValue * QObjectBinding::propertyGetter ( KJS::ExecState *  exec,
KJS::JSObject *  ,
const KJS::Identifier &  name,
const KJS::PropertySlot &  slot 
)
static

Callback used to get properties.

Definition at line 297 of file qobject_binding.cpp.

void QObjectBinding::publishQObject ( KJS::ExecState *  exec,
KJS::JSObject *  target,
QObject *  object 
)
static

Definition at line 174 of file qobject_binding.cpp.

void QObjectBinding::put ( KJS::ExecState *  exec,
const KJS::Identifier &  propertyName,
KJS::JSValue *  value,
int  attr = KJS::None 
)

Set the value value of the property propertyName .

Definition at line 322 of file qobject_binding.cpp.

template<typename T >
T* KJSEmbed::QObjectBinding::qobject ( ) const
inline
Returns
the internal object as a pointer to type T to the internal object that is derived from QObject.

Definition at line 177 of file qobject_binding.h.

void QObjectBinding::setAccess ( AccessFlags  access)

Set the defined Access flags to access .

Definition at line 317 of file qobject_binding.cpp.

KJS::UString QObjectBinding::toString ( KJS::ExecState *  exec) const
Returns
a string-representation of the QObject. For example for a QWidget-instance that has the QObject::objectName "mywidget" the string "mywidget (QWidget)" is returned.

Definition at line 392 of file qobject_binding.cpp.

void QObjectBinding::watchObject ( QObject *  object)

Add the QObject object to the internal QObjectCleanupHandler to watch the lifetime of the QObject to know when the QObject got deleted.

Definition at line 276 of file qobject_binding.cpp.


The documentation for this class was generated from the following files:
  • qobject_binding.h
  • qobject_binding.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