The regexp was not correct.
[kdenetwork.git] / krdc / events.h
blob8e836ad03fffafcf89288d89b701084eb7ba6a46
1 /***************************************************************************
2 events.h - QCustomEvents
3 -------------------
4 begin : Wed Jun 05 01:13:42 CET 2002
5 copyright : (C) 2002 by Tim Jansen
6 email : tim@tjansen.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #include <stdlib.h>
20 #ifndef EVENTS_H
21 #define EVENTS_H
23 #include <qevent.h>
25 /**
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
48 enum ErrorCode {
49 ERROR_NONE = 0,
50 ERROR_INTERNAL,
51 ERROR_CONNECTION,
52 ERROR_PROTOCOL,
53 ERROR_IO,
54 ERROR_NAME,
55 ERROR_NO_SERVER,
56 ERROR_SERVER_BLOCKED,
57 ERROR_AUTHENTICATION
60 const int ScreenResizeEventType = 41001;
62 class ScreenResizeEvent : public QCustomEvent
64 private:
65 int m_width, m_height;
66 public:
67 ScreenResizeEvent(int w, int h) :
68 QCustomEvent(ScreenResizeEventType),
69 m_width(w),
70 m_height(h)
71 {};
72 int width() const { return m_width; };
73 int height() const { return m_height; };
76 const int StatusChangeEventType = 41002;
78 class StatusChangeEvent : public QCustomEvent
80 private:
81 RemoteViewStatus m_status;
82 public:
83 StatusChangeEvent(RemoteViewStatus s) :
84 QCustomEvent(StatusChangeEventType),
85 m_status(s)
86 {};
87 RemoteViewStatus status() const { return m_status; };
90 const int PasswordRequiredEventType = 41003;
92 class PasswordRequiredEvent : public QCustomEvent
94 public:
95 PasswordRequiredEvent() :
96 QCustomEvent(PasswordRequiredEventType)
97 {};
100 const int FatalErrorEventType = 41004;
102 class FatalErrorEvent : public QCustomEvent
104 ErrorCode m_error;
105 public:
106 FatalErrorEvent(ErrorCode e) :
107 QCustomEvent(FatalErrorEventType),
108 m_error(e)
111 ErrorCode errorCode() const { return m_error; }
114 const int DesktopInitEventType = 41005;
116 class DesktopInitEvent : public QCustomEvent
118 public:
119 DesktopInitEvent() :
120 QCustomEvent(DesktopInitEventType)
124 const int ScreenRepaintEventType = 41006;
126 class ScreenRepaintEvent : public QCustomEvent
128 private:
129 int m_x, m_y, m_width, m_height;
130 public:
131 ScreenRepaintEvent(int x, int y, int w, int h) :
132 QCustomEvent(ScreenRepaintEventType),
133 m_x(x),
134 m_y(y),
135 m_width(w),
136 m_height(h)
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
148 public:
149 BeepEvent() :
150 QCustomEvent(BeepEventType)
154 const int ServerCutEventType = 41008;
156 class ServerCutEvent : public QCustomEvent
158 private:
159 char *m_bytes;
160 int m_length;
161 public:
162 ServerCutEvent(char *bytes, int length) :
163 QCustomEvent(ServerCutEventType),
164 m_bytes(bytes),
165 m_length(length)
167 ~ServerCutEvent() {
168 free(m_bytes);
170 int length() const { return m_length; };
171 char *bytes() const { return m_bytes; };
174 const int MouseStateEventType = 41009;
176 class MouseStateEvent : public QCustomEvent
178 private:
179 int m_x, m_y, m_buttonMask;
180 public:
181 MouseStateEvent(int x, int y, int buttonMask) :
182 QCustomEvent(MouseStateEventType),
183 m_x(x),
184 m_y(y),
185 m_buttonMask(buttonMask)
187 ~MouseStateEvent() {
189 int x() const { return m_x; };
190 int y() const { return m_y; };
191 int buttonMask() const { return m_buttonMask; };
194 #endif