blob: ea9585955ce3170b65c57333993a102a4f951139 [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>
29
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000030typedef void (OptionsCallback)(void*);
31
Pierre Ossmand463b572011-05-16 12:04:43 +000032class OptionsDialog : public Fl_Window {
33protected:
34 OptionsDialog();
35 ~OptionsDialog();
36
37public:
38 static void showDialog(void);
39
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000040 static void addCallback(OptionsCallback *cb, void *data = NULL);
41 static void removeCallback(OptionsCallback *cb);
42
Pierre Ossmand463b572011-05-16 12:04:43 +000043 void show(void);
44
45protected:
46 void loadOptions(void);
47 void storeOptions(void);
48
49 void createCompressionPage(int tx, int ty, int tw, int th);
50 void createSecurityPage(int tx, int ty, int tw, int th);
51 void createInputPage(int tx, int ty, int tw, int th);
52 void createMiscPage(int tx, int ty, int tw, int th);
53
54 static void handleAutoselect(Fl_Widget *widget, void *data);
55 static void handleCompression(Fl_Widget *widget, void *data);
56 static void handleJpeg(Fl_Widget *widget, void *data);
57
58 static void handleVencrypt(Fl_Widget *widget, void *data);
59 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 */
88 Fl_Check_Button *vencryptCheckbox;
89
90 Fl_Group *encryptionGroup;
91 Fl_Check_Button *encNoneCheckbox;
92 Fl_Check_Button *encTLSCheckbox;
93 Fl_Check_Button *encX509Checkbox;
94 Fl_Input *caInput;
95 Fl_Input *crlInput;
96
97 Fl_Group *authenticationGroup;
98 Fl_Check_Button *authNoneCheckbox;
99 Fl_Check_Button *authVncCheckbox;
100 Fl_Check_Button *authPlainCheckbox;
101
102 /* Input */
103 Fl_Check_Button *viewOnlyCheckbox;
104 Fl_Check_Button *acceptClipboardCheckbox;
105 Fl_Check_Button *sendClipboardCheckbox;
106 Fl_Check_Button *sendPrimaryCheckbox;
107
108 /* Misc. */
109 Fl_Check_Button *sharedCheckbox;
110 Fl_Check_Button *fullScreenCheckbox;
111 Fl_Check_Button *localCursorCheckbox;
112 Fl_Check_Button *dotCursorCheckbox;
113};
114
115#endif