]> git.sesse.net Git - vlc/blob - modules/gui/macosx/StringUtility.h
macosx: minor code optimization
[vlc] / modules / gui / macosx / StringUtility.h
1 /*****************************************************************************
2  * StringUtility.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2012 VLC authors and VideoLAN
5  * $Id$
6  *
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>
11  *
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.
16  *
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.
21  *
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  *****************************************************************************/
26
27 #import <Cocoa/Cocoa.h>
28
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]
34
35 unsigned int CocoaKeyToVLC(unichar i_key);
36
37 @interface VLCStringUtility : NSObject
38
39 + (VLCStringUtility *)sharedInstance;
40
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;
46
47 - (NSString *)VLCKeyToString:(NSString *)theString;
48 - (unsigned int)VLCModifiersToCocoa:(NSString *)theString;
49
50 @end