com.bugvm.apple.uikit.UISearchBar 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.uikit;
/**/
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.coreanimation.*;
import com.bugvm.apple.coregraphics.*;
import com.bugvm.apple.coredata.*;
import com.bugvm.apple.coreimage.*;
import com.bugvm.apple.coretext.*;
import com.bugvm.apple.corelocation.*;
/* */
import com.bugvm.apple.corefoundation.CFDictionary;
import com.bugvm.apple.coremedia.CMTextMarkupAttributes;
/**/
/**
* @since Available in iOS 2.0 and later.
*/
/* */
/**/@Library("UIKit") @NativeClass/* */
/**/public/* */ class /**/UISearchBar/* */
extends /**/UIView/* */
/**/implements UIBarPositioning, UITextInputTraits/* */ {
/**/public static class UISearchBarPtr extends Ptr {}/* */
/**/static { ObjCRuntime.bind(UISearchBar.class); }/* */
/**//* */
/**/
public UISearchBar() {}
protected UISearchBar(SkipInit skipInit) { super(skipInit); }
public UISearchBar(@ByVal CGRect frame) { super((SkipInit) null); initObject(init(frame)); }
public UISearchBar(NSCoder aDecoder) { super((SkipInit) null); initObject(init(aDecoder)); }
/* */
/**/
@Property(selector = "barStyle")
public native UIBarStyle getBarStyle();
@Property(selector = "setBarStyle:")
public native void setBarStyle(UIBarStyle v);
@Property(selector = "delegate")
public native UISearchBarDelegate getDelegate();
@Property(selector = "setDelegate:", strongRef = true)
public native void setDelegate(UISearchBarDelegate v);
@Property(selector = "text")
public native String getText();
@Property(selector = "setText:")
public native void setText(String v);
@Property(selector = "prompt")
public native String getPrompt();
@Property(selector = "setPrompt:")
public native void setPrompt(String v);
@Property(selector = "placeholder")
public native String getPlaceholder();
@Property(selector = "setPlaceholder:")
public native void setPlaceholder(String v);
@Property(selector = "showsBookmarkButton")
public native boolean showsBookmarkButton();
@Property(selector = "setShowsBookmarkButton:")
public native void setShowsBookmarkButton(boolean v);
@Property(selector = "showsCancelButton")
public native boolean showsCancelButton();
@Property(selector = "setShowsCancelButton:")
public native void setShowsCancelButton(boolean v);
/**
* @since Available in iOS 3.2 and later.
*/
@Property(selector = "showsSearchResultsButton")
public native boolean showsSearchResultsButton();
/**
* @since Available in iOS 3.2 and later.
*/
@Property(selector = "setShowsSearchResultsButton:")
public native void setShowsSearchResultsButton(boolean v);
/**
* @since Available in iOS 3.2 and later.
*/
@Property(selector = "isSearchResultsButtonSelected")
public native boolean isSearchResultsButtonSelected();
/**
* @since Available in iOS 3.2 and later.
*/
@Property(selector = "setSearchResultsButtonSelected:")
public native void setSearchResultsButtonSelected(boolean v);
/**
* @since Available in iOS 9.0 and later.
*/
@Property(selector = "inputAssistantItem")
public native UITextInputAssistantItem getInputAssistantItem();
@Property(selector = "tintColor")
public native UIColor getTintColor();
@Property(selector = "setTintColor:")
public native void setTintColor(UIColor v);
/**
* @since Available in iOS 7.0 and later.
*/
@Property(selector = "barTintColor")
public native UIColor getBarTintColor();
/**
* @since Available in iOS 7.0 and later.
*/
@Property(selector = "setBarTintColor:")
public native void setBarTintColor(UIColor v);
/**
* @since Available in iOS 7.0 and later.
*/
@Property(selector = "searchBarStyle")
public native UISearchBarStyle getSearchBarStyle();
/**
* @since Available in iOS 7.0 and later.
*/
@Property(selector = "setSearchBarStyle:")
public native void setSearchBarStyle(UISearchBarStyle v);
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "isTranslucent")
public native boolean isTranslucent();
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "setTranslucent:")
public native void setTranslucent(boolean v);
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "scopeButtonTitles")
public native @com.bugvm.rt.bro.annotation.Marshaler(NSArray.AsStringListMarshaler.class) List getScopeButtonTitles();
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "setScopeButtonTitles:")
public native void setScopeButtonTitles(@com.bugvm.rt.bro.annotation.Marshaler(NSArray.AsStringListMarshaler.class) List v);
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "selectedScopeButtonIndex")
public native @MachineSizedSInt long getSelectedScopeButtonIndex();
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "setSelectedScopeButtonIndex:")
public native void setSelectedScopeButtonIndex(@MachineSizedSInt long v);
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "showsScopeBar")
public native boolean showsScopeBar();
/**
* @since Available in iOS 3.0 and later.
*/
@Property(selector = "setShowsScopeBar:")
public native void setShowsScopeBar(boolean v);
@Property(selector = "inputAccessoryView")
public native UIView getInputAccessoryView();
@Property(selector = "setInputAccessoryView:")
public native void setInputAccessoryView(UIView v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "backgroundImage")
public native UIImage getBackgroundImage();
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "setBackgroundImage:")
public native void setBackgroundImage(UIImage v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "scopeBarBackgroundImage")
public native UIImage getScopeBarBackgroundImage();
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "setScopeBarBackgroundImage:")
public native void setScopeBarBackgroundImage(UIImage v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "searchFieldBackgroundPositionAdjustment")
public native @ByVal UIOffset getSearchFieldBackgroundPositionAdjustment();
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "setSearchFieldBackgroundPositionAdjustment:")
public native void setSearchFieldBackgroundPositionAdjustment(@ByVal UIOffset v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "searchTextPositionAdjustment")
public native @ByVal UIOffset getSearchTextPositionAdjustment();
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "setSearchTextPositionAdjustment:")
public native void setSearchTextPositionAdjustment(@ByVal UIOffset v);
@Property(selector = "barPosition")
public native UIBarPosition getBarPosition();
@Property(selector = "autocapitalizationType")
public native UITextAutocapitalizationType getAutocapitalizationType();
@Property(selector = "setAutocapitalizationType:")
public native void setAutocapitalizationType(UITextAutocapitalizationType v);
@Property(selector = "autocorrectionType")
public native UITextAutocorrectionType getAutocorrectionType();
@Property(selector = "setAutocorrectionType:")
public native void setAutocorrectionType(UITextAutocorrectionType v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "spellCheckingType")
public native UITextSpellCheckingType getSpellCheckingType();
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "setSpellCheckingType:")
public native void setSpellCheckingType(UITextSpellCheckingType v);
@Property(selector = "keyboardType")
public native UIKeyboardType getKeyboardType();
@Property(selector = "setKeyboardType:")
public native void setKeyboardType(UIKeyboardType v);
@Property(selector = "keyboardAppearance")
public native UIKeyboardAppearance getKeyboardAppearance();
@Property(selector = "setKeyboardAppearance:")
public native void setKeyboardAppearance(UIKeyboardAppearance v);
@Property(selector = "returnKeyType")
public native UIReturnKeyType getReturnKeyType();
@Property(selector = "setReturnKeyType:")
public native void setReturnKeyType(UIReturnKeyType v);
@Property(selector = "enablesReturnKeyAutomatically")
public native boolean enablesReturnKeyAutomatically();
@Property(selector = "setEnablesReturnKeyAutomatically:")
public native void setEnablesReturnKeyAutomatically(boolean v);
@Property(selector = "isSecureTextEntry")
public native boolean isSecureTextEntry();
@Property(selector = "setSecureTextEntry:")
public native void setSecureTextEntry(boolean v);
/* */
/**//* */
/**
* @since Available in iOS 5.0 and later.
*/
public void setScopeBarButtonTitleTextAttributes(NSAttributedStringAttributes attributes, UIControlState state) {
if (attributes == null) {
setScopeBarButtonTitleTextAttributesDictionary(null, state);
} else {
setScopeBarButtonTitleTextAttributesDictionary(attributes.getDictionary(), state);
}
}
/**
* @since Available in iOS 5.0 and later.
*/
@WeaklyLinked
public void setScopeBarButtonTitleTextMarkupAttributes(CMTextMarkupAttributes attributes, UIControlState state) {
if (attributes == null) {
setScopeBarButtonTitleTextAttributesDictionary(null, state);
} else {
setScopeBarButtonTitleTextAttributesDictionary(attributes.getDictionary().as(NSDictionary.class), state);
}
}
/**
* @since Available in iOS 5.0 and later.
*/
@WeaklyLinked
public void setScopeBarButtonTitleCoreTextAttributes(CTAttributedStringAttributes attributes, UIControlState state) {
if (attributes == null) {
setScopeBarButtonTitleTextAttributesDictionary(null, state);
} else {
setScopeBarButtonTitleTextAttributesDictionary(attributes.getDictionary().as(NSDictionary.class), state);
}
}
/**
* @since Available in iOS 5.0 and later.
*/
public NSAttributedStringAttributes getScopeBarButtonTitleTextAttributes(UIControlState state) {
NSDictionary dict = getScopeBarButtonTitleTextAttributesDictionary(state);
if (dict == null) return null;
return new NSAttributedStringAttributes(dict);
}
/**
* @since Available in iOS 5.0 and later.
*/
@WeaklyLinked
public CMTextMarkupAttributes getScopeBarButtonTitleTextMarkupAttributes(UIControlState state) {
NSDictionary dict = getScopeBarButtonTitleTextAttributesDictionary(state);
if (dict == null) return null;
return new CMTextMarkupAttributes(dict.as(CFDictionary.class));
}
/**
* @since Available in iOS 5.0 and later.
*/
@WeaklyLinked
public CTAttributedStringAttributes getScopeBarButtonTitleCoreTextAttributes(UIControlState state) {
NSDictionary dict = getScopeBarButtonTitleTextAttributesDictionary(state);
if (dict == null) return null;
return new CTAttributedStringAttributes(dict.as(CFDictionary.class));
}
/**/
@Method(selector = "initWithFrame:")
protected native @Pointer long init(@ByVal CGRect frame);
@Method(selector = "initWithCoder:")
protected native @Pointer long init(NSCoder aDecoder);
/**
* @since Available in iOS 3.0 and later.
*/
@Method(selector = "setShowsCancelButton:animated:")
public native void setShowsCancelButton(boolean showsCancelButton, boolean animated);
/**
* @since Available in iOS 7.0 and later.
*/
@Method(selector = "setBackgroundImage:forBarPosition:barMetrics:")
public native void setBackgroundImage(UIImage backgroundImage, UIBarPosition barPosition, UIBarMetrics barMetrics);
/**
* @since Available in iOS 7.0 and later.
*/
@Method(selector = "backgroundImageForBarPosition:barMetrics:")
public native UIImage getBackgroundImage(UIBarPosition barPosition, UIBarMetrics barMetrics);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setSearchFieldBackgroundImage:forState:")
public native void setSearchFieldBackgroundImage(UIImage backgroundImage, UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "searchFieldBackgroundImageForState:")
public native UIImage getSearchFieldBackgroundImage(UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setImage:forSearchBarIcon:state:")
public native void setImageForSearchBarIcon(UIImage iconImage, UISearchBarIcon icon, UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "imageForSearchBarIcon:state:")
public native UIImage getImageForSearchBarIcon(UISearchBarIcon icon, UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setScopeBarButtonBackgroundImage:forState:")
public native void setScopeBarButtonBackgroundImage(UIImage backgroundImage, UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "scopeBarButtonBackgroundImageForState:")
public native UIImage getScopeBarButtonBackgroundImage(UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setScopeBarButtonDividerImage:forLeftSegmentState:rightSegmentState:")
public native void setScopeBarButtonDividerImage(UIImage dividerImage, UIControlState leftState, UIControlState rightState);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "scopeBarButtonDividerImageForLeftSegmentState:rightSegmentState:")
public native UIImage getScopeBarButtonDividerImage(UIControlState leftState, UIControlState rightState);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setScopeBarButtonTitleTextAttributes:forState:")
public native void setScopeBarButtonTitleTextAttributesDictionary(NSDictionary attributes, UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "scopeBarButtonTitleTextAttributesForState:")
public native NSDictionary getScopeBarButtonTitleTextAttributesDictionary(UIControlState state);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "setPositionAdjustment:forSearchBarIcon:")
public native void setPositionAdjustmentForSearchBarIcon(@ByVal UIOffset adjustment, UISearchBarIcon icon);
/**
* @since Available in iOS 5.0 and later.
*/
@Method(selector = "positionAdjustmentForSearchBarIcon:")
public native @ByVal UIOffset getPositionAdjustmentForSearchBarIcon(UISearchBarIcon icon);
/* */
}