]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs_widgets.h
ef55cec980f856eafaceb166b7fc5233d97d9389
[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 @interface VLCConfigControl : NSView
31 {
32     module_config_t *p_item;
33     char            *psz_name;
34     NSTextField     *o_label;
35     int             i_type;
36     int             i_view_type;
37     bool      b_advanced;
38 }
39
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;
44 - (int)getType;
45 - (int)getViewType;
46 - (BOOL)isAdvanced;
47 - (void)setYPos:(int)i_yPos;
48 - (int)intValue;
49 - (float)floatValue;
50 - (char *)stringValue;
51 - (void)applyChanges;
52 - (int)getLabelSize;
53 - (void) alignWithXPosition:(int)i_xPos;
54 static NSMenu   *o_keys_menu = nil;
55
56 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
57
58 @end
59
60 @interface StringConfigControl : VLCConfigControl
61 {
62     NSTextField     *o_textfield;
63 }
64
65 - (id) initWithItem: (module_config_t *)_p_item
66            withView: (NSView *)o_parent_view;
67
68 @end
69
70 @interface StringListConfigControl : VLCConfigControl
71 {
72     NSComboBox      *o_combo;
73 }
74
75 - (id) initWithItem: (module_config_t *)_p_item
76            withView: (NSView *)o_parent_view;
77
78 @end
79
80 @interface FileConfigControl : VLCConfigControl
81 {
82     NSTextField     *o_textfield;
83     NSButton        *o_button;
84     BOOL            b_directory;
85 }
86
87 - (id) initWithItem: (module_config_t *)_p_item
88            withView: (NSView *)o_parent_view;
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
103 @end
104
105 @interface IntegerConfigControl : VLCConfigControl
106 {
107     NSTextField     *o_textfield;
108     NSStepper       *o_stepper;
109 }
110
111
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;
116
117 @end
118
119 @interface IntegerListConfigControl : VLCConfigControl
120 {
121     NSComboBox      *o_combo;
122 }
123
124 - (id) initWithItem: (module_config_t *)_p_item
125            withView: (NSView *)o_parent_view;
126
127 @end
128
129 @interface RangedIntegerConfigControl : VLCConfigControl
130 {
131     NSSlider        *o_slider;
132     NSTextField     *o_textfield;
133     NSTextField     *o_textfield_min;
134     NSTextField     *o_textfield_max;
135 }
136
137
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;
142
143 @end
144
145 @interface BoolConfigControl : VLCConfigControl
146 {
147     NSButton        *o_checkbox;
148 }
149
150 - (id) initWithItem: (module_config_t *)_p_item
151            withView: (NSView *)o_parent_view;
152
153 @end
154
155 @interface FloatConfigControl : VLCConfigControl
156 {
157     NSTextField     *o_textfield;
158     NSStepper       *o_stepper;
159 }
160
161
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;
166
167 @end
168
169 @interface RangedFloatConfigControl : VLCConfigControl
170 {
171     NSSlider        *o_slider;
172     NSTextField     *o_textfield;
173     NSTextField     *o_textfield_min;
174     NSTextField     *o_textfield_max;
175 }
176
177
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;
182
183 @end
184
185 @interface KeyConfigControl : VLCConfigControl
186 {
187     NSPopUpButton   *o_popup;
188 }
189
190 - (id) initWithItem: (module_config_t *)_p_item
191            withView: (NSView *)o_parent_view;
192
193 @end
194
195 @interface ModuleListConfigControl : VLCConfigControl
196 {
197     NSTextField     *o_textfield;
198     NSScrollView    *o_scrollview;
199     NSMutableArray  *o_modulearray;
200 }
201
202 - (id) initWithItem: (module_config_t *)_p_item
203            withView: (NSView *)o_parent_view;
204
205 @end
206
207 //#undef CONFIG_ITEM_LIST_STRING
208 //#undef CONFIG_ITEM_RANGED_INTEGER
209 //#undef CONFIG_ITEM_KEY_AFTER_10_3
210