1 /*****************************************************************************
2 * StringUtility.h: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2012 VLC authors and VideoLAN
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <hartman at videolan dot org>
10 * Felix Paul Kühne <fkuehne at videolan dot org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 #import <Cocoa/Cocoa.h>
29 #define _NS(s) [[VLCStringUtility sharedInstance] localizedString: s]
30 /* Get an alternate version of the string.
31 * This string is stored as '1:string' but when displayed it only displays
32 * the translated string. the translation should be '1:translatedstring' though */
33 #define _ANS(s) [[[VLCStringUtility sharedInstance] localizedString: _(s)] substringFromIndex:2]
35 unsigned int CocoaKeyToVLC(unichar i_key);
37 @interface VLCStringUtility : NSObject
39 + (VLCStringUtility *)sharedInstance;
41 - (NSString *)localizedString:(const char *)psz;
42 - (char *)delocalizeString:(NSString *)psz;
43 - (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
44 - (NSString *)OSXStringKeyToString:(NSString *)theString;
45 - (NSString *)getCurrentTimeAsString:(input_thread_t *)p_input negative:(BOOL)b_negative;
47 - (NSString *)VLCKeyToString:(NSString *)theString;
48 - (unsigned int)VLCModifiersToCocoa:(NSString *)theString;