![JAR search and dependency download from the Maven repository](/logo.png)
com.bugvm.apple.coretext.CTAttributedStringAttributes Maven / Gradle / Ivy
/*
* 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.coretext;
/**/
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.corefoundation.*;
import com.bugvm.apple.coregraphics.*;
import com.bugvm.apple.coremedia.*;
import com.bugvm.apple.uikit.*;
/* */
/**/
/* */
/**/@Library("CoreText")/* */
@Marshaler(/**/CTAttributedStringAttributes/* */.Marshaler.class)
/**/public/* */ class /**/CTAttributedStringAttributes/* */
extends /**/CFDictionaryWrapper/* */
/**//* */ {
/**/
public static class Marshaler {
@MarshalsPointer
public static CTAttributedStringAttributes toObject(Class cls, long handle, long flags) {
CFDictionary o = (CFDictionary) CFType.Marshaler.toObject(CFDictionary.class, handle, flags);
if (o == null) {
return null;
}
return new CTAttributedStringAttributes(o);
}
@MarshalsPointer
public static long toNative(CTAttributedStringAttributes o, long flags) {
if (o == null) {
return 0L;
}
return CFType.Marshaler.toNative(o.data, flags);
}
}
public static class AsListMarshaler {
@MarshalsPointer
public static List toObject(Class extends CFType> cls, long handle, long flags) {
CFArray o = (CFArray) CFType.Marshaler.toObject(CFArray.class, handle, flags);
if (o == null) {
return null;
}
List list = new ArrayList<>();
for (int i = 0; i < o.size(); i++) {
list.add(new CTAttributedStringAttributes(o.get(i, CFDictionary.class)));
}
return list;
}
@MarshalsPointer
public static long toNative(List l, long flags) {
if (l == null) {
return 0L;
}
CFArray array = CFMutableArray.create();
for (CTAttributedStringAttributes i : l) {
array.add(i.getDictionary());
}
return CFType.Marshaler.toNative(array, flags);
}
}
/* */
/**/
public CTAttributedStringAttributes(CFDictionary data) {
super(data);
}
public CTAttributedStringAttributes() {}
/* */
/**/
public boolean has(CTAttributedStringAttribute key) {
return data.containsKey(key.value());
}
public T get(CTAttributedStringAttribute key, Class type) {
if (has(key)) {
return data.get(key.value(), type);
}
return null;
}
public CTAttributedStringAttributes set(CTAttributedStringAttribute key, NativeObject value) {
data.put(key.value(), value);
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTFont getFont() {
if (has(CTAttributedStringAttribute.Font)) {
CTFont val = get(CTAttributedStringAttribute.Font, CTFont.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setFont(CTFont font) {
set(CTAttributedStringAttribute.Font, font);
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public boolean usesForegroundColorFromContext() {
if (has(CTAttributedStringAttribute.ForegroundColorFromContext)) {
CFBoolean val = get(CTAttributedStringAttribute.ForegroundColorFromContext, CFBoolean.class);
return val.booleanValue();
}
return false;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setUsesForegroundColorFromContext(boolean usesForegroundColorFromContext) {
set(CTAttributedStringAttribute.ForegroundColorFromContext, CFBoolean.valueOf(usesForegroundColorFromContext));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public float getKern() {
if (has(CTAttributedStringAttribute.Kern)) {
CFNumber val = get(CTAttributedStringAttribute.Kern, CFNumber.class);
return val.floatValue();
}
return 0;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setKern(float kern) {
set(CTAttributedStringAttribute.Kern, CFNumber.valueOf(kern));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public int getLigature() {
if (has(CTAttributedStringAttribute.Ligature)) {
CFNumber val = get(CTAttributedStringAttribute.Ligature, CFNumber.class);
return val.intValue();
}
return 0;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setLigature(int ligature) {
set(CTAttributedStringAttribute.Ligature, CFNumber.valueOf(ligature));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CGColor getForegroundColor() {
if (has(CTAttributedStringAttribute.ForegroundColor)) {
CGColor val = get(CTAttributedStringAttribute.ForegroundColor, CGColor.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setForegroundColor(CGColor foregroundColor) {
set(CTAttributedStringAttribute.ForegroundColor, foregroundColor);
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTParagraphStyle getParagraphStyle() {
if (has(CTAttributedStringAttribute.ParagraphStyle)) {
CTParagraphStyle val = get(CTAttributedStringAttribute.ParagraphStyle, CTParagraphStyle.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setParagraphStyle(CTParagraphStyle paragraphStyle) {
set(CTAttributedStringAttribute.ParagraphStyle, paragraphStyle);
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public double getStrokeWidth() {
if (has(CTAttributedStringAttribute.StrokeWidth)) {
CFNumber val = get(CTAttributedStringAttribute.StrokeWidth, CFNumber.class);
return val.doubleValue();
}
return 0;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setStrokeWidth(double strokeWidth) {
set(CTAttributedStringAttribute.StrokeWidth, CFNumber.valueOf(strokeWidth));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CGColor getStrokeColor() {
if (has(CTAttributedStringAttribute.StrokeColor)) {
CGColor val = get(CTAttributedStringAttribute.StrokeColor, CGColor.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setStrokeColor(CGColor strokeColor) {
set(CTAttributedStringAttribute.StrokeColor, strokeColor);
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTUnderlineStyle getUnderlineStyle() {
if (has(CTAttributedStringAttribute.UnderlineStyle)) {
CFNumber val = get(CTAttributedStringAttribute.UnderlineStyle, CFNumber.class);
return new CTUnderlineStyle(val.longValue());
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setUnderlineStyle(CTUnderlineStyle underlineStyle) {
set(CTAttributedStringAttribute.UnderlineStyle, CFNumber.valueOf(underlineStyle.value()));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public int getSuperscript() {
if (has(CTAttributedStringAttribute.Superscript)) {
CFNumber val = get(CTAttributedStringAttribute.Superscript, CFNumber.class);
return val.intValue();
}
return 0;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setSuperscript(int superscript) {
set(CTAttributedStringAttribute.Superscript, CFNumber.valueOf(superscript));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CGColor getUnderlineColor() {
if (has(CTAttributedStringAttribute.UnderlineColor)) {
CGColor val = get(CTAttributedStringAttribute.UnderlineColor, CGColor.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setUnderlineColor(CGColor underlineColor) {
set(CTAttributedStringAttribute.UnderlineColor, underlineColor);
return this;
}
/**
* @since Available in iOS 4.3 and later.
*/
public boolean usesVerticalForms() {
if (has(CTAttributedStringAttribute.VerticalForms)) {
CFBoolean val = get(CTAttributedStringAttribute.VerticalForms, CFBoolean.class);
return val.booleanValue();
}
return false;
}
/**
* @since Available in iOS 4.3 and later.
*/
public CTAttributedStringAttributes setUsesVerticalForms(boolean usesVerticalForms) {
set(CTAttributedStringAttribute.VerticalForms, CFBoolean.valueOf(usesVerticalForms));
return this;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTGlyphInfo getGlyphInfo() {
if (has(CTAttributedStringAttribute.GlyphInfo)) {
CTGlyphInfo val = get(CTAttributedStringAttribute.GlyphInfo, CTGlyphInfo.class);
return val;
}
return null;
}
/**
* @since Available in iOS 3.2 and later.
*/
public CTAttributedStringAttributes setGlyphInfo(CTGlyphInfo glyphInfo) {
set(CTAttributedStringAttribute.GlyphInfo, glyphInfo);
return this;
}
/**
* @since Available in iOS 7.0 and later.
*/
public String getLanguage() {
if (has(CTAttributedStringAttribute.Language)) {
CFString val = get(CTAttributedStringAttribute.Language, CFString.class);
return val.toString();
}
return null;
}
/**
* @since Available in iOS 7.0 and later.
*/
public CTAttributedStringAttributes setLanguage(String language) {
set(CTAttributedStringAttribute.Language, new CFString(language));
return this;
}
/**
* @since Available in iOS 6.0 and later.
*/
public CTBaselineClass getBaselineClass() {
if (has(CTAttributedStringAttribute.BaselineClass)) {
CFString val = get(CTAttributedStringAttribute.BaselineClass, CFString.class);
return CTBaselineClass.valueOf(val);
}
return null;
}
/**
* @since Available in iOS 6.0 and later.
*/
public CTAttributedStringAttributes setBaselineClass(CTBaselineClass baselineClass) {
set(CTAttributedStringAttribute.BaselineClass, baselineClass.value());
return this;
}
/**
* @since Available in iOS 8.0 and later.
*/
public CTRubyAnnotation getRubyAnnotation() {
if (has(CTAttributedStringAttribute.RubyAnnotation)) {
CTRubyAnnotation val = get(CTAttributedStringAttribute.RubyAnnotation, CTRubyAnnotation.class);
return val;
}
return null;
}
/**
* @since Available in iOS 8.0 and later.
*/
public CTAttributedStringAttributes setRubyAnnotation(CTRubyAnnotation rubyAnnotation) {
set(CTAttributedStringAttribute.RubyAnnotation, rubyAnnotation);
return this;
}
/* */
/**/
/* */
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy