blob: 8d6e373c1cf4da94fada228f3adf61a0bafd3c3b [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18//
19// CMsgWriter - class for writing RFB messages on the server side.
20//
21
22#ifndef __RFB_CMSGWRITER_H__
23#define __RFB_CMSGWRITER_H__
24
25#include <rdr/types.h>
26
27namespace rdr { class OutStream; }
28
29namespace rfb {
30
31 class PixelFormat;
32 class ConnParams;
33 struct Rect;
34
35 class CMsgWriter {
36 public:
37 virtual ~CMsgWriter();
38
39 virtual void writeClientInit(bool shared)=0;
40
41 virtual void writeSetPixelFormat(const PixelFormat& pf);
42 virtual void writeSetEncodings(int nEncodings, rdr::U32* encodings);
43 virtual void writeSetEncodings(int preferredEncoding, bool useCopyRect);
44 virtual void writeFramebufferUpdateRequest(const Rect& r,bool incremental);
45 virtual void writeKeyEvent(rdr::U32 key, bool down);
46 virtual void writePointerEvent(int x, int y, int buttonMask);
47 virtual void writeClientCutText(const char* str, int len);
48
49 virtual void startMsg(int type)=0;
50 virtual void endMsg()=0;
51
52 virtual void setOutStream(rdr::OutStream* os);
53
54 ConnParams* getConnParams() { return cp; }
55 rdr::OutStream* getOutStream() { return os; }
56
57 protected:
58 CMsgWriter(ConnParams* cp, rdr::OutStream* os);
59
60 ConnParams* cp;
61 rdr::OutStream* os;
62 };
63}
64#endif