blob: d4994699f3f5fdfdedcb369ca9ee359aaadd6f71 [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
59 static void handleVencrypt(Fl_Widget *widget, void *data);
60 static void handleX509(Fl_Widget *widget, void *data);
61
62 static void handleCancel(Fl_Widget *widget, void *data);
63 static void handleOK(Fl_Widget *widget, void *data);
64
65protected:
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000066 static std::map<OptionsCallback*, void*> callbacks;
67
Pierre Ossmand463b572011-05-16 12:04:43 +000068 /* Compression */
69 Fl_Check_Button *autoselectCheckbox;
70
71 Fl_Group *encodingGroup;
72 Fl_Round_Button *tightButton;
73 Fl_Round_Button *zrleButton;
74 Fl_Round_Button *hextileButton;
75 Fl_Round_Button *rawButton;
76
77 Fl_Group *colorlevelGroup;
78 Fl_Round_Button *fullcolorCheckbox;
79 Fl_Round_Button *mediumcolorCheckbox;
80 Fl_Round_Button *lowcolorCheckbox;
81 Fl_Round_Button *verylowcolorCheckbox;
82
83 Fl_Check_Button *compressionCheckbox;
84 Fl_Check_Button *jpegCheckbox;
85 Fl_Int_Input *compressionInput;
86 Fl_Int_Input *jpegInput;
87
88 /* Security */
89 Fl_Check_Button *vencryptCheckbox;
90
91 Fl_Group *encryptionGroup;
92 Fl_Check_Button *encNoneCheckbox;
93 Fl_Check_Button *encTLSCheckbox;
94 Fl_Check_Button *encX509Checkbox;
95 Fl_Input *caInput;
96 Fl_Input *crlInput;
97
98 Fl_Group *authenticationGroup;
99 Fl_Check_Button *authNoneCheckbox;
100 Fl_Check_Button *authVncCheckbox;
101 Fl_Check_Button *authPlainCheckbox;
102
103 /* Input */
104 Fl_Check_Button *viewOnlyCheckbox;
105 Fl_Check_Button *acceptClipboardCheckbox;
106 Fl_Check_Button *sendClipboardCheckbox;
107 Fl_Check_Button *sendPrimaryCheckbox;
Pierre Ossman4e7271e2011-05-24 12:47:12 +0000108 Fl_Choice *menuKeyChoice;
Pierre Ossmand463b572011-05-16 12:04:43 +0000109
110 /* Misc. */
111 Fl_Check_Button *sharedCheckbox;
112 Fl_Check_Button *fullScreenCheckbox;
113 Fl_Check_Button *localCursorCheckbox;
114 Fl_Check_Button *dotCursorCheckbox;
115};
116
117#endif