• Skip to content
  • Skip to link menu
KDE 4.0 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:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 78 of file qobject_binding.h.


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

 QObjectBinding (KJS::ExecState *exec, QObject *object)
virtual ~QObjectBinding ()
AccessFlags access () const
void setAccess (AccessFlags access)
void put (KJS::ExecState *exec, const KJS::Identifier &propertyName, KJS::JSValue *value, int attr=KJS::None)
bool canPut (KJS::ExecState *exec, const KJS::Identifier &propertyName) const
bool getOwnPropertySlot (KJS::ExecState *exec, const KJS::Identifier &propertyName, KJS::PropertySlot &slot)
KJS::UString toString (KJS::ExecState *exec) const
KJS::UString className () const
void watchObject (QObject *object)
template<typename T>
T * qobject () const

Static Public Member Functions

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

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 93 of file qobject_binding.h.


Constructor & Destructor Documentation

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

Definition at line 227 of file qobject_binding.cpp.

QObjectBinding::~QObjectBinding (  )  [virtual]

Definition at line 251 of file qobject_binding.cpp.


Member Function Documentation

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

Definition at line 172 of file qobject_binding.cpp.

QObjectBinding::AccessFlags QObjectBinding::access (  )  const

Returns:
the defined Access flags.

Definition at line 310 of file qobject_binding.cpp.

void KJSEmbed::QObjectBinding::setAccess ( AccessFlags  access  ) 

Set the defined Access flags to access .

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

Set the value value of the property propertyName .

Reimplemented from KJS::JSObject.

Definition at line 320 of file qobject_binding.cpp.

bool QObjectBinding::canPut ( KJS::ExecState *  exec,
const KJS::Identifier &  propertyName 
) const [virtual]

Returns:
true if the property propertyName can be changed else false is returned.

Reimplemented from KJS::JSObject.

Definition at line 369 of file qobject_binding.cpp.

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

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

We return the callback in the property slot.

Reimplemented from KJS::JSObject.

Definition at line 279 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 295 of file qobject_binding.cpp.

KJS::UString QObjectBinding::toString ( KJS::ExecState *  exec  )  const [virtual]

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 390 of file qobject_binding.cpp.

KJS::UString QObjectBinding::className (  )  const [virtual]

Returns:
the QObject's classname.

For example for a QWidget-instance the string "QWidget" is returned.

Reimplemented from KJSEmbed::ObjectBinding.

Definition at line 385 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 274 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 176 of file qobject_binding.h.


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
  • Related Pages

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
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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