1 /*****************************************************************************
2 * prefs_widgets.h: Preferences controls
3 *****************************************************************************
4 * Copyright (C) 2002-2003 the VideoLAN team
7 * Authors: Derk-Jan Hartman <hartman at videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #define CONFIG_ITEM_STRING_LIST (CONFIG_ITEM_STRING + 1)
25 #define CONFIG_ITEM_RANGED_INTEGER (CONFIG_ITEM_INTEGER + 1)
26 #define CONFIG_ITEM_KEY_BEFORE_10_3 (CONFIG_ITEM_KEY + 1)
27 #define CONFIG_ITEM_KEY_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
29 #define RIGHTMARGIN 18
31 @interface VLCConfigControl : NSView
33 module_config_t *p_item;
38 vlc_bool_t b_advanced;
41 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
42 withView: (NSView *)o_parent_view;
43 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
44 - (NSString *)getName;
48 - (void)setYPos:(int)i_yPos;
51 - (char *)stringValue;
54 - (void) alignWithXPosition:(int)i_xPos;
55 static NSMenu *o_keys_menu = nil;
57 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
61 @interface StringConfigControl : VLCConfigControl
63 NSTextField *o_textfield;
66 - (id) initWithItem: (module_config_t *)_p_item
67 withView: (NSView *)o_parent_view;
71 @interface StringListConfigControl : VLCConfigControl
76 - (id) initWithItem: (module_config_t *)_p_item
77 withView: (NSView *)o_parent_view;
81 @interface FileConfigControl : VLCConfigControl
83 NSTextField *o_textfield;
88 - (id) initWithItem: (module_config_t *)_p_item
89 withView: (NSView *)o_parent_view;
91 - (IBAction)openFileDialog: (id)sender;
92 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
96 @interface ModuleConfigControl : VLCConfigControl
98 NSPopUpButton *o_popup;
101 - (id) initWithItem: (module_config_t *)_p_item
102 withView: (NSView *)o_parent_view;
106 @interface IntegerConfigControl : VLCConfigControl
108 NSTextField *o_textfield;
109 NSStepper *o_stepper;
113 - (id) initWithItem: (module_config_t *)_p_item
114 withView: (NSView *)o_parent_view;
115 - (IBAction)stepperChanged:(id)sender;
116 - (void)textfieldChanged:(NSNotification *)o_notification;
120 @interface IntegerListConfigControl : VLCConfigControl
125 - (id) initWithItem: (module_config_t *)_p_item
126 withView: (NSView *)o_parent_view;
130 @interface RangedIntegerConfigControl : VLCConfigControl
133 NSTextField *o_textfield;
134 NSTextField *o_textfield_min;
135 NSTextField *o_textfield_max;
139 - (id) initWithItem: (module_config_t *)_p_item
140 withView: (NSView *)o_parent_view;
141 - (IBAction)sliderChanged:(id)sender;
142 - (void)textfieldChanged:(NSNotification *)o_notification;
146 @interface BoolConfigControl : VLCConfigControl
148 NSButton *o_checkbox;
151 - (id) initWithItem: (module_config_t *)_p_item
152 withView: (NSView *)o_parent_view;
156 @interface FloatConfigControl : VLCConfigControl
158 NSTextField *o_textfield;
159 NSStepper *o_stepper;
163 - (id) initWithItem: (module_config_t *)_p_item
164 withView: (NSView *)o_parent_view;
165 - (IBAction)stepperChanged:(id)sender;
166 - (void)textfieldChanged:(NSNotification *)o_notification;
170 @interface RangedFloatConfigControl : VLCConfigControl
173 NSTextField *o_textfield;
174 NSTextField *o_textfield_min;
175 NSTextField *o_textfield_max;
179 - (id) initWithItem: (module_config_t *)_p_item
180 withView: (NSView *)o_parent_view;
181 - (IBAction)sliderChanged:(id)sender;
182 - (void)textfieldChanged:(NSNotification *)o_notification;
186 @interface KeyConfigControlBefore103 : VLCConfigControl
188 NSButton *o_cmd_checkbox;
189 NSButton *o_ctrl_checkbox;
190 NSButton *o_alt_checkbox;
191 NSButton *o_shift_checkbox;
192 NSPopUpButton *o_popup;
195 - (id) initWithItem: (module_config_t *)_p_item
196 withView: (NSView *)o_parent_view;
200 @interface KeyConfigControlAfter103 : VLCConfigControl
202 NSPopUpButton *o_popup;
205 - (id) initWithItem: (module_config_t *)_p_item
206 withView: (NSView *)o_parent_view;
210 @interface ModuleListConfigControl : VLCConfigControl
212 NSTextField *o_textfield;
213 NSScrollView *o_scrollview;
214 NSMutableArray *o_modulearray;
217 - (id) initWithItem: (module_config_t *)_p_item
218 withView: (NSView *)o_parent_view;
222 //#undef CONFIG_ITEM_LIST_STRING
223 //#undef CONFIG_ITEM_RANGED_INTEGER
224 //#undef CONFIG_ITEM_KEY_BEFORE_10_3
225 //#undef CONFIG_ITEM_KEY_AFTER_10_3