]>
iEval git - unical.git/blob - src/ro/ieval/unical/Attendee.java
6afeaf43e12d558484c11230aacfb63a8af88851
1 package ro
.ieval
.unical
;
3 import android
.content
.ContentResolver
;
4 import android
.content
.Context
;
5 import android
.database
.Cursor
;
6 import android
.provider
.CalendarContract
;
7 import android
.provider
.CalendarContract
.Attendees
;
8 import android
.provider
.CalendarContract
.Events
;
10 final class Attendee
{
11 private static final String
[] PROJECTION
= {
14 Attendees
.ATTENDEE_NAME
,
15 Attendees
.ATTENDEE_EMAIL
,
16 Attendees
.ATTENDEE_RELATIONSHIP
,
17 Attendees
.ATTENDEE_TYPE
,
18 Attendees
.ATTENDEE_STATUS
,
22 public final long _id
;
24 public final long eventID
;
26 public final String name
;
27 /** Attendee email address **/
28 public final String email
;
30 * Attendee relationship.
32 * One of {@link CalendarContract.AttendeesColumns#RELATIONSHIP_ATTENDEE RELATIONSHIP_ATENDEE},
33 * {@link CalendarContract.AttendeesColumns#RELATIONSHIP_NONE RELATIONSHIP_NONE},
34 * {@link CalendarContract.AttendeesColumns#RELATIONSHIP_ORGANIZER RELATIONSHIP_ORGANIZER},
35 * {@link CalendarContract.AttendeesColumns#RELATIONSHIP_PERFORMER RELATIONSHIP_PERFORMER},
36 * {@link CalendarContract.AttendeesColumns#RELATIONSHIP_SPEAKER RELATIONSHIP_SPEAKER}
38 public final int relationship
;
42 * One of {@link CalendarContract.AttendeesColumns#TYPE_NONE TYPE_NONE},
43 * {@link CalendarContract.AttendeesColumns#TYPE_OPTIONAL TYPE_OPTIONAL},
44 * {@link CalendarContract.AttendeesColumns#TYPE_REQUIRED TYPE_REQUIRED},
45 * {@link CalendarContract.AttendeesColumns#TYPE_RESOURCE TYPE_RESOURCE}
47 public final int type
;
51 * One of {@link CalendarContract.AttendeesColumns#ATTENDEE_STATUS_ACCEPTED ATTENDEE_STATUS_ACCEPTED},
52 * {@link CalendarContract.AttendeesColumns#ATTENDEE_STATUS_DECLINED ATTENDEE_STATUS_DECLINED},
53 * {@link CalendarContract.AttendeesColumns#ATTENDEE_STATUS_INVITED ATTENDEE_STATUS_INVITED},
54 * {@link CalendarContract.AttendeesColumns#ATTENDEE_STATUS_NONE ATTENDEE_STATUS_NONE},
55 * {@link CalendarContract.AttendeesColumns#ATTENDEE_STATUS_TENTATIVE ATTENDEE_STATUS_TENTATIVE}
57 public final int status
;
59 private Attendee(final long _id
, final long eventID
, final String name
, final String email
, final int relationship
, final int type
, final int status
){
64 this.relationship
=relationship
;
69 public static Attendee
[] getAttendeesByEvent(final Context context
, final int eventID
){
70 final ContentResolver cr
=context
.getContentResolver();
71 final Cursor cursor
= Attendees
.query(cr
, eventID
, PROJECTION
);
73 final Attendee
[] attendees
= new Attendee
[cursor
.getCount()];
74 for(int i
=0;i
<attendees
.length
;i
++)
75 attendees
[i
]=new Attendee(cursor
.getLong(0), cursor
.getLong(1), cursor
.getString(2), cursor
.getString(3), cursor
.getInt(4), cursor
.getInt(5), cursor
.getInt(6));
This page took 0.045587 seconds and 4 git commands to generate.