1
/***************************************************************************
2
events.h - QCustomEvents
4
begin : Wed Jun 05 01:13:42 CET 2002
5
copyright : (C) 2002 by Tim Jansen
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
26
* State of the connection. The state of the connection is returned
27
* by @ref KRemoteView::status().
29
* Not every state transition is allowed. You are only allowed to transition
30
* a state to the following state, with three exceptions:
31
* @li You can move from every state directly to REMOTE_VIEW_DISCONNECTED
32
* @li You can move from every state except REMOTE_VIEW_DISCONNECTED to
33
* REMOTE_VIEW_DISCONNECTING
34
* @li You can move from REMOTE_VIEW_DISCONNECTED to REMOTE_VIEW_CONNECTING
36
* @ref KRemoteView::setStatus() will follow this rules for you.
37
* (If you add/remove a state here, you must adapt it)
39
enum RemoteViewStatus {
40
REMOTE_VIEW_CONNECTING = 0,
41
REMOTE_VIEW_AUTHENTICATING = 1,
42
REMOTE_VIEW_PREPARING = 2,
43
REMOTE_VIEW_CONNECTED = 3,
44
REMOTE_VIEW_DISCONNECTING = -1,
45
REMOTE_VIEW_DISCONNECTED = -2
60
const int ScreenResizeEventType = 41001;
62
class ScreenResizeEvent : public QCustomEvent
65
int m_width, m_height;
67
ScreenResizeEvent(int w, int h) :
68
QCustomEvent(ScreenResizeEventType),
72
int width() const { return m_width; };
73
int height() const { return m_height; };
76
const int StatusChangeEventType = 41002;
78
class StatusChangeEvent : public QCustomEvent
81
RemoteViewStatus m_status;
83
StatusChangeEvent(RemoteViewStatus s) :
84
QCustomEvent(StatusChangeEventType),
87
RemoteViewStatus status() const { return m_status; };
90
const int PasswordRequiredEventType = 41003;
92
class PasswordRequiredEvent : public QCustomEvent
95
PasswordRequiredEvent() :
96
QCustomEvent(PasswordRequiredEventType)
100
const int FatalErrorEventType = 41004;
102
class FatalErrorEvent : public QCustomEvent
106
FatalErrorEvent(ErrorCode e) :
107
QCustomEvent(FatalErrorEventType),
111
ErrorCode errorCode() const { return m_error; }
114
const int DesktopInitEventType = 41005;
116
class DesktopInitEvent : public QCustomEvent
120
QCustomEvent(DesktopInitEventType)
124
const int ScreenRepaintEventType = 41006;
126
class ScreenRepaintEvent : public QCustomEvent
129
int m_x, m_y, m_width, m_height;
131
ScreenRepaintEvent(int x, int y, int w, int h) :
132
QCustomEvent(ScreenRepaintEventType),
138
int x() const { return m_x; };
139
int y() const { return m_y; };
140
int width() const { return m_width; };
141
int height() const { return m_height; };
144
const int BeepEventType = 41007;
146
class BeepEvent : public QCustomEvent
150
QCustomEvent(BeepEventType)
154
const int ServerCutEventType = 41008;
156
class ServerCutEvent : public QCustomEvent
162
ServerCutEvent(char *bytes, int length) :
163
QCustomEvent(ServerCutEventType),
170
int length() const { return m_length; };
171
char *bytes() const { return m_bytes; };
174
const int MouseStateEventType = 41009;
176
class MouseStateEvent : public QCustomEvent
179
int m_x, m_y, m_buttonMask;
181
MouseStateEvent(int x, int y, int buttonMask) :
182
QCustomEvent(MouseStateEventType),
185
m_buttonMask(buttonMask)
189
int x() const { return m_x; };
190
int y() const { return m_y; };
191
int buttonMask() const { return m_buttonMask; };