-
Notifications
You must be signed in to change notification settings - Fork 0
/
kludget.h
117 lines (92 loc) · 2.39 KB
/
kludget.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef KLUDGET_H
#define KLUDGET_H
#include <QTimer>
#include <QMenu>
#include <QSignalMapper>
#include <QLibrary>
#include "kludgetinfo.h"
#include "kipc.h"
class KClient;
class KWindow;
class KView;
class KPage;
class KSystem;
class KSettings;
class AboutWindow;
class PreferenceWindow;
class QWebFrame;
class QMenu;
class Kludget : public QObject
{
Q_OBJECT
public:
Kludget(KClient *client = 0);
~Kludget();
static Kludget* create(KClient *client, const KludgetInfo &info);
private:
bool loadSettings(const KludgetInfo &info, bool loadPage = false);
void saveSettings();
void addJavaScriptWindowObjects(QWebFrame* frame);
void runJavaScriptFile(QWebFrame* frame, const QString &);
void setupContextMenu();
void loadMenuFile(const QString &);
private
Q_SLOTS:
void onShow();
void onHide();
void onStartDrag();
void onEndDrag();
void onRemove();
void onSettingsChanged();
void onEvaluate(const QString &);
void onWindowDestroyed();
void onPreferencesClosed();
void onContextMenu();
void onJavaScriptWindowObjectCleared();
void onFrameCreated(QWebFrame*);
void onUrlReceived(const QUrl*);
void onSystemExecUpdate(long id);
void onSystemExecFinish(long id);
private:
KludgetInfo info;
KIPCClient ipcClient;
KClient *client;
KWindow *window;
KSystem *system;
bool firstShow;
PreferenceWindow *prefWindow;
AboutWindow *aboutWindow;
QSignalMapper customMenuMapper;
QMenu contextMenu;
QLibrary plugin;
public:
KSettings *settings;
public
Q_SLOTS:
void screenshot(QString path = "");
void show();
void hide();
void close();
void inspect();
void reload();
void about();
void configure(QString cat = "");
void createInstance(QString instance = "");
void move(int x, int y);
void resize(int w, int h);
void resizeAndMoveTo(int x, int y, int w, int h);
void renderLayer(QString layer);
void prepareForTransition(QString transition);
void performTransition();
void messageReceived(QString message, QString id, QString instance);
public:
int opacity();
int windowLevel();
int x();
int y();
int width();
int height();
Q_SIGNALS:
void evaluate(const QString &);
};
#endif