blob: 59fd0a3c8c1a70344376aa4e401d641d0129697c [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;
george82baa71192005-11-30 16:17:46 +000061 bool showToolbar;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000062 bool clientCutText;
63 bool serverCutText;
Constantin Kaplinskyac306682006-05-16 08:48:31 +000064 bool disableWinKeys;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000065 bool emulate3;
66 int pointerEventInterval;
67 bool protocol3_3;
68 bool acceptBell;
69 CharArray userName;
70 void setUserName(const char* user);
Constantin Kaplinskyac306682006-05-16 08:48:31 +000071 PlainPasswd password;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000072 void setPassword(const char* pwd);
73 CharArray configFileName;
74 void setConfigFileName(const char* cfn);
75 CharArray host;
76 void setHost(const char* h);
77 CharArray monitor;
78 void setMonitor(const char* m);
79 unsigned int menuKey;
80 void setMenuKey(const char* keyName);
81 char* menuKeyName();
Constantin Kaplinskyac306682006-05-16 08:48:31 +000082 bool autoReconnect;
Peter Åstrand365427a2004-12-29 10:59:03 +000083
84 bool customCompressLevel;
85 int compressLevel;
Peter Åstrand0b870262004-12-28 15:55:46 +000086 bool noJpeg;
Peter Åstrand365427a2004-12-29 10:59:03 +000087 int qualityLevel;
88
Peter Åstrand3e3c75e2005-01-03 13:32:28 +000089 CharArray passwordFile;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000090 };
91
92
93 };
94
95};
96
97#endif