~ubuntu-branches/debian/lenny/italc/lenny

« back to all changes in this revision

Viewing changes to master/icv/include/events.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-06-17 13:46:54 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080617134654-cl0gi4u524cv1ici
Tags: 1:1.0.9~rc3-1
* Package new upstream version
  - upstream ported the code to qt4.4 (Closes: #481974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 ***************************************************************************/
8
 
 
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
 
 ***************************************************************************/
17
 
 
18
 
#include <stdlib.h>
19
 
 
20
 
#ifndef EVENTS_H
21
 
#define EVENTS_H
22
 
 
23
 
#include <qevent.h>
24
 
 
25
 
/**
26
 
 * State of the connection. The state of the connection is returned
27
 
 * by @ref KRemoteView::status().
28
 
 *
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
35
 
 *
36
 
 * @ref KRemoteView::setStatus() will follow this rules for you.
37
 
 * (If you add/remove a state here, you must adapt it)
38
 
 */
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
46
 
};
47
 
 
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
58
 
};
59
 
 
60
 
const int ScreenResizeEventType = 41001;
61
 
 
62
 
class ScreenResizeEvent : public QCustomEvent
63
 
{
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; };
74
 
};
75
 
 
76
 
const int StatusChangeEventType = 41002;
77
 
 
78
 
class StatusChangeEvent : public QCustomEvent
79
 
{
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; };
88
 
};
89
 
 
90
 
const int PasswordRequiredEventType = 41003;
91
 
 
92
 
class PasswordRequiredEvent : public QCustomEvent
93
 
{
94
 
public:
95
 
        PasswordRequiredEvent() :
96
 
                QCustomEvent(PasswordRequiredEventType)
97
 
        {};
98
 
};
99
 
 
100
 
const int FatalErrorEventType = 41004;
101
 
 
102
 
class FatalErrorEvent : public QCustomEvent
103
 
{
104
 
        ErrorCode m_error;
105
 
public:
106
 
        FatalErrorEvent(ErrorCode e) :
107
 
                QCustomEvent(FatalErrorEventType),
108
 
                m_error(e)
109
 
        {};
110
 
 
111
 
        ErrorCode errorCode() const { return m_error; }
112
 
};
113
 
 
114
 
const int DesktopInitEventType = 41005;
115
 
 
116
 
class DesktopInitEvent : public QCustomEvent
117
 
{
118
 
public:
119
 
        DesktopInitEvent() :
120
 
                QCustomEvent(DesktopInitEventType)
121
 
        {};
122
 
};
123
 
 
124
 
const int ScreenRepaintEventType = 41006;
125
 
 
126
 
class ScreenRepaintEvent : public QCustomEvent
127
 
{
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)
137
 
        {};
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; };
142
 
};
143
 
 
144
 
const int BeepEventType = 41007;
145
 
 
146
 
class BeepEvent : public QCustomEvent
147
 
{
148
 
public:
149
 
        BeepEvent() :
150
 
                QCustomEvent(BeepEventType)
151
 
        {};
152
 
};
153
 
 
154
 
const int ServerCutEventType = 41008;
155
 
 
156
 
class ServerCutEvent : public QCustomEvent
157
 
{
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)
166
 
        {};
167
 
        ~ServerCutEvent() {
168
 
                free(m_bytes);
169
 
        }
170
 
        int length() const { return m_length; };
171
 
        char *bytes() const { return m_bytes; };
172
 
};
173
 
 
174
 
const int MouseStateEventType = 41009;
175
 
 
176
 
class MouseStateEvent : public QCustomEvent
177
 
{
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)
186
 
        {};
187
 
        ~MouseStateEvent() {
188
 
        }
189
 
        int x() const { return m_x; };
190
 
        int y() const { return m_y; };
191
 
        int buttonMask() const { return m_buttonMask; };
192
 
};
193
 
 
194
 
#endif