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

kjsembed

  • sources
  • kde-4.12
  • kdelibs
  • 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 
34 namespace KJSEmbed
35 {
39 class KJSEMBED_EXPORT StaticBinding : public KJS::InternalFunctionImp
40 {
41 public:
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 
60 protected:
61  const Method *m_method;
62 };
63 
68 class KJSEMBED_EXPORT StaticConstructor : public KJS::InternalFunctionImp
69 {
70 public:
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 
123 protected:
124  const Constructor *m_constructor;
125 
126 private:
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;
KJSEmbed::StaticBinding
A binding method that is used in VariantBinding and ObjectBinding.
Definition: static_binding.h:39
binding_support.h
className
END_QOBJECT_METHOD QByteArray className
Definition: qobject_binding.cpp:832
PointerBase
Definition: pointer.h:31
parent
QObject * parent
Definition: qaction_binding.cpp:48
KJSEmbed::Method
Method structure.
Definition: binding_support.h:294
KJSEmbed::Constructor
Definition: binding_support.h:345
DomElementNS::defaultValue
QString defaultValue
Definition: dom.cpp:506
KJSEmbed::StaticConstructor
A special method that will create other objects.
Definition: static_binding.h:68
KJSEmbed::StaticConstructor::implementsConstruct
bool implementsConstruct() const
Definition: static_binding.h:86
KJSEmbed::StaticConstructor::callAsFunction
KJS::JSValue * callAsFunction(KJS::ExecState *exec, KJS::JSObject *, const KJS::List &args)
Definition: static_binding.h:93
List
Definition: variant_binding.cpp:130
KJSEmbed::StaticBinding::m_method
const Method * m_method
Definition: static_binding.h:61
KJSEmbed::StaticConstructor::m_constructor
const Constructor * m_constructor
Definition: static_binding.h:124
value
QVariant value
Definition: settings.cpp:35
KJSEMBED_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32
KJSEmbed::StaticBinding::implementsConstruct
bool implementsConstruct() const
Definition: static_binding.h:50
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