summaryrefslogtreecommitdiff
path: root/CocoaSharp/UIKit/UITextField.cs
blob: a53a7b7514a24c35e7e38f03c240715871cb5e56 (plain)
1
using ObjectiveC;
using System;
using SharpSwift.Attributes;
using System.Collections.Generic;
using Foundation;
using CoreGraphics;

namespace UIKit
{
    /// <summary>
    /// A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.
    /// </summary>
    /// <see cref="https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITextField_Class/index.html#//apple_ref/occ/cl/UITextField"/>
    [iOSVersion(2)]
    public class UITextField : UIControl//, AnyObject, NSCoding, NSObjectProtocol, Reflectable, UIAccessibilityIdentification, UIAppearance, UIAppearanceContainer, UICoordinateSpace, UIDynamicItem, UIKeyInput, UITextInput, UITextInputTraits, UITraitEnvironment
    {
        public UITextField() { }
        /// <summary>
        /// Returns the drawing rectangle for the text field’s text.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("textRectForBounds")]
        public virtual CGRect TextRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Draws the receiver’s text in the specified rectangle.
        /// </summary>
        /// <param name="rect">The rectangle in which to draw the text.</param>
        [iOSVersion(2)]
        [Export("drawTextInRect")]
        public virtual void DrawTextInRect(CGRect rect) {  }
        
        /// <summary>
        /// Returns the drawing rectangle for the text field’s placeholder text
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("placeholderRectForBounds")]
        public virtual CGRect PlaceholderRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Draws the receiver’s placeholder text in the specified rectangle.
        /// </summary>
        /// <param name="rect">The rectangle in which to draw the placeholder text.</param>
        [iOSVersion(2)]
        [Export("drawPlaceholderInRect")]
        public virtual void DrawPlaceholderInRect(CGRect rect) {  }
        
        /// <summary>
        /// Returns the receiver’s border rectangle.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("borderRectForBounds")]
        public virtual CGRect BorderRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Returns the rectangle in which editable text can be displayed.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("editingRectForBounds")]
        public virtual CGRect EditingRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Returns the drawing rectangle for the built-in clear button.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("clearButtonRectForBounds")]
        public virtual CGRect ClearButtonRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Returns the drawing rectangle of the receiver’s left overlay view.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("leftViewRectForBounds")]
        public virtual CGRect LeftViewRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// Returns the drawing location of the receiver’s right overlay view.
        /// </summary>
        /// <param name="bounds">The bounding rectangle of the receiver.</param>
        [iOSVersion(2)]
        [Export("rightViewRectForBounds")]
        public virtual CGRect RightViewRectForBounds(CGRect bounds) { return default(CGRect); }
        
        /// <summary>
        /// The text displayed by the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("text")]
        public string Text { get; set; }
        
        /// <summary>
        /// The styled text displayed by the text field.
        /// </summary>
        [iOSVersion(6)]
        [Export("attributedText")]
        public NSAttributedString AttributedText { get; set; }
        
        /// <summary>
        /// The string that is displayed when there is no other text in the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("placeholder")]
        public string Placeholder { get; set; }
        
        /// <summary>
        /// The styled string that is displayed when there is no other text in the text field.
        /// </summary>
        [iOSVersion(6)]
        [Export("attributedPlaceholder")]
        public NSAttributedString AttributedPlaceholder { get; set; }
        
        /// <summary>
        /// The default attributes to apply to the text.
        /// </summary>
        [iOSVersion(7)]
        [Export("defaultTextAttributes")]
        public Dictionary<NSObject, AnyObject> DefaultTextAttributes { get; set; }
        
        /// <summary>
        /// The font of the text.
        /// </summary>
        [iOSVersion(2)]
        [Export("font")]
        public UIFont Font { get; set; }
        
        /// <summary>
        /// The color of the text.
        /// </summary>
        [iOSVersion(2)]
        [Export("textColor")]
        public UIColor TextColor { get; set; }
        
        /// <summary>
        /// The technique to use for aligning the text.
        /// </summary>
        [iOSVersion(2)]
        [Export("textAlignment")]
        public NSTextAlignment TextAlignment { get; set; }
        
        /// <summary>
        /// The attributes to apply to new text being entered by the user.
        /// </summary>
        [iOSVersion(6)]
        [Export("typingAttributes")]
        public Dictionary<NSObject, AnyObject> TypingAttributes { get; set; }
        
        /// <summary>
        /// A Boolean value indicating whether the font size should be reduced in order to fit the text string into the text field’s bounding rectangle.
        /// </summary>
        [iOSVersion(2)]
        [Export("adjustsFontSizeToFitWidth")]
        public bool AdjustsFontSizeToFitWidth { get; set; }
        
        /// <summary>
        /// The size of the smallest permissible font with which to draw the text field’s text.
        /// </summary>
        [iOSVersion(2)]
        [Export("minimumFontSize")]
        public CGFloat MinimumFontSize { get; set; }
        
        /// <summary>
        /// A Boolean value indicating whether the text field is currently in edit mode. (read-only)
        /// </summary>
        [iOSVersion(2)]
        [Export("editing")]
        public bool Editing { get; private set; }
        
        /// <summary>
        /// A Boolean value indicating whether the text field removes old text when editing begins.
        /// </summary>
        [iOSVersion(2)]
        [Export("clearsOnBeginEditing")]
        public bool ClearsOnBeginEditing { get; set; }
        
        /// <summary>
        /// A Boolean value indicating whether inserting text replaces the previous contents.
        /// </summary>
        [iOSVersion(6)]
        [Export("clearsOnInsertion")]
        public bool ClearsOnInsertion { get; set; }
        
        /// <summary>
        /// A Boolean value indicating whether the user may edit the attributes of the text in the text field.
        /// </summary>
        [iOSVersion(6)]
        [Export("allowsEditingTextAttributes")]
        public bool AllowsEditingTextAttributes { get; set; }
        
        /// <summary>
        /// The border style used by the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("borderStyle")]
        public UITextBorderStyle BorderStyle { get; set; }
        
        /// <summary>
        /// The image that represents the background appearance of the text field when it is enabled.
        /// </summary>
        [iOSVersion(2)]
        [Export("background")]
        public UIImage Background { get; set; }
        
        /// <summary>
        /// The image that represents the background appearance of the text field when it is disabled.
        /// </summary>
        [iOSVersion(2)]
        [Export("disabledBackground")]
        public UIImage DisabledBackground { get; set; }
        
        /// <summary>
        /// Controls when the standard clear button appears in the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("clearButtonMode")]
        public UITextFieldViewMode ClearButtonMode { get; set; }
        
        /// <summary>
        /// The overlay view displayed on the left side of the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("leftView")]
        public UIView LeftView { get; set; }
        
        /// <summary>
        /// Controls when the left overlay view appears in the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("leftViewMode")]
        public UITextFieldViewMode LeftViewMode { get; set; }
        
        /// <summary>
        /// The overlay view displayed on the right side of the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("rightView")]
        public UIView RightView { get; set; }
        
        /// <summary>
        /// Controls when the right overlay view appears in the text field.
        /// </summary>
        [iOSVersion(2)]
        [Export("rightViewMode")]
        public UITextFieldViewMode RightViewMode { get; set; }
        
        /// <summary>
        /// The receiver’s delegate.
        /// </summary>
        [iOSVersion(2)]
        [Export("delegate")]
        public UITextFieldDelegate Delegate { get; set; }
        
        /// <summary>
        /// The custom input view to display when the text field becomes the first responder.
        /// </summary>
        [iOSVersion(3.2)]
        [Export("inputView")]
        public UIView InputView { get; set; }
        
        /// <summary>
        /// The custom accessory view to display when the text field becomes the first responder
        /// </summary>
        [iOSVersion(3.2)]
        [Export("inputAccessoryView")]
        public UIView InputAccessoryView { get; set; }
    }
    /// <summary>
    /// The type of border drawn around the text field.
    /// </summary>
    [iOSVersion(2)]
    public enum UITextBorderStyle
    {
        /// <summary>
        /// The text field does not display a border.
        /// </summary>
        [iOSVersion(2)]
        None,
        /// <summary>
        /// Displays a thin rectangle around the text field.
        /// </summary>
        [iOSVersion(2)]
        Line,
        /// <summary>
        /// Displays a bezel-style border for the text field. This style is typically used for standard data-entry fields.
        /// </summary>
        [iOSVersion(2)]
        Bezel,
        /// <summary>
        /// Displays a rounded-style border for the text field.
        /// </summary>
        [iOSVersion(2)]
        RoundedRect,
    }
    /// <summary>
    /// Defines the times at which overlay views appear in a text field.
    /// </summary>
    [iOSVersion(2)]
    public enum UITextFieldViewMode
    {
        /// <summary>
        /// The overlay view never appears.
        /// </summary>
        [iOSVersion(2)]
        Never,
        /// <summary>
        /// The overlay view is displayed only while text is being edited in the text field.
        /// </summary>
        [iOSVersion(2)]
        WhileEditing,
        /// <summary>
        /// The overlay view is displayed only when text is not being edited.
        /// </summary>
        [iOSVersion(2)]
        UnlessEditing,
        /// <summary>
        /// The overlay view is always displayed.
        /// </summary>
        [iOSVersion(2)]
        Always,
    }
    /// <summary>
    /// 
    /// </summary>
    [iOSVersion(2)]
    public class UITextFieldTextDidBeginEditingNotification : NSNotification
    {
        public UITextFieldTextDidBeginEditingNotification() : base("", null) { }
    }
    /// <summary>
    /// 
    /// </summary>
    [iOSVersion(2)]
    public class UITextFieldTextDidChangeNotification : NSNotification
    {
        public UITextFieldTextDidChangeNotification() : base("", null) { }
    }
    /// <summary>
    /// 
    /// </summary>
    [iOSVersion(2)]
    public class UITextFieldTextDidEndEditingNotification : NSNotification
    {
        public UITextFieldTextDidEndEditingNotification() : base("", null) { }
    }
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback