-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathHookFormatter.h
43 lines (31 loc) · 1.12 KB
/
HookFormatter.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
// Copyright 2015, Christopher J. Foster and the other displaz contributors.
// Use of this code is governed by the BSD-style license found in LICENSE.txt
#ifndef DISPLAZ_HOOKFORMATTER_H_INCLUDED
#define DISPLAZ_HOOKFORMATTER_H_INCLUDED
#include <QObject>
#include <QByteArray>
class MainWindow;
/// Class for formatting hook event messages
class HookFormatter : public QObject
{
Q_OBJECT
public:
HookFormatter(MainWindow* getPayload, QByteArray hookSpec,
QByteArray hookPayload, QObject* parent = NULL);
void setEventId(int eventId) { m_eventId = eventId; }
public slots:
void hookActivated(void);
signals:
/// Triggered on event of custom shortcut
void sendIpcMessage(QByteArray message);
/// Triggered on disconnect of parent channel
void hookRemoved(int eventId);
private slots:
void channelDisconnected(void) { emit hookRemoved(m_eventId); }
private:
QByteArray m_hookSpec;
QByteArray m_hookPayload;
MainWindow* m_getPayload;
int m_eventId;
};
#endif // DISPLAZ_HOOKFORMATTER_H_INCLUDED