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

com.bugvm.apple.messageui.MFMessageComposeViewController 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.messageui;

/**/
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.uikit.*;
/**/

/**/
/**
 * @since Available in iOS 4.0 and later.
 */
/**/
/**/@Library("MessageUI") @NativeClass/**/
/**/public/**/ class /**/MFMessageComposeViewController/**/ 
    extends /**/UINavigationController/**/ 
    /**//**/ {

    public static class Notifications {
        /**
         * @since Available in iOS 5.0 and later.
         */
        public static NSObject observeTextMessageAvailabilityDidChange(final VoidBlock1 block) {
            return NSNotificationCenter.getDefaultCenter().addObserver(TextMessageAvailabilityDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1() {
                @Override
                public void invoke(NSNotification a) {
                    NSDictionary data = a.getUserInfo();
                    if (data.containsKey(TextMessageAvailabilityKey())) {
                        NSNumber val = (NSNumber)data.get(TextMessageAvailabilityKey());
                        block.invoke(val.booleanValue());
                    } else {
                        block.invoke(false);
                    }
                }
            });
        }
    }
    /**/public static class MFMessageComposeViewControllerPtr extends Ptr {}/**/
    /**/static { ObjCRuntime.bind(MFMessageComposeViewController.class); }/**/
    /**//**/
    /**/
    public MFMessageComposeViewController() {}
    protected MFMessageComposeViewController(SkipInit skipInit) { super(skipInit); }
    /**/
    /**/
    @Property(selector = "messageComposeDelegate")
    public native MFMessageComposeViewControllerDelegate getMessageComposeDelegate();
    @Property(selector = "setMessageComposeDelegate:", strongRef = true)
    public native void setMessageComposeDelegate(MFMessageComposeViewControllerDelegate v);
    @Property(selector = "recipients")
    public native @com.bugvm.rt.bro.annotation.Marshaler(NSArray.AsStringListMarshaler.class) List getRecipients();
    @Property(selector = "setRecipients:")
    public native void setRecipients(@com.bugvm.rt.bro.annotation.Marshaler(NSArray.AsStringListMarshaler.class) List v);
    @Property(selector = "body")
    public native String getBody();
    @Property(selector = "setBody:")
    public native void setBody(String v);
    @Property(selector = "subject")
    public native String getSubject();
    @Property(selector = "setSubject:")
    public native void setSubject(String v);
    @Property(selector = "attachments")
    public native @com.bugvm.rt.bro.annotation.Marshaler(MFMessageComposeViewControllerAttachment.AsListMarshaler.class) List getAttachments();
    /**/
    /**//**/
    /**/
    /**
     * @since Available in iOS 5.0 and later.
     */
    @GlobalValue(symbol="MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification", optional=true)
    public static native NSString TextMessageAvailabilityDidChangeNotification();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @GlobalValue(symbol="MFMessageComposeViewControllerTextMessageAvailabilityKey", optional=true)
    protected static native NSString TextMessageAvailabilityKey();
    
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "disableUserAttachments")
    public native void disableUserAttachments();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "addAttachmentURL:withAlternateFilename:")
    public native boolean addAttachment(NSURL attachmentURL, String alternateFilename);
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "addAttachmentData:typeIdentifier:filename:")
    public native boolean addAttachment(NSData attachmentData, String uti, String filename);
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Method(selector = "canSendText")
    public static native boolean canSendText();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "canSendSubject")
    public static native boolean canSendSubject();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "canSendAttachments")
    public static native boolean canSendAttachments();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Method(selector = "isSupportedAttachmentUTI:")
    public static native boolean isSupportedAttachmentUTI(String uti);
    /**/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy