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 @interface VLCConfigControl : NSView
32 module_config_t *p_item;
40 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
41 withView: (NSView *)o_parent_view;
42 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
43 - (NSString *)getName;
47 - (void)setYPos:(int)i_yPos;
50 - (char *)stringValue;
53 - (void) alignWithXPosition:(int)i_xPos;
54 static NSMenu *o_keys_menu = nil;
56 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
60 @interface StringConfigControl : VLCConfigControl
62 NSTextField *o_textfield;
65 - (id) initWithItem: (module_config_t *)_p_item
66 withView: (NSView *)o_parent_view;
70 @interface StringListConfigControl : VLCConfigControl
75 - (id) initWithItem: (module_config_t *)_p_item
76 withView: (NSView *)o_parent_view;
80 @interface FileConfigControl : VLCConfigControl
82 NSTextField *o_textfield;
87 - (id) initWithItem: (module_config_t *)_p_item
88 withView: (NSView *)o_parent_view;
90 - (IBAction)openFileDialog: (id)sender;
91 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
95 @interface ModuleConfigControl : VLCConfigControl
97 NSPopUpButton *o_popup;
100 - (id) initWithItem: (module_config_t *)_p_item
101 withView: (NSView *)o_parent_view;
105 @interface IntegerConfigControl : VLCConfigControl
107 NSTextField *o_textfield;
108 NSStepper *o_stepper;
112 - (id) initWithItem: (module_config_t *)_p_item
113 withView: (NSView *)o_parent_view;
114 - (IBAction)stepperChanged:(id)sender;
115 - (void)textfieldChanged:(NSNotification *)o_notification;
119 @interface IntegerListConfigControl : VLCConfigControl
124 - (id) initWithItem: (module_config_t *)_p_item
125 withView: (NSView *)o_parent_view;
129 @interface RangedIntegerConfigControl : VLCConfigControl
132 NSTextField *o_textfield;
133 NSTextField *o_textfield_min;
134 NSTextField *o_textfield_max;
138 - (id) initWithItem: (module_config_t *)_p_item
139 withView: (NSView *)o_parent_view;
140 - (IBAction)sliderChanged:(id)sender;
141 - (void)textfieldChanged:(NSNotification *)o_notification;
145 @interface BoolConfigControl : VLCConfigControl
147 NSButton *o_checkbox;
150 - (id) initWithItem: (module_config_t *)_p_item
151 withView: (NSView *)o_parent_view;
155 @interface FloatConfigControl : VLCConfigControl
157 NSTextField *o_textfield;
158 NSStepper *o_stepper;
162 - (id) initWithItem: (module_config_t *)_p_item
163 withView: (NSView *)o_parent_view;
164 - (IBAction)stepperChanged:(id)sender;
165 - (void)textfieldChanged:(NSNotification *)o_notification;
169 @interface RangedFloatConfigControl : VLCConfigControl
172 NSTextField *o_textfield;
173 NSTextField *o_textfield_min;
174 NSTextField *o_textfield_max;
178 - (id) initWithItem: (module_config_t *)_p_item
179 withView: (NSView *)o_parent_view;
180 - (IBAction)sliderChanged:(id)sender;
181 - (void)textfieldChanged:(NSNotification *)o_notification;
185 @interface KeyConfigControl : VLCConfigControl
187 NSPopUpButton *o_popup;
190 - (id) initWithItem: (module_config_t *)_p_item
191 withView: (NSView *)o_parent_view;
195 @interface ModuleListConfigControl : VLCConfigControl
197 NSTextField *o_textfield;
198 NSScrollView *o_scrollview;
199 NSMutableArray *o_modulearray;
202 - (id) initWithItem: (module_config_t *)_p_item
203 withView: (NSView *)o_parent_view;
207 //#undef CONFIG_ITEM_LIST_STRING
208 //#undef CONFIG_ITEM_RANGED_INTEGER
209 //#undef CONFIG_ITEM_KEY_AFTER_10_3