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

KParts

  • sources
  • kde-4.14
  • kdelibs
  • kparts
scriptableextension_p.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2010 Maksim Orlovich <maksim@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef kparts_scriptableextension_p_h
21 #define kparts_scriptableextension_p_h
22 
23 #include "browserextension.h"
24 
25 namespace KParts {
26 
27 // LiveConnectExtension -> ScriptableExtension adapter.
28 class ScriptableLiveConnectExtension: public ScriptableExtension
29 {
30  Q_OBJECT
31 public:
32  ScriptableLiveConnectExtension(QObject* parent, LiveConnectExtension* old);
33 
34  QVariant rootObject();
35  // enclosingObject: not applicable, plugins wouldn't have children
36 
37  // callAsFunction: we only have function rereferences.
38  QVariant callFunctionReference(ScriptableExtension* callerPrincipal, quint64 objId,
39  const QString& f, const ArgList& args);
40 
41  // callAsConstructor: unsupported by LC
42 
43  bool hasProperty(ScriptableExtension* callerPrincipal, quint64 objId, const QString& propName);
44 
45  QVariant get(ScriptableExtension* callerPrincipal, quint64 objId, const QString& propName);
46 
47  bool put(ScriptableExtension* callerPrincipal, quint64 objId, const QString& propName, const QVariant& value);
48 
49  // removeProperty: unsupported by LC
50  // enumerateProperties: unsupported by LC
51  // setException: unsupported by LC
52  // evaluateScript: unsupported by LC, though we have to
53  // route LC evaluation requests to our parent
54  // as appropriate
55 
56  void acquire(quint64 objid);
57  void release(quint64 objid);
58 private:
59  // LC uses 0-1 refcounting, we use arbitrary, so we need to call
60  // unregister when done.
61  QHash<quint64, int> refCounts;
62  LiveConnectExtension* wrapee;
63 
64  // also registers when needed
65  QVariant fromLC(const QString& name, LiveConnectExtension::Type type,
66  unsigned long objId, const QString& value);
67 
68  QString toLC(const QVariant& in, bool* ok);
69 public Q_SLOTS:
70  void liveConnectEvent(const unsigned long, const QString&, const KParts::LiveConnectExtension::ArgList&);
71 };
72 
73 
74 } // namespace KParts
75 
76 #endif
77 // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
KParts::ScriptableLiveConnectExtension
Definition: scriptableextension_p.h:28
KParts::LiveConnectExtension::Type
Type
Definition: browserextension.h:769
KParts::ScriptableLiveConnectExtension::rootObject
QVariant rootObject()
Return the root scriptable object of this KPart.
Definition: scriptableextension.cpp:236
KParts::ScriptableLiveConnectExtension::ScriptableLiveConnectExtension
ScriptableLiveConnectExtension(QObject *parent, LiveConnectExtension *old)
Definition: scriptableextension.cpp:227
QObject::name
const char * name() const
KParts::ScriptableLiveConnectExtension::callFunctionReference
QVariant callFunctionReference(ScriptableExtension *callerPrincipal, quint64 objId, const QString &f, const ArgList &args)
Try to use a function reference to field f of object as a function.
Definition: scriptableextension.cpp:252
KParts::ScriptableLiveConnectExtension::put
bool put(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName, const QVariant &value)
Tries to set the field propName from object objId associated with 'this' to value.
Definition: scriptableextension.cpp:288
QHash< quint64, int >
KParts::LiveConnectExtension
An extension class for LiveConnect, i.e.
Definition: browserextension.h:765
QObject
KParts::ScriptableLiveConnectExtension::liveConnectEvent
void liveConnectEvent(const unsigned long, const QString &, const KParts::LiveConnectExtension::ArgList &)
Definition: scriptableextension.cpp:384
QString
QList< QVariant >
ok
KGuiItem ok()
KParts::ScriptableLiveConnectExtension::acquire
void acquire(quint64 objid)
increases reference count of object objId
Definition: scriptableextension.cpp:369
quint64
KParts::ScriptableLiveConnectExtension::hasProperty
bool hasProperty(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
Returns true if the object objId associated with 'this' has the property propName.
Definition: scriptableextension.cpp:242
browserextension.h
QObject::parent
QObject * parent() const
KParts::ScriptableLiveConnectExtension::release
void release(quint64 objid)
decreases reference count of object objId
Definition: scriptableextension.cpp:374
KParts::ScriptableExtension
An extension class that permits KParts to be scripted (such as when embedded inside a KHTMLPart) and ...
Definition: scriptableextension.h:44
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KParts

Skip menu "KParts"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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