All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bugvm.apple.corefoundation.CFLocale Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2013-2015 RoboVM AB
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bugvm.apple.corefoundation;

/**/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
import com.bugvm.apple.dispatch.*;
import com.bugvm.apple.coreservices.*;
import com.bugvm.apple.coremedia.*;
import com.bugvm.apple.uikit.*;
import com.bugvm.apple.coretext.*;
/**/

/**/
/**/
/**/@Library("CoreFoundation")/**/
/**/public/**/ class /**/CFLocale/**/ 
    extends /**/CFType/**/ 
    /**//**/ {

    public static class Notifications {
        public static NSObject observeCurrentLocaleDidChange(final Runnable block) {
            return NSNotificationCenter.getDefaultCenter().addObserver(CurrentLocaleDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1() {
                @Override
                public void invoke(NSNotification a) {
                    block.run();
                }
            });
        }
    }
    
    /**/public static class CFLocalePtr extends Ptr {}/**/
    /**/static { Bro.bind(CFLocale.class); }/**/
    /**//**/
    /**/
    protected CFLocale() {}
    /**/
    /**//**/
    /**//**/
    public static String getCanonicalLanguageIdentifier(String localeIdentifier) {
        return getCanonicalLanguageIdentifier(null, localeIdentifier);
    }
    public static String getCanonicalLocaleIdentifier(String localeIdentifier) {
        return getCanonicalLocaleIdentifier(null, localeIdentifier);
    }
    public static String getCanonicalLocaleIdentifier(short lcode, short rcode) {
        return getCanonicalLocaleIdentifier(null, lcode, rcode);
    }
    /**
     * @since Available in iOS 4.0 and later.
     */
    public static String getLocaleIdentifierFromWindowsLocaleCode(int lcid) {
        return getLocaleIdentifierFromWindowsLocaleCode(null, lcid);
    }
    public static CFLocaleComponents getComponentsFromLocaleIdentifier(String localeID) {
        return getComponentsFromLocaleIdentifier(null, localeID);
    }
    public static String getLocaleIdentifierFromComponents(CFLocaleComponents components) {
        return getLocaleIdentifierFromComponents(null, components);
    }
    public static CFLocale create(String localeIdentifier) {
        return create(null, localeIdentifier);
    }
    public static CFLocale createCopy(CFLocale locale) {
        return createCopy(null, locale);
    }
    /**/
    /**
     * @since Available in iOS 2.0 and later.
     */
    @GlobalValue(symbol="kCFLocaleCurrentLocaleDidChangeNotification", optional=true)
    public static native NSString CurrentLocaleDidChangeNotification();
    
    @Bridge(symbol="CFLocaleGetTypeID", optional=true)
    public static native @MachineSizedUInt long getClassTypeID();
    @Bridge(symbol="CFLocaleGetSystem", optional=true)
    public static native CFLocale getSystem();
    @Bridge(symbol="CFLocaleCopyCurrent", optional=true)
    public static native CFLocale getCurrent();
    @Bridge(symbol="CFLocaleCopyAvailableLocaleIdentifiers", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getAvailableLocaleIdentifiers();
    @Bridge(symbol="CFLocaleCopyISOLanguageCodes", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getISOLanguageCodes();
    @Bridge(symbol="CFLocaleCopyISOCountryCodes", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getISOCountryCodes();
    @Bridge(symbol="CFLocaleCopyISOCurrencyCodes", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getISOCurrencyCodes();
    /**
     * @since Available in iOS 2.0 and later.
     */
    @Bridge(symbol="CFLocaleCopyCommonISOCurrencyCodes", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getCommonISOCurrencyCodes();
    /**
     * @since Available in iOS 2.0 and later.
     */
    @Bridge(symbol="CFLocaleCopyPreferredLanguages", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getPreferredLanguages();
    @Bridge(symbol="CFLocaleCreateCanonicalLanguageIdentifierFromString", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getCanonicalLanguageIdentifier(CFAllocator allocator, String localeIdentifier);
    @Bridge(symbol="CFLocaleCreateCanonicalLocaleIdentifierFromString", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getCanonicalLocaleIdentifier(CFAllocator allocator, String localeIdentifier);
    @Bridge(symbol="CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getCanonicalLocaleIdentifier(CFAllocator allocator, short lcode, short rcode);
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Bridge(symbol="CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getLocaleIdentifierFromWindowsLocaleCode(CFAllocator allocator, int lcid);
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Bridge(symbol="CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier", optional=true)
    public static native int getWindowsLocaleCodeFromLocaleIdentifier(String localeIdentifier);
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Bridge(symbol="CFLocaleGetLanguageCharacterDirection", optional=true)
    public static native CFLocaleLanguageDirection getLanguageCharacterDirection(String isoLangCode);
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Bridge(symbol="CFLocaleGetLanguageLineDirection", optional=true)
    public static native CFLocaleLanguageDirection getLanguageLineDirection(String isoLangCode);
    @Bridge(symbol="CFLocaleCreateComponentsFromLocaleIdentifier", optional=true)
    protected static native CFLocaleComponents getComponentsFromLocaleIdentifier(CFAllocator allocator, String localeID);
    @Bridge(symbol="CFLocaleCreateLocaleIdentifierFromComponents", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getLocaleIdentifierFromComponents(CFAllocator allocator, CFLocaleComponents dictionary);
    @Bridge(symbol="CFLocaleCreate", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFType.NoRetainMarshaler.class) CFLocale create(CFAllocator allocator, String localeIdentifier);
    @Bridge(symbol="CFLocaleCreateCopy", optional=true)
    public static native @com.bugvm.rt.bro.annotation.Marshaler(CFType.NoRetainMarshaler.class) CFLocale createCopy(CFAllocator allocator, CFLocale locale);
    @Bridge(symbol="CFLocaleGetIdentifier", optional=true)
    public native String getIdentifier();
    @Bridge(symbol="CFLocaleGetValue", optional=true)
    public native CFType getComponent(CFLocaleComponent key);
    @Bridge(symbol="CFLocaleCopyDisplayNameForPropertyValue", optional=true)
    public native @com.bugvm.rt.bro.annotation.Marshaler(CFString.AsStringNoRetainMarshaler.class) String getComponentDisplayName(CFLocaleComponent key, String value);
    /**/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy