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

kjsembed

KJSEmbed::QObjectBinding

KJSEmbed::QObjectBinding Class Reference

#include <qobject_binding.h>

Inheritance diagram for KJSEmbed::QObjectBinding:
KJSEmbed::ObjectBinding KJSEmbed::ProxyBinding JSObject

List of all members.

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 Member Functions

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
 QObjectBinding (KJS::ExecState *exec, QObject *object)
void setAccess (AccessFlags access)
KJS::UString toString (KJS::ExecState *exec) const
void watchObject (QObject *object)
virtual ~QObjectBinding ()

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)

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.

Reimplemented from KJSEmbed::ObjectBinding.

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 KJSEmbed::QObjectBinding::setAccess ( AccessFlags  access  ) 

Set the defined Access flags to access .

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.

Reimplemented from KJSEmbed::ObjectBinding.

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

kjsembed

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal