prefs_widgets.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * prefs_widgets.h: Preferences controls
00003  *****************************************************************************
00004  * Copyright (C) 2002-2007 the VideoLAN team
00005  * $Id: 8d44a7733481de855f405c96669bb57c8b1f248d $
00006  *
00007  * Authors: Derk-Jan Hartman <hartman at videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #define CONFIG_ITEM_STRING_LIST (CONFIG_ITEM_STRING + 1)
00025 #define CONFIG_ITEM_RANGED_INTEGER (CONFIG_ITEM_INTEGER + 1)
00026 #define CONFIG_ITEM_KEY_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
00027 #define LEFTMARGIN  18
00028 #define RIGHTMARGIN 18
00029 
00030 static NSMenu   *o_keys_menu = nil;
00031 
00032 @interface VLCConfigControl : NSView
00033 {
00034     module_config_t *p_item;
00035     char            *psz_name;
00036     NSTextField     *o_label;
00037     int             i_type;
00038     int             i_view_type;
00039     bool      b_advanced;
00040 }
00041 
00042 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
00043         withView: (NSView *)o_parent_view;
00044 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
00045 - (NSString *)name;
00046 - (int)type;
00047 - (int)viewType;
00048 - (BOOL)isAdvanced;
00049 - (void)setYPos:(int)i_yPos;
00050 - (int)intValue;
00051 - (float)floatValue;
00052 - (char *)stringValue;
00053 - (void)applyChanges;
00054 - (void)resetValues;
00055 - (int)labelSize;
00056 - (void) alignWithXPosition:(int)i_xPos;
00057 
00058 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
00059 
00060 @end
00061 
00062 @interface StringConfigControl : VLCConfigControl
00063 {
00064     NSTextField     *o_textfield;
00065 }
00066 
00067 - (id) initWithItem: (module_config_t *)_p_item
00068            withView: (NSView *)o_parent_view;
00069 
00070 @end
00071 
00072 @interface StringListConfigControl : VLCConfigControl
00073 {
00074     NSComboBox      *o_combo;
00075 }
00076 
00077 - (id) initWithItem: (module_config_t *)_p_item
00078            withView: (NSView *)o_parent_view;
00079 
00080 @end
00081 
00082 @interface FileConfigControl : VLCConfigControl
00083 {
00084     NSTextField     *o_textfield;
00085     NSButton        *o_button;
00086     BOOL            b_directory;
00087 }
00088 
00089 - (id) initWithItem: (module_config_t *)_p_item
00090            withView: (NSView *)o_parent_view;
00091 
00092 - (IBAction)openFileDialog: (id)sender;
00093 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void  *)o_context_info;
00094 
00095 @end
00096 
00097 @interface ModuleConfigControl : VLCConfigControl
00098 {
00099     NSPopUpButton   *o_popup;
00100 }
00101 
00102 - (id) initWithItem: (module_config_t *)_p_item
00103            withView: (NSView *)o_parent_view;
00104 
00105 @end
00106 
00107 @interface IntegerConfigControl : VLCConfigControl
00108 {
00109     NSTextField     *o_textfield;
00110     NSStepper       *o_stepper;
00111 }
00112 
00113 
00114 - (id) initWithItem: (module_config_t *)_p_item
00115            withView: (NSView *)o_parent_view;
00116 - (IBAction)stepperChanged:(id)sender;
00117 - (void)textfieldChanged:(NSNotification *)o_notification;
00118 
00119 @end
00120 
00121 @interface IntegerListConfigControl : VLCConfigControl
00122 {
00123     NSComboBox      *o_combo;
00124 }
00125 
00126 - (id) initWithItem: (module_config_t *)_p_item
00127            withView: (NSView *)o_parent_view;
00128 
00129 @end
00130 
00131 @interface RangedIntegerConfigControl : VLCConfigControl
00132 {
00133     NSSlider        *o_slider;
00134     NSTextField     *o_textfield;
00135     NSTextField     *o_textfield_min;
00136     NSTextField     *o_textfield_max;
00137 }
00138 
00139 
00140 - (id) initWithItem: (module_config_t *)_p_item
00141            withView: (NSView *)o_parent_view;
00142 - (IBAction)sliderChanged:(id)sender;
00143 - (void)textfieldChanged:(NSNotification *)o_notification;
00144 
00145 @end
00146 
00147 @interface BoolConfigControl : VLCConfigControl
00148 {
00149     NSButton        *o_checkbox;
00150 }
00151 
00152 - (id) initWithItem: (module_config_t *)_p_item
00153            withView: (NSView *)o_parent_view;
00154 
00155 @end
00156 
00157 @interface FloatConfigControl : VLCConfigControl
00158 {
00159     NSTextField     *o_textfield;
00160     NSStepper       *o_stepper;
00161 }
00162 
00163 
00164 - (id) initWithItem: (module_config_t *)_p_item
00165            withView: (NSView *)o_parent_view;
00166 - (IBAction)stepperChanged:(id)sender;
00167 - (void)textfieldChanged:(NSNotification *)o_notification;
00168 
00169 @end
00170 
00171 @interface RangedFloatConfigControl : VLCConfigControl
00172 {
00173     NSSlider        *o_slider;
00174     NSTextField     *o_textfield;
00175     NSTextField     *o_textfield_min;
00176     NSTextField     *o_textfield_max;
00177 }
00178 
00179 
00180 - (id) initWithItem: (module_config_t *)_p_item
00181            withView: (NSView *)o_parent_view;
00182 - (IBAction)sliderChanged:(id)sender;
00183 - (void)textfieldChanged:(NSNotification *)o_notification;
00184 
00185 @end
00186 
00187 @interface KeyConfigControl : VLCConfigControl
00188 {
00189     NSPopUpButton   *o_popup;
00190 }
00191 
00192 - (id) initWithItem: (module_config_t *)_p_item
00193            withView: (NSView *)o_parent_view;
00194 
00195 @end
00196 
00197 @interface ModuleListConfigControl : VLCConfigControl
00198 {
00199     NSTextField     *o_textfield;
00200     NSScrollView    *o_scrollview;
00201     NSMutableArray  *o_modulearray;
00202 }
00203 
00204 - (id) initWithItem: (module_config_t *)_p_item
00205            withView: (NSView *)o_parent_view;
00206 
00207 @end
00208 
00209 //#undef CONFIG_ITEM_LIST_STRING
00210 //#undef CONFIG_ITEM_RANGED_INTEGER
00211 //#undef CONFIG_ITEM_KEY_AFTER_10_3
00212 

Generated on Tue May 25 08:04:56 2010 for VLC by  doxygen 1.5.6