]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs_widgets.h
Added widget, fix save, etc.
[vlc] / modules / gui / macosx / prefs_widgets.h
1 /*****************************************************************************
2  * prefs_widgets.h: Preferences controls
3  *****************************************************************************
4  * Copyright (C) 2002-2003 VideoLAN
5  * $Id$
6  *
7  * Authors: Derk-Jan Hartman <hartman at videolan.org> 
8  *
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.
13  * 
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.
18  *
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
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)
28
29 @interface VLCConfigControl : NSView
30 {
31     module_config_t *p_item;
32     char            *psz_name;
33     NSTextField     *o_label;
34     int             i_type;
35     vlc_bool_t      b_advanced;
36 }
37
38 + (VLCConfigControl *)newControl: (module_config_t *)_p_item withView: (NSView *)o_parent_view yOffset:(int) i_yPos lastItem: (int) i_lastItem;
39 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
40 - (NSString *)getName;
41 - (int)getType;
42 - (BOOL)isAdvanced;
43
44 - (int)intValue;
45 - (float)floatValue;
46 - (char *)stringValue;
47 - (void)applyChanges;
48 static NSMenu   *o_keys_menu = nil;
49
50 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
51
52 @end
53
54 @interface StringConfigControl : VLCConfigControl
55 {
56     NSTextField     *o_textfield;
57 }
58
59 - (id) initWithItem: (module_config_t *)_p_item
60            withView: (NSView *)o_parent_view
61            withVerticalOffset: (int)i_yPos
62            withLastItem: (int)i_lastItem;
63
64 @end
65
66 @interface StringListConfigControl : VLCConfigControl
67 {
68     NSComboBox      *o_combo;
69 }
70
71 - (id) initWithItem: (module_config_t *)_p_item
72            withView: (NSView *)o_parent_view
73            withVerticalOffset: (int)i_yPos
74            withLastItem: (int)i_lastItem;
75
76 @end
77
78 @interface FileConfigControl : VLCConfigControl
79 {
80     NSTextField     *o_textfield;
81     NSButton        *o_button;
82     BOOL            b_directory;
83 }
84
85 - (id) initWithItem: (module_config_t *)_p_item
86            withView: (NSView *)o_parent_view
87            withVerticalOffset: (int)i_yPos
88            withLastItem: (int)i_lastItem;
89
90 - (IBAction)openFileDialog: (id)sender;
91 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void  *)o_context_info;
92
93 @end
94
95 @interface ModuleConfigControl : VLCConfigControl
96 {
97     NSPopUpButton   *o_popup;
98 }
99
100 - (id) initWithItem: (module_config_t *)_p_item
101            withView: (NSView *)o_parent_view
102            withVerticalOffset: (int)i_yPos
103            withLastItem: (int)i_lastItem;
104
105 @end
106
107 @interface IntegerConfigControl : VLCConfigControl
108 {
109     NSTextField     *o_textfield;
110     NSStepper       *o_stepper;
111 }
112
113
114 - (id) initWithItem: (module_config_t *)_p_item
115            withView: (NSView *)o_parent_view
116            withVerticalOffset: (int)i_yPos
117            withLastItem: (int)i_lastItem;
118 - (IBAction)stepperChanged:(id)sender;
119 - (void)textfieldChanged:(NSNotification *)o_notification;
120
121 @end
122
123 @interface IntegerListConfigControl : VLCConfigControl
124 {
125     NSComboBox      *o_combo;
126 }
127
128 - (id) initWithItem: (module_config_t *)_p_item
129            withView: (NSView *)o_parent_view
130            withVerticalOffset: (int)i_yPos
131            withLastItem: (int)i_lastItem;
132
133 @end
134
135 @interface RangedIntegerConfigControl : VLCConfigControl
136 {
137     NSSlider        *o_slider;
138     NSTextField     *o_textfield;
139     NSTextField     *o_textfield_min;
140     NSTextField     *o_textfield_max;
141 }
142
143
144 - (id) initWithItem: (module_config_t *)_p_item
145            withView: (NSView *)o_parent_view
146            withVerticalOffset: (int)i_yPos
147            withLastItem: (int)i_lastItem;
148 - (IBAction)sliderChanged:(id)sender;
149 - (void)textfieldChanged:(NSNotification *)o_notification;
150
151 @end
152
153 @interface BoolConfigControl : VLCConfigControl
154 {
155     NSButton        *o_checkbox;
156 }
157
158 - (id) initWithItem: (module_config_t *)_p_item
159            withView: (NSView *)o_parent_view
160            withVerticalOffset: (int)i_yPos
161            withLastItem: (int)i_lastItem;
162
163 @end
164
165 @interface FloatConfigControl : VLCConfigControl
166 {
167     NSTextField     *o_textfield;
168     NSStepper       *o_stepper;
169 }
170
171
172 - (id) initWithItem: (module_config_t *)_p_item
173            withView: (NSView *)o_parent_view
174            withVerticalOffset: (int)i_yPos
175            withLastItem: (int)i_lastItem;
176 - (IBAction)stepperChanged:(id)sender;
177 - (void)textfieldChanged:(NSNotification *)o_notification;
178
179 @end
180
181 @interface RangedFloatConfigControl : VLCConfigControl
182 {
183     NSSlider        *o_slider;
184     NSTextField     *o_textfield;
185     NSTextField     *o_textfield_min;
186     NSTextField     *o_textfield_max;
187 }
188
189
190 - (id) initWithItem: (module_config_t *)_p_item
191            withView: (NSView *)o_parent_view
192            withVerticalOffset: (int)i_yPos
193            withLastItem: (int)i_lastItem;
194 - (IBAction)sliderChanged:(id)sender;
195 - (void)textfieldChanged:(NSNotification *)o_notification;
196
197 @end
198
199 @interface KeyConfigControlBefore103 : VLCConfigControl
200 {
201     NSButton        *o_cmd_checkbox;
202     NSButton        *o_ctrl_checkbox;
203     NSButton        *o_alt_checkbox;
204     NSButton        *o_shift_checkbox;
205     NSPopUpButton   *o_popup;
206 }
207
208 - (id) initWithItem: (module_config_t *)_p_item
209            withView: (NSView *)o_parent_view
210            withVerticalOffset: (int)i_yPos
211            withLastItem: (int)i_lastItem;
212
213 @end
214
215 @interface KeyConfigControlAfter103 : VLCConfigControl
216 {
217     NSPopUpButton   *o_popup;
218 }
219
220 - (id) initWithItem: (module_config_t *)_p_item
221            withView: (NSView *)o_parent_view
222            withVerticalOffset: (int)i_yPos
223            withLastItem: (int)i_lastItem;
224
225 @end
226
227 @interface ModuleListConfigControl : VLCConfigControl
228 {
229     NSTextField     *o_textfield;
230     NSScrollView    *o_scrollview;
231     NSMutableArray  *o_modulearray;
232 }
233
234 - (id) initWithItem: (module_config_t *)_p_item
235            withView: (NSView *)o_parent_view
236            withVerticalOffset: (int)i_yPos
237            withLastItem: (int)i_lastItem;
238
239 @end
240
241 //#undef CONFIG_ITEM_LIST_STRING
242 //#undef CONFIG_ITEM_RANGED_INTEGER
243 //#undef CONFIG_ITEM_KEY_BEFORE_10_3
244 //#undef CONFIG_ITEM_KEY_AFTER_10_3
245