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

kjsembed

  • kjsembed
  • kjsembed
value_binding.cpp
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#include "value_binding.h"
23#include "static_binding.h"
24
25using namespace KJSEmbed;
26
27const KJS::ClassInfo ValueBinding::info = { "ValueBinding", 0, 0, 0 };
28
29KJS::JSValue *callValueType( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args )
30{
31 Q_UNUSED(args);
32 KJSEmbed::ValueBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::ValueBinding>(exec, self );
33 if( imp )
34 {
35 return KJS::jsString( imp->className().ascii() );
36 }
37 return KJS::jsNull();
38}
39
40const Method ValueFactory::ValueMethods[] =
41{
42 {"type", 0, KJS::DontDelete|KJS::ReadOnly, &callValueType },
43 //{"cast", 1, KJS::DontDelete|KJS::ReadOnly, &callPointerCast },
44 //{"toString", 0, KJS::DontDelete|KJS::ReadOnly, &callPointerToString },
45 {0, 0, 0, 0 }
46};
47
48const Method *ValueFactory::methods()
49{
50 return ValueMethods;
51}
52
53ValueBinding::ValueBinding( KJS::ExecState *exec, const char *typeName)
54 : ProxyBinding( exec ),
55 m_value(0),
56 m_name(typeName)
57{
58 StaticBinding::publish( exec, this, ValueFactory::methods() );
59}
60
61ValueBinding::~ValueBinding()
62{
63 delete m_value;
64}
65
66KJS::UString ValueBinding::toString(KJS::ExecState *exec) const
67{
68 Q_UNUSED(exec);
69 return m_value->type().name();
70}
71
72//kate: indent-spaces on; indent-width 4; replace-tabs on; indent-mode cstyle;
KJSEmbed::ProxyBinding
Definition: binding_support.h:248
KJSEmbed::StaticBinding::publish
static void publish(KJS::ExecState *exec, KJS::JSObject *object, const Method *methods)
Publishes an array of Methods to an object.
Definition: static_binding.cpp:60
KJSEmbed::ValueBinding
Value binding implementation.
Definition: value_binding.h:104
KJSEmbed::ValueBinding::~ValueBinding
virtual ~ValueBinding()
Definition: value_binding.cpp:61
KJSEmbed::ValueBinding::info
static const KJS::ClassInfo info
Definition: value_binding.h:152
KJSEmbed::ValueBinding::ValueBinding
ValueBinding(KJS::ExecState *exec, const char *typeName, T val)
Definition: value_binding.h:107
KJSEmbed::ValueBinding::className
KJS::UString className() const
Definition: value_binding.h:118
KJSEmbed::ValueBinding::toString
KJS::UString toString(KJS::ExecState *exec) const
Definition: value_binding.cpp:66
KJSEmbed::ValueFactory::methods
static const Method * methods()
Definition: value_binding.cpp:48
KJSEmbed::ValueFactory::ValueMethods
static const Method ValueMethods[]
Definition: value_binding.h:96
KJSEmbed
Definition: application.h:33
KJS::jsString
KJS::JSCell * jsString(const QString &s)
Definition: kjseglobal.h:73
static_binding.h
KJSEmbed::Method
Method structure.
Definition: binding_support.h:295
PointerBase::type
virtual const std::type_info & type() const =0
callValueType
KJS::JSValue * callValueType(KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args)
Definition: value_binding.cpp:29
value_binding.h
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