blob: 52c3996eed66ea8eb1542d3d50fe47b1c9fc0c29 [file] [log] [blame]
Constantin Kaplinskyac306682006-05-16 08:48:31 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00003 * 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
Constantin Kaplinskyac306682006-05-16 08:48:31 +000019// -=- CConnOptions.h
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000020
Constantin Kaplinskyac306682006-05-16 08:48:31 +000021// Definition of the CConnOptions class, responsible for storing the
22// current & requested VNC Viewer options.
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000023
Constantin Kaplinskyac306682006-05-16 08:48:31 +000024#ifndef __RFB_WIN32_CCONN_OPTIONS_H__
25#define __RFB_WIN32_CCONN_OPTIONS_H__
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000026
Constantin Kaplinskyac306682006-05-16 08:48:31 +000027#include <rfb/Password.h>
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000028
29namespace rfb {
30
31 namespace win32 {
32
33 //
34 // -=- Options structure. Each viewer option has a corresponding
Constantin Kaplinskyac306682006-05-16 08:48:31 +000035 // entry in CConnOptions. The viewer options are set by calling
36 // CConn::applyOptions(...)
37 // The CConnOptions structure automatically picks up the default
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000038 // value of each option from the Configuration system
39 // The readFromFile and writeFromFile methods can be used to load
40 // and save VNC configuration files. readFromFile is backwards
41 // compatible with 3.3 releases, while writeToFile is not.
42
Constantin Kaplinskyac306682006-05-16 08:48:31 +000043 class CConnOptions {
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000044 public:
Constantin Kaplinskyac306682006-05-16 08:48:31 +000045 CConnOptions();
46 CConnOptions(const CConnOptions& o) {operator=(o);}
47 CConnOptions& operator=(const CConnOptions& o);
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000048 void readFromFile(const char* filename_);
49 void writeToFile(const char* filename_);
50 void writeDefaults();
51 bool useLocalCursor;
52 bool useDesktopResize;
53 bool fullScreen;
54 bool fullColour;
55 int lowColourLevel;
56 int preferredEncoding;
57 bool autoSelect;
58 bool shared;
59 bool sendPtrEvents;
60 bool sendKeyEvents;
Peter Åstrand57dcc452005-01-28 14:52:50 +000061 bool sendSysKeys;
george82baa71192005-11-30 16:17:46 +000062 bool showToolbar;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000063 bool clientCutText;
64 bool serverCutText;
Constantin Kaplinskyac306682006-05-16 08:48:31 +000065 bool disableWinKeys;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000066 bool emulate3;
67 int pointerEventInterval;
68 bool protocol3_3;
69 bool acceptBell;
70 CharArray userName;
71 void setUserName(const char* user);
Constantin Kaplinskyac306682006-05-16 08:48:31 +000072 PlainPasswd password;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000073 void setPassword(const char* pwd);
74 CharArray configFileName;
75 void setConfigFileName(const char* cfn);
76 CharArray host;
77 void setHost(const char* h);
78 CharArray monitor;
79 void setMonitor(const char* m);
80 unsigned int menuKey;
81 void setMenuKey(const char* keyName);
82 char* menuKeyName();
Constantin Kaplinskyac306682006-05-16 08:48:31 +000083 bool autoReconnect;
Peter Åstrand365427a2004-12-29 10:59:03 +000084
85 bool customCompressLevel;
86 int compressLevel;
Peter Åstrand0b870262004-12-28 15:55:46 +000087 bool noJpeg;
Peter Åstrand365427a2004-12-29 10:59:03 +000088 int qualityLevel;
89
Peter Åstrand3e3c75e2005-01-03 13:32:28 +000090 CharArray passwordFile;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000091 };
92
93
94 };
95
96};
97
98#endif