WIMM Labs


com.wimm.framework.provider
Class Calendar.Events

java.lang.Object
  extended by com.wimm.framework.provider.Calendar.Events
All Implemented Interfaces:
BaseColumns, Calendar.EventColumns
Enclosing class:
Calendar

public static final class Calendar.Events
extends Object
implements BaseColumns, Calendar.EventColumns

This class provides access to the Event table.

Since:
WIMM SDK 1.0.0

Field Summary
static Uri CONTENT_URI
          The content:// style URL for this table.
static String DEFAULT_SORT_ORDER
          The default sort order for this table.
 
Fields inherited from interface android.provider.BaseColumns
_COUNT, _ID
 
Fields inherited from interface com.wimm.framework.provider.Calendar.EventColumns
ATTENDEES, CALENDAR, CONTENT, END, ID, IS_ALL_DAY, LOCATION, REMINDERS, START, TITLE
 
Constructor Summary
Calendar.Events()
           
 
Method Summary
static Calendar.Event getEvent(ContentResolver cr, String calendarId, String eventId)
          Retrieves the Calendar.Event for the calendar and ID provided by the eventUri.
static Cursor getEventCursorForDay(ContentResolver cr, Time date)
          Returns a cursor pointing to all events that occur between 00:00:00 and 23:59:59 on date.
static Calendar.Event getEventFromCursor(Cursor c)
          Retrieves an Calendar.Event object from a Cursor at the current row.
static Calendar.Event[] getEventsOnDay(ContentResolver cr, Time date)
          Returns all events that occur between 00:00:00 and 23:59:59 on date.
static Calendar.Event getNextEvent(ContentResolver cr, long displayTimeout)
          Returns the first event that matches the following conditions: event has not started yet, or event started within the last displayTimeout seconds event has not ended yet
static Cursor query(ContentResolver cr, String[] projection)
          Use this method to query for a Cursor that points to all Events in the Calendar App database.
static Cursor query(ContentResolver cr, String[] projection, String where, String[] whereArgs, String orderBy)
          Use this method to query with arguments for a Cursor that points to specific Events in the Calendar App database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_URI

public static final Uri CONTENT_URI
The content:// style URL for this table.

Since:
WIMM SDK 1.0.0

DEFAULT_SORT_ORDER

public static final String DEFAULT_SORT_ORDER
The default sort order for this table.

Since:
WIMM SDK 1.0.0
See Also:
Constant Field Values
Constructor Detail

Calendar.Events

public Calendar.Events()
Method Detail

query

public static final Cursor query(ContentResolver cr,
                                 String[] projection)
Use this method to query for a Cursor that points to all Events in the Calendar App database.

For example to query for all Calendar.EventColumns of all the Events from the Calendar App database:

Parameters:
cr - The ContentResolver.
Returns:
The Cursor.
Since:
WIMM SDK 1.0.0

query

public static final Cursor query(ContentResolver cr,
                                 String[] projection,
                                 String where,
                                 String[] whereArgs,
                                 String orderBy)
Use this method to query with arguments for a Cursor that points to specific Events in the Calendar App database.

For example to query for all Calendar.EventColumns of all the Events happening in the next 3 days from the Calendar App database:

Parameters:
cr - The ContentResolver.
projection - The list of columns to put into the cursor. If null all columns are included.
where - The filter to apply.
whereArgs - The filter arguments.
orderBy - How to sort the cursor rows. If null the provider defines the sort order.
Returns:
The Cursor.
Since:
WIMM SDK 1.0.0

getEventFromCursor

public static final Calendar.Event getEventFromCursor(Cursor c)
Retrieves an Calendar.Event object from a Cursor at the current row.

Returns null if no more rows exist.

See query(android.content.ContentResolver, java.lang.String[]) sample code for usage example.

Parameters:
c - The Cursor.
Returns:
The Calendar.Event.
Since:
WIMM SDK 1.0.0

getEvent

public static final Calendar.Event getEvent(ContentResolver cr,
                                            String calendarId,
                                            String eventId)
Retrieves the Calendar.Event for the calendar and ID provided by the eventUri.

Returns null if no event was found.

Parameters:
cr - The ContentResolver.
calendarId - The calendar ID.
eventId - The event ID.
Returns:
The Calendar.Event.
Since:
WIMM SDK 1.0.0

getNextEvent

public static final Calendar.Event getNextEvent(ContentResolver cr,
                                                long displayTimeout)
Returns the first event that matches the following conditions:

If multiple events are found then the event with the earliest starting date is returned.

Returns null if no event was found.

Parameters:
cr - The ContentResolver.
displayTimeout - The amount of time (in seconds) during which a recently started event will still be considered the next event.
Returns:
The Calendar.Event.
Since:
WIMM SDK 1.0.0

getEventsOnDay

public static final Calendar.Event[] getEventsOnDay(ContentResolver cr,
                                                    Time date)
Returns all events that occur between 00:00:00 and 23:59:59 on date.

Returns null if no events were found.

Parameters:
cr - The ContentResolver.
date - The date (Time) to search for events.
Returns:
An array of Calendar.Event.
Since:
WIMM SDK 1.0.0

getEventCursorForDay

public static final Cursor getEventCursorForDay(ContentResolver cr,
                                                Time date)
Returns a cursor pointing to all events that occur between 00:00:00 and 23:59:59 on date.

Returns null if the query fails.

Parameters:
cr - The ContentResolver.
date - The date (Time) to search for events.
Returns:
A Cursor.

WIMM Labs