1 // Copyright 2007 The Android Open Source Project 2 package com.google.wireless.gdata.calendar.data; 3 4 /** 5 * Contains information about a reminder for an event. 6 */ 7 public class Reminder { 8 /** 9 * Default reminder method as defined on the calendar server. 10 */ 11 public static final byte METHOD_DEFAULT = 0; 12 13 /** 14 * Reminder that uses e-mail for notification. 15 */ 16 public static final byte METHOD_EMAIL = 1; 17 18 /** 19 * Reminder that uses sms for notification. 20 */ 21 public static final byte METHOD_SMS = 2; 22 23 /** 24 * Reminder that uses a local alert for notification. 25 */ 26 public static final byte METHOD_ALERT = 3; 27 28 /** 29 * Reminder that uses a calendar-wide default time for the alarm. 30 */ 31 public static final int MINUTES_DEFAULT = -1; 32 33 // do absolute times work with recurrences? 34 // private String absoluteTime; 35 private int minutes = MINUTES_DEFAULT; 36 private byte method = METHOD_DEFAULT; 37 38 /** 39 * Creates a new empty reminder. 40 */ Reminder()41 public Reminder() { 42 } 43 44 /** 45 * Returns the method of the reminder. 46 * @return The method of the reminder. 47 */ getMethod()48 public byte getMethod() { 49 return method; 50 } 51 52 /** 53 * Sets the method of the reminder. 54 * @param method The method of the reminder. 55 */ setMethod(byte method)56 public void setMethod(byte method) { 57 this.method = method; 58 } 59 60 /** 61 * Gets how many minutes before an event that the reminder should be 62 * triggered. 63 * @return How many minutes before an event that the reminder should be 64 * triggered. 65 */ getMinutes()66 public int getMinutes() { 67 return minutes; 68 } 69 70 /** 71 * Sets how many minutes before an event that the reminder should be 72 * triggered. 73 * @param minutes How many minutes before an event that the reminder should 74 * be triggered. 75 */ setMinutes(int minutes)76 public void setMinutes(int minutes) { 77 this.minutes = minutes; 78 } 79 toString(StringBuffer sb)80 public void toString(StringBuffer sb) { 81 sb.append("REMINDER MINUTES: " + minutes); 82 sb.append("\n"); 83 sb.append("REMINDER METHOD: " + method); 84 sb.append("\n"); 85 } 86 toString()87 public String toString() { 88 StringBuffer sb = new StringBuffer(); 89 toString(sb); 90 return sb.toString(); 91 } 92 } 93