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

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

There is a newer version: 1.2.9
Show 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 /**/CFPreferences/**/ 
    extends /**/CocoaUtility/**/ 
    /**//**/ {

    /**/
    /**/
    /**/static { Bro.bind(CFPreferences.class); }/**/
    /**//**/
    /**//**/
    /**//**/
    /**//**/
    private String applicationID;
    
    public CFPreferences(CFPreferencesDomain domain) {
        this(domain.value().toString());
    }
    public CFPreferences(String applicationID) {
        this.applicationID = applicationID;
    }
    
    public static CFPreferences create(CFPreferencesDomain domain) {
        return new CFPreferences(domain);
    }
    public static CFPreferences create(String applicationID) {
        return new CFPreferences(applicationID);
    }
    
    public CFType getValue(String key) {
        return getAppValue(applicationID, key);
    }
    public boolean getBooleanValue(String key) {
        return getAppBooleanValue(key, applicationID, new BooleanPtr());
    }
    public boolean hasBooleanValue(String key) {
        BooleanPtr ptr = new BooleanPtr();
        getAppBooleanValue(key, applicationID, ptr);
        return ptr.get();
    }
    public long getLongValue(String key) {
        return getAppIntegerValue(key, applicationID, new BooleanPtr());
    }
    public boolean hasLongValue(String key) {
        BooleanPtr ptr = new BooleanPtr();
        getAppIntegerValue(key, applicationID, ptr);
        return ptr.get();
    }
    public void setValue(String key, CFType value) {
        setAppValue(key, value, applicationID);
    }
    public void addSuitePreferences(String suiteID) {
        addSuitePreferencesToApp(applicationID, suiteID);
    }
    public void removeSuitePreferences(String suiteID) {
        removeSuitePreferencesFromApp(applicationID, suiteID);
    }
    public boolean synchronize() {
        return appSynchronize(applicationID);
    }
    public CFType getValue(String key, CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        return getValue(key, applicationID, userName.value().toString(), hostName.value().toString());
    }
    public CFType getValue(String key, String userName, String hostName) {
        return getValue(key, applicationID, userName, hostName);
    }
    public Map getMultipleValues(List keysToFetch, CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        return getMultiple(keysToFetch, applicationID, userName.value().toString(), hostName.value().toString());
    }
    public Map getMultipleValues(List keysToFetch, String userName, String hostName) {
        return getMultiple(keysToFetch, applicationID, userName, hostName);
    }
    public void setValue(String key, CFType value, CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        setValue(key, value, applicationID, userName.value().toString(), hostName.value().toString());
    }
    public void setValue(String key, CFType value, String userName, String hostName) {
        setValue(key, value, applicationID, userName, hostName);
    }
    public void setMultipleValues(Map keysToSet, List keysToRemove, CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        setMultiple(keysToSet, keysToRemove, applicationID, userName.value().toString(), hostName.value().toString());
    }
    public void setMultipleValues(Map keysToSet, List keysToRemove, String userName, String hostName) {
        setMultiple(keysToSet, keysToRemove, applicationID, userName, hostName);
    }
    public boolean synchronize(CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        return synchronize(applicationID, userName.value().toString(), hostName.value().toString());
    }
    public boolean synchronize(String userName, String hostName) {
        return synchronize(applicationID, userName, hostName);
    }
    public List getKeyList(CFPreferencesDomain userName, CFPreferencesDomain hostName) {
        return getKeyList(applicationID, userName.value().toString(), hostName.value().toString());
    }
    public List getKeyList(String userName, String hostName) {
        return getKeyList(applicationID, userName, hostName);
    }
    public boolean isValueForced(String key) {
        return appValueIsForced(key, applicationID);
    }
    /**/
    @Bridge(symbol="CFPreferencesCopyAppValue", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFType.NoRetainMarshaler.class) CFType getAppValue(String key, String applicationID);
    @Bridge(symbol="CFPreferencesGetAppBooleanValue", optional=true)
    protected static native boolean getAppBooleanValue(String key, String applicationID, BooleanPtr keyExistsAndHasValidFormat);
    @Bridge(symbol="CFPreferencesGetAppIntegerValue", optional=true)
    protected static native @MachineSizedSInt long getAppIntegerValue(String key, String applicationID, BooleanPtr keyExistsAndHasValidFormat);
    @Bridge(symbol="CFPreferencesSetAppValue", optional=true)
    protected static native void setAppValue(String key, CFType value, String applicationID);
    @Bridge(symbol="CFPreferencesAddSuitePreferencesToApp", optional=true)
    protected static native void addSuitePreferencesToApp(String applicationID, String suiteID);
    @Bridge(symbol="CFPreferencesRemoveSuitePreferencesFromApp", optional=true)
    protected static native void removeSuitePreferencesFromApp(String applicationID, String suiteID);
    @Bridge(symbol="CFPreferencesAppSynchronize", optional=true)
    protected static native boolean appSynchronize(String applicationID);
    @Bridge(symbol="CFPreferencesCopyValue", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFType.NoRetainMarshaler.class) CFType getValue(String key, String applicationID, String userName, String hostName);
    @Bridge(symbol="CFPreferencesCopyMultiple", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFDictionary.AsStringMapMarshaler.class) Map getMultiple(@com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List keysToFetch, String applicationID, String userName, String hostName);
    @Bridge(symbol="CFPreferencesSetValue", optional=true)
    protected static native void setValue(String key, CFType value, String applicationID, String userName, String hostName);
    @Bridge(symbol="CFPreferencesSetMultiple", optional=true)
    protected static native void setMultiple(@com.bugvm.rt.bro.annotation.Marshaler(CFDictionary.AsStringMapMarshaler.class) Map keysToSet, @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List keysToRemove, String applicationID, String userName, String hostName);
    @Bridge(symbol="CFPreferencesSynchronize", optional=true)
    protected static native boolean synchronize(String applicationID, String userName, String hostName);
    /**
     * @since Available in iOS 2.0 and later.
     * @deprecated Deprecated in iOS 7.0.
     */
    @Deprecated
    @Bridge(symbol="CFPreferencesCopyApplicationList", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getApplicationList(String userName, String hostName);
    @Bridge(symbol="CFPreferencesCopyKeyList", optional=true)
    protected static native @com.bugvm.rt.bro.annotation.Marshaler(CFArray.AsStringListMarshaler.class) List getKeyList(String applicationID, String userName, String hostName);
    @Bridge(symbol="CFPreferencesAppValueIsForced", optional=true)
    protected static native boolean appValueIsForced(String key, String applicationID);
    /**/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy