Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSLocale.d @ 13:f565d3a95c0a
Ported dwt.internal
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 22 Aug 2008 16:46:34 +0200 |
parents | 8b48be5454ce |
children |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * * Port to the D programming language: * Jacob Carlborg <jacob.carlborg@gmail.com> *******************************************************************************/ module dwt.internal.cocoa.NSLocale; import dwt.internal.cocoa.id; import dwt.internal.cocoa.NSArray; import dwt.internal.cocoa.NSDictionary; import dwt.internal.cocoa.NSObject; import dwt.internal.cocoa.NSString; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; public class NSLocale : NSObject { public this () { super(); } public this (objc.id id) { super(id); } public static NSArray ISOCountryCodes () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOCountryCodes); return result !is null ? new NSArray(result) : null; } public static NSArray ISOCurrencyCodes () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOCurrencyCodes); return result !is null ? new NSArray(result) : null; } public static NSArray ISOLanguageCodes () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOLanguageCodes); return result !is null ? new NSArray(result) : null; } public static id autoupdatingCurrentLocale () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_autoupdatingCurrentLocale); return result !is null ? new id(result) : null; } public static NSArray availableLocaleIdentifiers () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_availableLocaleIdentifiers); return result !is null ? new NSArray(result) : null; } public static NSString canonicalLocaleIdentifierFromString (NSString string) { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_canonicalLocaleIdentifierFromString_1, string !is null ? string.id_ : null); return result !is null ? new NSString(result) : null; } public static NSArray commonISOCurrencyCodes () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_commonISOCurrencyCodes); return result !is null ? new NSArray(result) : null; } public static NSDictionary componentsFromLocaleIdentifier (NSString string) { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_componentsFromLocaleIdentifier_1, string !is null ? string.id_ : null); return result !is null ? new NSDictionary(result) : null; } public static id currentLocale () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_currentLocale); return result !is null ? new id(result) : null; } public NSString displayNameForKey (id key, id value) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_displayNameForKey_1value_1, key !is null ? key.id_ : null, value !is null ? value.id_ : null); return result !is null ? new NSString(result) : null; } public id initWithLocaleIdentifier (NSString string) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithLocaleIdentifier_1, string !is null ? string.id_ : null); return result !is null ? new id(result) : null; } public NSString localeIdentifier () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_localeIdentifier); return result !is null ? new NSString(result) : null; } public static NSString localeIdentifierFromComponents (NSDictionary dict) { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_localeIdentifierFromComponents_1, dict !is null ? dict.id_ : null); return result !is null ? new NSString(result) : null; } public id objectForKey (id key) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectForKey_1, key !is null ? key.id_ : null); return result !is null ? new id(result) : null; } public static NSArray preferredLanguages () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_preferredLanguages); return result !is null ? new NSArray(result) : null; } public static id systemLocale () { objc.id result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_systemLocale); return result !is null ? new id(result) : null; } }