diff dwt/internal/cocoa/NSLocale.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSLocale.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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;
+    }
+
+}