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

kjsembed

  • kjsembed
  • kjsembed
static_binding.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2005, 2006 Ian Reinhart Geiser <geiseri@kde.org>
3 Copyright (C) 2005, 2006 Matt Broadstone <mbroadst@gmail.com>
4 Copyright (C) 2005, 2006 Richard J. Moore <rich@kde.org>
5 Copyright (C) 2005, 2006 Erik L. Bunce <kde@bunce.us>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef STATIC_BINDING_H
24#define STATIC_BINDING_H
25#include <QtCore/QHash>
26
27#include <kdemacros.h>
28#include <kjs/function.h>
29
30#include "binding_support.h"
31
32#define LengthFlags KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum
33
34namespace KJSEmbed
35{
39class KJSEMBED_EXPORT StaticBinding : public KJS::InternalFunctionImp
40{
41public:
45 StaticBinding(KJS::ExecState *exec, const Method *method );
49 KJS::JSValue *callAsFunction( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args );
50 bool implementsConstruct() const { return false; }
51
58 static void publish( KJS::ExecState *exec, KJS::JSObject *object, const Method *methods );
59
60protected:
61 const Method *m_method;
62};
63
68class KJSEMBED_EXPORT StaticConstructor : public KJS::InternalFunctionImp
69{
70public:
74 StaticConstructor(KJS::ExecState *exec, const Constructor *constructor );
75
83 void addStaticMethods( KJS::ExecState *exec, const Method *methods );
84
85
86 bool implementsConstruct() const { return true; }
91 KJS::JSObject *construct( KJS::ExecState *exec, const KJS::List &args );
92
93 KJS::JSValue *callAsFunction( KJS::ExecState *exec, KJS::JSObject * /*self*/, const KJS::List &args ) {
94 return construct(exec, args);
95 }
96
97 void setDefaultValue( KJS::JSValue *value );
98 KJS::JSValue *defaultValue( KJS::ExecState *exec, KJS::JSType hint ) const;
99
103 static KJS::JSObject *add( KJS::ExecState *exec, KJS::JSObject *object, const Constructor *constructor );
116 static KJS::JSObject *construct( KJS::ExecState *exec, KJS::JSObject *parent,
117 const KJS::UString &className, const KJS::List &args = KJS::List() );
118
119 static KJS::JSObject* bind(KJS::ExecState* exec, const QString &className, PointerBase& objPtr);
120 static const Method *methods( const KJS::UString &className );
121 static const Constructor *constructor( const KJS::UString &className );
122
123protected:
124 const Constructor *m_constructor;
125
126private:
127 KJS::JSValue *m_default;
128
129};
130
131}
132
133#endif
134
135//kate: indent-spaces on; indent-width 4; replace-tabs on; indent-mode cstyle;
binding_support.h
KJSEmbed::StaticBinding
A binding method that is used in VariantBinding and ObjectBinding.
Definition: static_binding.h:40
KJSEmbed::StaticBinding::implementsConstruct
bool implementsConstruct() const
Definition: static_binding.h:50
KJSEmbed::StaticBinding::m_method
const Method * m_method
Definition: static_binding.h:61
KJSEmbed::StaticConstructor
A special method that will create other objects.
Definition: static_binding.h:69
KJSEmbed::StaticConstructor::callAsFunction
KJS::JSValue * callAsFunction(KJS::ExecState *exec, KJS::JSObject *, const KJS::List &args)
Definition: static_binding.h:93
KJSEmbed::StaticConstructor::addStaticMethods
void addStaticMethods(KJS::ExecState *exec, const Method *methods)
Add static methods to the object.
KJSEmbed::StaticConstructor::m_constructor
const Constructor * m_constructor
Definition: static_binding.h:124
KJSEmbed::StaticConstructor::implementsConstruct
bool implementsConstruct() const
Definition: static_binding.h:86
KJSEMBED_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32
KJSEmbed
Definition: application.h:33
parent
QObject * parent
Definition: qaction_binding.cpp:48
className
END_QOBJECT_METHOD QByteArray className
Definition: qobject_binding.cpp:832
value
QVariant value
Definition: settings.cpp:35
KJSEmbed::Constructor
Definition: binding_support.h:346
KJSEmbed::Method
Method structure.
Definition: binding_support.h:295
PointerBase
Definition: pointer.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

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