]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs_widgets.h
Merge branch 'master' into lpcm_encoder
[vlc] / modules / gui / macosx / prefs_widgets.h
1 /*****************************************************************************
2  * prefs_widgets.h: Preferences controls
3  *****************************************************************************
4  * Copyright (C) 2002-2007 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
27 #define LEFTMARGIN  18
28 #define RIGHTMARGIN 18
29
30 static NSMenu   *o_keys_menu = nil;
31
32 @interface VLCConfigControl : NSView
33 {
34     module_config_t *p_item;
35     char            *psz_name;
36     NSTextField     *o_label;
37     int             i_type;
38     int             i_view_type;
39     bool      b_advanced;
40 }
41
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;
45 - (NSString *)name;
46 - (int)type;
47 - (int)viewType;
48 - (BOOL)isAdvanced;
49 - (void)setYPos:(int)i_yPos;
50 - (int)intValue;
51 - (float)floatValue;
52 - (char *)stringValue;
53 - (void)applyChanges;
54 - (void)resetValues;
55 - (int)labelSize;
56 - (void) alignWithXPosition:(int)i_xPos;
57
58 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
59
60 @end
61
62 @interface StringConfigControl : VLCConfigControl
63 {
64     NSTextField     *o_textfield;
65 }
66
67 - (id) initWithItem: (module_config_t *)_p_item
68            withView: (NSView *)o_parent_view;
69
70 @end
71
72 @interface StringListConfigControl : VLCConfigControl
73 {
74     NSComboBox      *o_combo;
75 }
76
77 - (id) initWithItem: (module_config_t *)_p_item
78            withView: (NSView *)o_parent_view;
79
80 @end
81
82 @interface FileConfigControl : VLCConfigControl
83 {
84     NSTextField     *o_textfield;
85     NSButton        *o_button;
86     BOOL            b_directory;
87 }
88
89 - (id) initWithItem: (module_config_t *)_p_item
90            withView: (NSView *)o_parent_view;
91
92 - (IBAction)openFileDialog: (id)sender;
93 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void  *)o_context_info;
94
95 @end
96
97 @interface ModuleConfigControl : VLCConfigControl
98 {
99     NSPopUpButton   *o_popup;
100 }
101
102 - (id) initWithItem: (module_config_t *)_p_item
103            withView: (NSView *)o_parent_view;
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 - (IBAction)stepperChanged:(id)sender;
117 - (void)textfieldChanged:(NSNotification *)o_notification;
118
119 @end
120
121 @interface IntegerListConfigControl : VLCConfigControl
122 {
123     NSComboBox      *o_combo;
124 }
125
126 - (id) initWithItem: (module_config_t *)_p_item
127            withView: (NSView *)o_parent_view;
128
129 @end
130
131 @interface RangedIntegerConfigControl : VLCConfigControl
132 {
133     NSSlider        *o_slider;
134     NSTextField     *o_textfield;
135     NSTextField     *o_textfield_min;
136     NSTextField     *o_textfield_max;
137 }
138
139
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;
144
145 @end
146
147 @interface BoolConfigControl : VLCConfigControl
148 {
149     NSButton        *o_checkbox;
150 }
151
152 - (id) initWithItem: (module_config_t *)_p_item
153            withView: (NSView *)o_parent_view;
154
155 @end
156
157 @interface FloatConfigControl : VLCConfigControl
158 {
159     NSTextField     *o_textfield;
160     NSStepper       *o_stepper;
161 }
162
163
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;
168
169 @end
170
171 @interface RangedFloatConfigControl : VLCConfigControl
172 {
173     NSSlider        *o_slider;
174     NSTextField     *o_textfield;
175     NSTextField     *o_textfield_min;
176     NSTextField     *o_textfield_max;
177 }
178
179
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;
184
185 @end
186
187 @interface KeyConfigControl : VLCConfigControl
188 {
189     NSPopUpButton   *o_popup;
190 }
191
192 - (id) initWithItem: (module_config_t *)_p_item
193            withView: (NSView *)o_parent_view;
194
195 @end
196
197 @interface ModuleListConfigControl : VLCConfigControl
198 {
199     NSTextField     *o_textfield;
200     NSScrollView    *o_scrollview;
201     NSMutableArray  *o_modulearray;
202 }
203
204 - (id) initWithItem: (module_config_t *)_p_item
205            withView: (NSView *)o_parent_view;
206
207 @end
208
209 //#undef CONFIG_ITEM_LIST_STRING
210 //#undef CONFIG_ITEM_RANGED_INTEGER
211 //#undef CONFIG_ITEM_KEY_AFTER_10_3
212