blob: 37755e77843ecb2b2417193eda3f544ca7d74af2 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 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 <rfb/InputHandler.h>
Pierre Ossmane7a41d52009-03-23 16:48:35 +000026#include <rfb/ScreenSet.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000027
28namespace rdr { class OutStream; }
29
30namespace rfb {
31
32 class PixelFormat;
33 class ConnParams;
34 struct Rect;
35
36 class CMsgWriter : public InputHandler {
37 public:
38 virtual ~CMsgWriter();
39
40 // CMsgWriter abstract interface methods
41 virtual void writeClientInit(bool shared)=0;
42 virtual void startMsg(int type)=0;
43 virtual void endMsg()=0;
44
Pierre Ossmane7a41d52009-03-23 16:48:35 +000045 virtual void writeSetDesktopSize(int width, int height,
46 const ScreenSet& layout)=0;
47
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000048 // CMsgWriter implemented methods
49 virtual void writeSetPixelFormat(const PixelFormat& pf);
50 virtual void writeSetEncodings(int nEncodings, rdr::U32* encodings);
51 virtual void writeSetEncodings(int preferredEncoding, bool useCopyRect);
52 virtual void writeFramebufferUpdateRequest(const Rect& r,bool incremental);
53
54 // InputHandler implementation
55 virtual void keyEvent(rdr::U32 key, bool down);
56 virtual void pointerEvent(const Point& pos, int buttonMask);
Adam Tkacacf6c6b2009-02-13 12:42:05 +000057 virtual void clientCutText(const char* str, rdr::U32 len);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000058
59 ConnParams* getConnParams() { return cp; }
60 rdr::OutStream* getOutStream() { return os; }
61
62 protected:
63 CMsgWriter(ConnParams* cp, rdr::OutStream* os);
64
65 ConnParams* cp;
66 rdr::OutStream* os;
67 };
68}
69#endif