1 /*****************************************************************************
2 * prefs_widgets.h: Preferences controls
3 *****************************************************************************
4 * Copyright (C) 2002-2007 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_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
28 #define RIGHTMARGIN 18
30 static NSMenu *o_keys_menu = nil;
32 @interface VLCConfigControl : NSView
34 module_config_t *p_item;
42 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
43 withView: (NSView *)o_parent_view;
44 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
49 - (void)setYPos:(int)i_yPos;
52 - (char *)stringValue;
56 - (void) alignWithXPosition:(int)i_xPos;
58 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
62 @interface StringConfigControl : VLCConfigControl
64 NSTextField *o_textfield;
67 - (id) initWithItem: (module_config_t *)_p_item
68 withView: (NSView *)o_parent_view;
72 @interface StringListConfigControl : VLCConfigControl
77 - (id) initWithItem: (module_config_t *)_p_item
78 withView: (NSView *)o_parent_view;
82 @interface FileConfigControl : VLCConfigControl
84 NSTextField *o_textfield;
89 - (id) initWithItem: (module_config_t *)_p_item
90 withView: (NSView *)o_parent_view;
92 - (IBAction)openFileDialog: (id)sender;
93 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
97 @interface ModuleConfigControl : VLCConfigControl
99 NSPopUpButton *o_popup;
102 - (id) initWithItem: (module_config_t *)_p_item
103 withView: (NSView *)o_parent_view;
107 @interface IntegerConfigControl : VLCConfigControl
109 NSTextField *o_textfield;
110 NSStepper *o_stepper;
114 - (id) initWithItem: (module_config_t *)_p_item
115 withView: (NSView *)o_parent_view;
116 - (IBAction)stepperChanged:(id)sender;
117 - (void)textfieldChanged:(NSNotification *)o_notification;
121 @interface IntegerListConfigControl : VLCConfigControl
126 - (id) initWithItem: (module_config_t *)_p_item
127 withView: (NSView *)o_parent_view;
131 @interface RangedIntegerConfigControl : VLCConfigControl
134 NSTextField *o_textfield;
135 NSTextField *o_textfield_min;
136 NSTextField *o_textfield_max;
140 - (id) initWithItem: (module_config_t *)_p_item
141 withView: (NSView *)o_parent_view;
142 - (IBAction)sliderChanged:(id)sender;
143 - (void)textfieldChanged:(NSNotification *)o_notification;
147 @interface BoolConfigControl : VLCConfigControl
149 NSButton *o_checkbox;
152 - (id) initWithItem: (module_config_t *)_p_item
153 withView: (NSView *)o_parent_view;
157 @interface FloatConfigControl : VLCConfigControl
159 NSTextField *o_textfield;
160 NSStepper *o_stepper;
164 - (id) initWithItem: (module_config_t *)_p_item
165 withView: (NSView *)o_parent_view;
166 - (IBAction)stepperChanged:(id)sender;
167 - (void)textfieldChanged:(NSNotification *)o_notification;
171 @interface RangedFloatConfigControl : VLCConfigControl
174 NSTextField *o_textfield;
175 NSTextField *o_textfield_min;
176 NSTextField *o_textfield_max;
180 - (id) initWithItem: (module_config_t *)_p_item
181 withView: (NSView *)o_parent_view;
182 - (IBAction)sliderChanged:(id)sender;
183 - (void)textfieldChanged:(NSNotification *)o_notification;
187 @interface KeyConfigControl : VLCConfigControl
189 NSPopUpButton *o_popup;
192 - (id) initWithItem: (module_config_t *)_p_item
193 withView: (NSView *)o_parent_view;
197 @interface ModuleListConfigControl : VLCConfigControl
199 NSTextField *o_textfield;
200 NSScrollView *o_scrollview;
201 NSMutableArray *o_modulearray;
204 - (id) initWithItem: (module_config_t *)_p_item
205 withView: (NSView *)o_parent_view;
209 //#undef CONFIG_ITEM_LIST_STRING
210 //#undef CONFIG_ITEM_RANGED_INTEGER
211 //#undef CONFIG_ITEM_KEY_AFTER_10_3