File: webkitaccessinghost.h

package info (click to toggle)
psi-plus 1.4.1456-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,188 kB
  • sloc: cpp: 211,254; ansic: 19,786; javascript: 13,687; xml: 4,056; sh: 1,610; makefile: 437; objc: 407; python: 277; ruby: 171
file content (41 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef WEBKITACCESSINGHOST_H
#define WEBKITACCESSINGHOST_H

#include <QtPlugin>

#include "psiplugin.h"

class QString;

class WebkitAccessingHost {
public:
    enum RenderType {
        RT_TextEdit,
        RT_WebKit,
        RT_WebEngine,
        RT_QML /* well it's reserved =) */
    };

    virtual ~WebkitAccessingHost() { }

    virtual RenderType chatLogRenderType() const = 0;

    // embed QObject into specified log widget (note, actual log widget could be a child. it will be found by "log"
    // name) virtual void embedChatLogJavaScriptObject(QWidget *log, QObject *object) = 0; // to early for this. needs
    // chatview reinitialization feature (QWebChannel doesn't support embed in runtime) which requires proper history
    // reloading.

    // installs global chat log data filter, where data is all the possible message types added to chatlog
    virtual QString installChatLogJSDataFilter(const QString &     js,
                                               PsiPlugin::Priority priority = PsiPlugin::PriorityNormal)
        = 0;
    // uninstall global chat log data filter
    virtual void uninstallChatLogJSDataFilter(const QString &id) = 0;

    // execute javascript in subscope of global. visible variable: "chat"
    virtual void executeChatLogJavaScript(QWidget *log, const QString &js) = 0;
};

Q_DECLARE_INTERFACE(WebkitAccessingHost, "org.psi-im.WebkitAccessingHost/0.1");

#endif // WEBKITACCESSINGHOST_H