KParts

liveconnectextension.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef __kparts_liveconnectextension_h__
10 #define __kparts_liveconnectextension_h__
11 
12 #include <kparts/kparts_export.h>
13 
14 #include <QObject>
15 #include <QPair>
16 #include <QStringList>
17 
18 #include <memory>
19 
20 template<typename T>
21 class QList;
22 class QString;
23 
24 namespace KParts
25 {
26 class ReadOnlyPart;
27 class LiveConnectExtensionPrivate;
28 
29 /**
30  * @class LiveConnectExtension liveconnectextension.h <KParts/LiveConnectExtension>
31  *
32  * @short An extension class for LiveConnect, i.e. a call from JavaScript
33  * from a HTML page which embeds this part.
34  * A part can have an object hierarchy by using objid as a reference
35  * to an object.
36  */
37 class KPARTS_EXPORT LiveConnectExtension : public QObject
38 {
39  Q_OBJECT
40 public:
41  enum Type {
42  TypeVoid = 0,
43  TypeBool,
44  TypeFunction,
45  TypeNumber,
46  TypeObject,
47  TypeString,
48  };
50 
52 
53  ~LiveConnectExtension() override;
54  /**
55  * get a field value from objid, return true on success
56  */
57  virtual bool get(const unsigned long objid, const QString &field, Type &type, unsigned long &retobjid, QString &value);
58  /**
59  * put a field value in objid, return true on success
60  */
61  virtual bool put(const unsigned long objid, const QString &field, const QString &value);
62  /**
63  * calls a function of objid, return true on success
64  */
65  virtual bool call(const unsigned long objid, const QString &func, const QStringList &args, Type &type, unsigned long &retobjid, QString &value);
66  /**
67  * notifies the part that there is no reference anymore to objid
68  */
69  virtual void unregister(const unsigned long objid);
70 
71  static LiveConnectExtension *childObject(QObject *obj);
72 Q_SIGNALS:
73  /**
74  * notify a event from the part of object objid
75  */
76  void partEvent(const unsigned long objid, const QString &event, const KParts::LiveConnectExtension::ArgList &args);
77 
78 private:
79  std::unique_ptr<LiveConnectExtensionPrivate> const d;
80 };
81 
82 }
83 
84 #endif
PartitionTable::TableType type
An extension class for LiveConnect, i.e.
The KParts namespace,.
Base class for any "viewer" part.
Definition: readonlypart.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 27 2022 22:49:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.