blob: 5c90749e825f5b378450ffa9d4942ad9a09701be [file] [log] [blame]
Pierre Ossmand463b572011-05-16 12:04:43 +00001/* Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
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#ifndef __OPTIONSDIALOG_H__
20#define __OPTIONSDIALOG_H__
21
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000022#include <map>
23
Pierre Ossmand463b572011-05-16 12:04:43 +000024#include <FL/Fl_Window.H>
25#include <FL/Fl_Group.H>
26#include <FL/Fl_Check_Button.H>
27#include <FL/Fl_Round_Button.H>
28#include <FL/Fl_Int_Input.H>
Pierre Ossman4e7271e2011-05-24 12:47:12 +000029#include <FL/Fl_Choice.H>
Pierre Ossmand463b572011-05-16 12:04:43 +000030
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000031typedef void (OptionsCallback)(void*);
32
Pierre Ossmand463b572011-05-16 12:04:43 +000033class OptionsDialog : public Fl_Window {
34protected:
35 OptionsDialog();
36 ~OptionsDialog();
37
38public:
39 static void showDialog(void);
40
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000041 static void addCallback(OptionsCallback *cb, void *data = NULL);
42 static void removeCallback(OptionsCallback *cb);
43
Pierre Ossmand463b572011-05-16 12:04:43 +000044 void show(void);
45
46protected:
47 void loadOptions(void);
48 void storeOptions(void);
49
50 void createCompressionPage(int tx, int ty, int tw, int th);
51 void createSecurityPage(int tx, int ty, int tw, int th);
52 void createInputPage(int tx, int ty, int tw, int th);
53 void createMiscPage(int tx, int ty, int tw, int th);
54
55 static void handleAutoselect(Fl_Widget *widget, void *data);
56 static void handleCompression(Fl_Widget *widget, void *data);
57 static void handleJpeg(Fl_Widget *widget, void *data);
58
Pierre Ossmand463b572011-05-16 12:04:43 +000059 static void handleX509(Fl_Widget *widget, void *data);
60
61 static void handleCancel(Fl_Widget *widget, void *data);
62 static void handleOK(Fl_Widget *widget, void *data);
63
64protected:
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000065 static std::map<OptionsCallback*, void*> callbacks;
66
Pierre Ossmand463b572011-05-16 12:04:43 +000067 /* Compression */
68 Fl_Check_Button *autoselectCheckbox;
69
70 Fl_Group *encodingGroup;
71 Fl_Round_Button *tightButton;
72 Fl_Round_Button *zrleButton;
73 Fl_Round_Button *hextileButton;
74 Fl_Round_Button *rawButton;
75
76 Fl_Group *colorlevelGroup;
77 Fl_Round_Button *fullcolorCheckbox;
78 Fl_Round_Button *mediumcolorCheckbox;
79 Fl_Round_Button *lowcolorCheckbox;
80 Fl_Round_Button *verylowcolorCheckbox;
81
82 Fl_Check_Button *compressionCheckbox;
83 Fl_Check_Button *jpegCheckbox;
84 Fl_Int_Input *compressionInput;
85 Fl_Int_Input *jpegInput;
86
87 /* Security */
Pierre Ossmand463b572011-05-16 12:04:43 +000088 Fl_Group *encryptionGroup;
89 Fl_Check_Button *encNoneCheckbox;
90 Fl_Check_Button *encTLSCheckbox;
91 Fl_Check_Button *encX509Checkbox;
92 Fl_Input *caInput;
93 Fl_Input *crlInput;
94
95 Fl_Group *authenticationGroup;
96 Fl_Check_Button *authNoneCheckbox;
97 Fl_Check_Button *authVncCheckbox;
98 Fl_Check_Button *authPlainCheckbox;
99
100 /* Input */
101 Fl_Check_Button *viewOnlyCheckbox;
102 Fl_Check_Button *acceptClipboardCheckbox;
103 Fl_Check_Button *sendClipboardCheckbox;
104 Fl_Check_Button *sendPrimaryCheckbox;
Pierre Ossman407a5c32011-05-26 14:48:29 +0000105 Fl_Check_Button *systemKeysCheckbox;
Pierre Ossman4e7271e2011-05-24 12:47:12 +0000106 Fl_Choice *menuKeyChoice;
Pierre Ossmand463b572011-05-16 12:04:43 +0000107
108 /* Misc. */
109 Fl_Check_Button *sharedCheckbox;
110 Fl_Check_Button *fullScreenCheckbox;
Pierre Ossmand463b572011-05-16 12:04:43 +0000111 Fl_Check_Button *dotCursorCheckbox;
112};
113
114#endif