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

com.bugvm.apple.eventkit.EKEventStore 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.eventkit;

/**/
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.coregraphics.*;
import com.bugvm.apple.corelocation.*;
import com.bugvm.apple.addressbook.*;
import com.bugvm.apple.mapkit.*;
/**/

/**/
/**
 * @since Available in iOS 4.0 and later.
 */
/**/
/**/@Library("EventKit") @NativeClass/**/
/**/public/**/ class /**/EKEventStore/**/ 
    extends /**/NSObject/**/ 
    /**//**/ {

    public static class Notifications {
        /**
         * @since Available in iOS 4.0 and later.
         */
        public static NSObject observeChanged(EKEventStore object, final VoidBlock1 block) {
            return NSNotificationCenter.getDefaultCenter().addObserver(ChangedNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1() {
                @Override
                public void invoke(NSNotification a) {
                    block.invoke((EKEventStore) a.getObject());
                }
            });
        }
    }
    /**/public static class EKEventStorePtr extends Ptr {}/**/
    /**/static { ObjCRuntime.bind(EKEventStore.class); }/**/
    /**//**/
    /**/
    public EKEventStore() {}
    protected EKEventStore(SkipInit skipInit) { super(skipInit); }
    /**/
    /**/
    @Property(selector = "eventStoreIdentifier")
    public native String getEventStoreIdentifier();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Property(selector = "sources")
    public native NSArray getSources();
    @Property(selector = "defaultCalendarForNewEvents")
    public native EKCalendar getDefaultCalendarForNewEvents();
    /**/
    /**//**/
    /**/
    /**
     * @since Available in iOS 4.0 and later.
     */
    @GlobalValue(symbol="EKEventStoreChangedNotification", optional=true)
    public static native NSString ChangedNotification();
    
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "requestAccessToEntityType:completion:")
    public native void requestAccess(EKEntityType entityType, @Block VoidBlock2 completion);
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "sourceWithIdentifier:")
    public native EKSource getSource(String identifier);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "calendarsForEntityType:")
    public native NSArray getCalendars(EKEntityType entityType);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "defaultCalendarForNewReminders")
    public native EKCalendar getDefaultCalendarForNewReminders();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "calendarWithIdentifier:")
    public native EKCalendar getCalendar(String identifier);
    /**
     * @since Available in iOS 5.0 and later.
     */
    public boolean saveCalendar(EKCalendar calendar, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = saveCalendar(calendar, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "saveCalendar:commit:error:")
    private native boolean saveCalendar(EKCalendar calendar, boolean commit, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 5.0 and later.
     */
    public boolean removeCalendar(EKCalendar calendar, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = removeCalendar(calendar, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "removeCalendar:commit:error:")
    private native boolean removeCalendar(EKCalendar calendar, boolean commit, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "calendarItemWithIdentifier:")
    public native EKCalendarItem getCalendarItem(String identifier);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "calendarItemsWithExternalIdentifier:")
    public native NSArray getCalendarItems(String externalIdentifier);
    /**
     * @since Available in iOS 4.0 and later.
     */
    public boolean saveEvent(EKEvent event, EKSpan span) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = saveEvent(event, span, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Method(selector = "saveEvent:span:error:")
    private native boolean saveEvent(EKEvent event, EKSpan span, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 4.0 and later.
     */
    public boolean removeEvent(EKEvent event, EKSpan span) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = removeEvent(event, span, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 4.0 and later.
     */
    @Method(selector = "removeEvent:span:error:")
    private native boolean removeEvent(EKEvent event, EKSpan span, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 5.0 and later.
     */
    public boolean saveEvent(EKEvent event, EKSpan span, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = saveEvent(event, span, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "saveEvent:span:commit:error:")
    private native boolean saveEvent(EKEvent event, EKSpan span, boolean commit, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 5.0 and later.
     */
    public boolean removeEvent(EKEvent event, EKSpan span, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = removeEvent(event, span, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "removeEvent:span:commit:error:")
    private native boolean removeEvent(EKEvent event, EKSpan span, boolean commit, NSError.NSErrorPtr error);
    @Method(selector = "eventWithIdentifier:")
    public native EKEvent getEvent(String identifier);
    @Method(selector = "eventsMatchingPredicate:")
    public native NSArray getEvents(NSPredicate predicate);
    @Method(selector = "enumerateEventsMatchingPredicate:usingBlock:")
    public native void enumerateEvents(NSPredicate predicate, @Block VoidBlock2 block);
    @Method(selector = "predicateForEventsWithStartDate:endDate:calendars:")
    public native NSPredicate getPredicateForEvents(NSDate startDate, NSDate endDate, NSArray calendars);
    /**
     * @since Available in iOS 6.0 and later.
     */
    public boolean saveReminder(EKReminder reminder, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = saveReminder(reminder, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "saveReminder:commit:error:")
    private native boolean saveReminder(EKReminder reminder, boolean commit, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 6.0 and later.
     */
    public boolean removeReminder(EKReminder reminder, boolean commit) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = removeReminder(reminder, commit, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "removeReminder:commit:error:")
    private native boolean removeReminder(EKReminder reminder, boolean commit, NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "fetchRemindersMatchingPredicate:completion:")
    public native NSObject fetchReminders(NSPredicate predicate, @Block VoidBlock1> completion);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "cancelFetchRequest:")
    public native void cancelFetchRequest(NSObject fetchIdentifier);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "predicateForRemindersInCalendars:")
    public native NSPredicate getPredicateForReminders(NSArray calendars);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "predicateForIncompleteRemindersWithDueDateStarting:ending:calendars:")
    public native NSPredicate getPredicateForIncompleteReminders(NSDate startDate, NSDate endDate, NSArray calendars);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "predicateForCompletedRemindersWithCompletionDateStarting:ending:calendars:")
    public native NSPredicate getPredicateForCompletedReminders(NSDate startDate, NSDate endDate, NSArray calendars);
    /**
     * @since Available in iOS 5.0 and later.
     */
    public boolean commit() throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = commit(ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "commit:")
    private native boolean commit(NSError.NSErrorPtr error);
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "reset")
    public native void reset();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Method(selector = "refreshSourcesIfNecessary")
    public native void refreshSourcesIfNecessary();
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Method(selector = "authorizationStatusForEntityType:")
    public static native EKAuthorizationStatus getAuthorizationStatusForEntityType(EKEntityType entityType);
    /**/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy