[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kparts
From: Maks Orlovich <maksim () kde ! org>
Date: 2010-05-10 17:29:33
Message-ID: 20100510172933.1D368AC8B1 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1125098 by orlovich:
- Fix a few typos.
- Implement fallback behavior.
- Implement the convenience dbus marshallers
(here since I know nspluginviewer will need them, and its extremely
likely that knpplayer will as well)
AM scriptableextension.cpp [License: LGPL (v2+)]
M +30 -6 scriptableextension.h
--- trunk/KDE/kdelibs/kparts/scriptableextension.h #1125097:1125098
@@ -22,10 +22,15 @@
#define kparts_scriptableextension_h
#include <QtGlobal>
+#include <QObject>
+#include <QVariant>
+#include <kparts/part.h>
+#include <QDBusArgument>
namespace KParts {
class ScriptableExtension;
+struct ScriptableExtensionPrivate;
class LiveConnectExtension;
/**
@@ -69,6 +74,9 @@
/// low-level (in particular, it might not be translated) and should
/// only be displayed in low-level debugging tools and the like.
QString message;
+
+ Exception() {}
+ Exception(const QString& msg): message(msg) {}
};
/// Objects are abstracted away as a pair of the ScriptableExtension
@@ -134,16 +142,18 @@
/**
* Return the root scriptable object of this KPart.
* For example for an HTML part, it would represent a Window object.
+ * May be undefined or null
*/
- virtual ScriptValue rootObject();
+ virtual QVariant rootObject();
/**
* Returns an object that represents this KPart's view of
* the @p childPart. For an example, in an HTML part,
* it would return the DOM node of an <object> handled
* by @p childPart
+ * May be undefined or null
*/
- virtual ScriptValue enclosingObject(KPart::ReadOnlyPart* childPart);
+ virtual QVariant enclosingObject(KParts::ReadOnlyPart* childPart);
//@}
///@name Object Operations
@@ -176,14 +186,14 @@
/**
Returns true if the object @p objId associated with 'this' has the property
- @p propName
+ @p propName.
*/
virtual bool hasProperty(ScriptableExtension* callerPrincipal, quint64 objId, \
const QString& propName);
/**
Tries to get field @p propName from object @p objId associated with 'this'.
*/
- virtual OpValue get(ScriptableExtension* callerPrincipal, quint64 objId, const \
QString& propName); + virtual QVariant get(ScriptableExtension* callerPrincipal, \
quint64 objId, const QString& propName);
/**
Tries to set the field @p propName from object @p objId associated with 'this'
@@ -215,7 +225,7 @@
The parameter @p language specifies the mimetype of the language to execute.
Use 'application/ecmascript' for ECMAScript or JavaScript
*/
- virtual QVariant evaluateScript(ScriptableExtension* principal,
+ virtual QVariant evaluateScript(ScriptableExtension* callerPrincipal,
quint64 contextObjectId,
const QString& code,
const QString& language =
@@ -234,7 +244,6 @@
//@}
private:
- class ScriptableExtensionPrivate;
ScriptableExtensionPrivate* const d;
};
@@ -245,4 +254,19 @@
Q_DECLARE_METATYPE(KParts::ScriptableExtension::Exception);
Q_DECLARE_METATYPE(KParts::ScriptableExtension::Object);
+const QDBusArgument& KPARTS_EXPORT operator<<(QDBusArgument& argument,
+ const \
KParts::ScriptableExtension::Null& n); +const QDBusArgument& KPARTS_EXPORT \
operator>>(const QDBusArgument& argument, + \
KParts::ScriptableExtension::Null& n); +const QDBusArgument& KPARTS_EXPORT \
operator<<(QDBusArgument& argument, + \
const KParts::ScriptableExtension::Undefined& u); +const QDBusArgument& KPARTS_EXPORT \
operator>>(const QDBusArgument& argument, + \
KParts::ScriptableExtension::Undefined& u); +const QDBusArgument& KPARTS_EXPORT \
operator<<(QDBusArgument& argument, + \
const KParts::ScriptableExtension::Exception& e); +const QDBusArgument& KPARTS_EXPORT \
operator>>(const QDBusArgument& argument, + \
KParts::ScriptableExtension::Exception& e); +
+#endif
+
// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic