Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package android.provider; |
| 18 | |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 19 | import android.content.Intent; |
Fred Quintana | 0f4e1ab | 2009-07-09 17:20:59 -0700 | [diff] [blame] | 20 | import android.content.ContentProviderClient; |
| 21 | import android.content.ContentProviderOperation; |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 22 | import android.content.res.Resources; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 23 | import android.graphics.BitmapFactory; |
| 24 | import android.net.Uri; |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 25 | import android.provider.ContactsContract.CommonDataKinds.GroupMembership; |
Fred Quintana | 0f4e1ab | 2009-07-09 17:20:59 -0700 | [diff] [blame] | 26 | import android.accounts.Account; |
| 27 | import android.os.RemoteException; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * The contract between the contacts provider and applications. Contains definitions |
| 31 | * for the supported URIs and columns. |
| 32 | * |
Dmitri Plotnikov | 5f123bd | 2009-05-28 18:06:31 -0700 | [diff] [blame] | 33 | * @hide |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 34 | */ |
| 35 | public final class ContactsContract { |
| 36 | /** The authority for the contacts provider */ |
| 37 | public static final String AUTHORITY = "com.android.contacts"; |
| 38 | /** A content:// style uri to the authority for the contacts provider */ |
| 39 | public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY); |
| 40 | |
Fred Quintana | 0f4e1ab | 2009-07-09 17:20:59 -0700 | [diff] [blame] | 41 | public interface SyncStateColumns extends SyncStateContract.Columns { |
| 42 | } |
| 43 | |
| 44 | public static final class SyncState { |
| 45 | /** |
| 46 | * This utility class cannot be instantiated |
| 47 | */ |
| 48 | private SyncState() {} |
| 49 | |
| 50 | public static final String CONTENT_DIRECTORY = |
| 51 | SyncStateContract.Constants.CONTENT_DIRECTORY; |
| 52 | |
| 53 | /** |
| 54 | * The content:// style URI for this table |
| 55 | */ |
| 56 | public static final Uri CONTENT_URI = |
| 57 | Uri.withAppendedPath(AUTHORITY_URI, CONTENT_DIRECTORY); |
| 58 | |
| 59 | /** |
| 60 | * @see android.provider.SyncStateContract.Helpers#get |
| 61 | */ |
| 62 | public static byte[] get(ContentProviderClient provider, Account account) |
| 63 | throws RemoteException { |
| 64 | return SyncStateContract.Helpers.get(provider, CONTENT_URI, account); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @see android.provider.SyncStateContract.Helpers#set |
| 69 | */ |
| 70 | public static void set(ContentProviderClient provider, Account account, byte[] data) |
| 71 | throws RemoteException { |
| 72 | SyncStateContract.Helpers.set(provider, CONTENT_URI, account, data); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @see android.provider.SyncStateContract.Helpers#newSetOperation |
| 77 | */ |
| 78 | public static ContentProviderOperation newSetOperation(Account account, byte[] data) { |
| 79 | return SyncStateContract.Helpers.newSetOperation(CONTENT_URI, account, data); |
| 80 | } |
| 81 | } |
| 82 | |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 83 | /** |
| 84 | * Generic columns for use by sync adapters. The specific functions of |
| 85 | * these columns are private to the sync adapter. Other clients of the API |
| 86 | * should not attempt to either read or write this column. |
| 87 | */ |
| 88 | private interface BaseSyncColumns { |
| 89 | |
| 90 | /** Generic column for use by sync adapters. */ |
| 91 | public static final String SYNC1 = "sync1"; |
| 92 | /** Generic column for use by sync adapters. */ |
| 93 | public static final String SYNC2 = "sync2"; |
| 94 | /** Generic column for use by sync adapters. */ |
| 95 | public static final String SYNC3 = "sync3"; |
| 96 | /** Generic column for use by sync adapters. */ |
| 97 | public static final String SYNC4 = "sync4"; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Columns that appear when each row of a table belongs to a specific |
| 102 | * account, including sync information that an account may need. |
| 103 | */ |
| 104 | private interface SyncColumns extends BaseSyncColumns { |
| 105 | /** |
| 106 | * The name of the account instance to which this row belongs. |
| 107 | * <P>Type: TEXT</P> |
| 108 | */ |
| 109 | public static final String ACCOUNT_NAME = "account_name"; |
| 110 | |
| 111 | /** |
| 112 | * The type of account to which this row belongs, which when paired with |
| 113 | * {@link #ACCOUNT_NAME} identifies a specific account. |
| 114 | * <P>Type: TEXT</P> |
| 115 | */ |
| 116 | public static final String ACCOUNT_TYPE = "account_type"; |
| 117 | |
| 118 | /** |
| 119 | * String that uniquely identifies this row to its source account. |
| 120 | * <P>Type: TEXT</P> |
| 121 | */ |
| 122 | public static final String SOURCE_ID = "sourceid"; |
| 123 | |
| 124 | /** |
| 125 | * Version number that is updated whenever this row or its related data |
| 126 | * changes. |
| 127 | * <P>Type: INTEGER</P> |
| 128 | */ |
| 129 | public static final String VERSION = "version"; |
| 130 | |
| 131 | /** |
| 132 | * Flag indicating that {@link #VERSION} has changed, and this row needs |
| 133 | * to be synchronized by its owning account. |
| 134 | * <P>Type: INTEGER (boolean)</P> |
| 135 | */ |
| 136 | public static final String DIRTY = "dirty"; |
| 137 | } |
| 138 | |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 139 | public interface ContactOptionsColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 140 | /** |
| 141 | * The number of times a person has been contacted |
| 142 | * <P>Type: INTEGER</P> |
| 143 | */ |
| 144 | public static final String TIMES_CONTACTED = "times_contacted"; |
| 145 | |
| 146 | /** |
| 147 | * The last time a person was contacted. |
| 148 | * <P>Type: INTEGER</P> |
| 149 | */ |
| 150 | public static final String LAST_TIME_CONTACTED = "last_time_contacted"; |
| 151 | |
| 152 | /** |
| 153 | * Is the contact starred? |
| 154 | * <P>Type: INTEGER (boolean)</P> |
| 155 | */ |
| 156 | public static final String STARRED = "starred"; |
| 157 | |
| 158 | /** |
Dmitri Plotnikov | 693d50e | 2009-06-22 14:57:31 -0700 | [diff] [blame] | 159 | * A custom ringtone associated with a person. Not always present. |
| 160 | * <P>Type: TEXT (URI to the ringtone)</P> |
| 161 | */ |
| 162 | public static final String CUSTOM_RINGTONE = "custom_ringtone"; |
| 163 | |
| 164 | /** |
| 165 | * Whether the person should always be sent to voicemail. Not always |
| 166 | * present. |
| 167 | * <P>Type: INTEGER (0 for false, 1 for true)</P> |
| 168 | */ |
| 169 | public static final String SEND_TO_VOICEMAIL = "send_to_voicemail"; |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 170 | } |
| 171 | |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 172 | private interface ContactsColumns { |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 173 | /** |
| 174 | * The display name for the contact. |
| 175 | * <P>Type: TEXT</P> |
| 176 | */ |
| 177 | public static final String DISPLAY_NAME = "display_name"; |
Dmitri Plotnikov | 693d50e | 2009-06-22 14:57:31 -0700 | [diff] [blame] | 178 | |
| 179 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 180 | * Reference to the row in the data table holding the primary phone number. |
| 181 | * <P>Type: INTEGER REFERENCES data(_id)</P> |
| 182 | */ |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 183 | @Deprecated |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 184 | public static final String PRIMARY_PHONE_ID = "primary_phone_id"; |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 185 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 186 | /** |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 187 | * Reference to the row in the data table holding the default phone number. |
| 188 | * If the contact has only one phone number, that number is the default one. |
| 189 | * Otherwise it is the one explicitly selected by the user as primary. |
| 190 | * <P>Type: INTEGER REFERENCES data(_id)</P> |
| 191 | */ |
| 192 | public static final String DEFAULT_PHONE_ID = "default_phone_id"; |
| 193 | |
| 194 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 195 | * Reference to the row in the data table holding the primary email address. |
| 196 | * <P>Type: INTEGER REFERENCES data(_id)</P> |
| 197 | */ |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 198 | @Deprecated |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 199 | public static final String PRIMARY_EMAIL_ID = "primary_email_id"; |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 200 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 201 | /** |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 202 | * Reference to the row in the data table holding the default email address. |
| 203 | * If the contact has only one email address, that address is the default one. |
| 204 | * Otherwise it is the one explicitly selected by the user as primary. |
| 205 | * <P>Type: INTEGER REFERENCES data(_id)</P> |
| 206 | */ |
| 207 | public static final String DEFAULT_EMAIL_ID = "default_email_id"; |
| 208 | |
| 209 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 210 | * Reference to the row in the data table holding the photo. |
| 211 | * <P>Type: INTEGER REFERENCES data(_id)</P> |
| 212 | */ |
| 213 | public static final String PHOTO_ID = "photo_id"; |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 214 | |
| 215 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 216 | * Lookup value that reflects the {@link Groups#GROUP_VISIBLE} state of |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 217 | * any {@link GroupMembership} for this contact. |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 218 | */ |
| 219 | public static final String IN_VISIBLE_GROUP = "in_visible_group"; |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 220 | |
| 221 | /** |
| 222 | * Contact presence status. See {@link android.provider.Im.CommonPresenceColumns} |
| 223 | * for individual status definitions. |
| 224 | */ |
| 225 | public static final String PRESENCE_STATUS = Presence.PRESENCE_STATUS; |
| 226 | |
| 227 | /** |
| 228 | * The type of data, for example Home or Work. |
| 229 | * <P>Type: INTEGER</P> |
| 230 | */ |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 231 | @Deprecated |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 232 | public static final String PRIMARY_PHONE_TYPE = CommonDataKinds.Phone.TYPE; |
| 233 | |
| 234 | /** |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 235 | * The type of data, for example Home or Work. |
| 236 | * <P>Type: INTEGER</P> |
| 237 | */ |
| 238 | public static final String DEFAULT_PHONE_TYPE = "default_phone_type"; |
| 239 | |
| 240 | /** |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 241 | * The user defined label for the primary phone. |
| 242 | * <P>Type: TEXT</P> |
| 243 | */ |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 244 | @Deprecated |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 245 | public static final String PRIMARY_PHONE_LABEL = CommonDataKinds.Phone.LABEL; |
| 246 | |
| 247 | /** |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 248 | * The user defined label for the default phone. |
| 249 | * <P>Type: TEXT</P> |
| 250 | */ |
| 251 | public static final String DEFAULT_PHONE_LABEL = "default_phone_label"; |
| 252 | |
| 253 | /** |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 254 | * The primary phone number. |
| 255 | * <P>Type: TEXT</P> |
| 256 | */ |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 257 | @Deprecated |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 258 | public static final String PRIMARY_PHONE_NUMBER = CommonDataKinds.Phone.NUMBER; |
Dmitri Plotnikov | 8dcd140 | 2009-08-06 18:01:10 -0700 | [diff] [blame] | 259 | |
| 260 | /** |
| 261 | * The default phone number. |
| 262 | * <P>Type: TEXT</P> |
| 263 | */ |
| 264 | public static final String DEFAULT_PHONE_NUMBER = "default_phone_number"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 268 | * Constants for the contacts table, which contains a record per group |
| 269 | * of raw contact representing the same person. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 270 | */ |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 271 | public static class Contacts implements BaseColumns, ContactsColumns, |
Dmitri Plotnikov | c9ec66b | 2009-08-05 12:11:22 -0700 | [diff] [blame] | 272 | ContactOptionsColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 273 | /** |
| 274 | * This utility class cannot be instantiated |
| 275 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 276 | private Contacts() {} |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 277 | |
| 278 | /** |
| 279 | * The content:// style URI for this table |
| 280 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 281 | public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "contacts"); |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 282 | |
| 283 | /** |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 284 | * The content:// style URI for this table joined with useful data from |
Dmitri Plotnikov | 02c5b45 | 2009-07-22 15:13:08 -0700 | [diff] [blame] | 285 | * {@link Data}. |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 286 | */ |
| 287 | public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI, |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 288 | "contacts_summary"); |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 289 | |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 290 | /** |
| 291 | * The content:// style URI used for "type-to-filter" functionality on the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 292 | * {@link #CONTENT_SUMMARY_URI} URI. The filter string will be used to match |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 293 | * various parts of the contact name. The filter argument should be passed |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 294 | * as an additional path segment after this URI. |
| 295 | */ |
| 296 | public static final Uri CONTENT_SUMMARY_FILTER_URI = Uri.withAppendedPath( |
| 297 | CONTENT_SUMMARY_URI, "filter"); |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 298 | |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 299 | /** |
| 300 | * The content:// style URI for this table joined with useful data from |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 301 | * {@link Data}, filtered to include only starred contacts |
| 302 | * and the most frequently contacted contacts. |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 303 | */ |
| 304 | public static final Uri CONTENT_SUMMARY_STREQUENT_URI = Uri.withAppendedPath( |
| 305 | CONTENT_SUMMARY_URI, "strequent"); |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 306 | |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 307 | /** |
| 308 | * The content:// style URI used for "type-to-filter" functionality on the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 309 | * {@link #CONTENT_SUMMARY_STREQUENT_URI} URI. The filter string will be used to match |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 310 | * various parts of the contact name. The filter argument should be passed |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 311 | * as an additional path segment after this URI. |
| 312 | */ |
| 313 | public static final Uri CONTENT_SUMMARY_STREQUENT_FILTER_URI = Uri.withAppendedPath( |
| 314 | CONTENT_SUMMARY_STREQUENT_URI, "filter"); |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 315 | |
Evan Millar | b926375 | 2009-07-15 11:32:19 -0700 | [diff] [blame] | 316 | public static final Uri CONTENT_SUMMARY_GROUP_URI = Uri.withAppendedPath( |
| 317 | CONTENT_SUMMARY_URI, "group"); |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 318 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 319 | * The MIME type of {@link #CONTENT_URI} providing a directory of |
| 320 | * people. |
| 321 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 322 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 323 | |
| 324 | /** |
| 325 | * The MIME type of a {@link #CONTENT_URI} subdirectory of a single |
| 326 | * person. |
| 327 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 328 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 329 | |
| 330 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 331 | * A sub-directory of a single contact that contains all of the constituent raw contact |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 332 | * {@link Data} rows. |
| 333 | */ |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 334 | public static final class Data implements BaseColumns, DataColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 335 | /** |
| 336 | * no public constructor since this is a utility class |
| 337 | */ |
| 338 | private Data() {} |
| 339 | |
| 340 | /** |
| 341 | * The directory twig for this sub-table |
| 342 | */ |
| 343 | public static final String CONTENT_DIRECTORY = "data"; |
| 344 | } |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 345 | |
| 346 | /** |
| 347 | * A sub-directory of a single contact aggregate that contains all aggregation suggestions |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 348 | * (other contacts). The aggregation suggestions are computed based on approximate |
| 349 | * data matches with this contact. |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 350 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 351 | public static final class AggregationSuggestions implements BaseColumns, ContactsColumns { |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 352 | /** |
| 353 | * No public constructor since this is a utility class |
| 354 | */ |
| 355 | private AggregationSuggestions() {} |
| 356 | |
| 357 | /** |
| 358 | * The directory twig for this sub-table |
| 359 | */ |
| 360 | public static final String CONTENT_DIRECTORY = "suggestions"; |
| 361 | |
| 362 | /** |
| 363 | * An optional query parameter that can be supplied to limit the number of returned |
| 364 | * suggestions. |
| 365 | * <p> |
| 366 | * Type: INTEGER |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 367 | * |
| 368 | * @deprecated Please use the "limit" parameter |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 369 | */ |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 370 | @Deprecated |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 371 | public static final String MAX_SUGGESTIONS = "max_suggestions"; |
| 372 | } |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 373 | } |
| 374 | |
Dmitri Plotnikov | 2365ded | 2009-07-27 09:36:09 -0700 | [diff] [blame] | 375 | private interface RawContactsColumns { |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 376 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 377 | * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} that this |
| 378 | * data belongs to. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 379 | * <P>Type: INTEGER</P> |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 380 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 381 | public static final String CONTACT_ID = "contact_id"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 382 | |
| 383 | /** |
Dmitri Plotnikov | 2365ded | 2009-07-27 09:36:09 -0700 | [diff] [blame] | 384 | * Flag indicating that this {@link RawContacts} entry and its children has |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 385 | * been restricted to specific platform apps. |
| 386 | * <P>Type: INTEGER (boolean)</P> |
| 387 | * |
| 388 | * @hide until finalized in future platform release |
| 389 | */ |
| 390 | public static final String IS_RESTRICTED = "is_restricted"; |
| 391 | |
| 392 | /** |
| 393 | * The aggregation mode for this contact. |
| 394 | * <P>Type: INTEGER</P> |
| 395 | */ |
| 396 | public static final String AGGREGATION_MODE = "aggregation_mode"; |
Dmitri Plotnikov | d5f56d1 | 2009-07-27 09:26:05 -0700 | [diff] [blame] | 397 | |
| 398 | /** |
| 399 | * The "deleted" flag: "0" by default, "1" if the row has been marked |
| 400 | * for deletion. When {@link android.content.ContentResolver#delete} is |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 401 | * called on a raw contact, it is marked for deletion and removed from its |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 402 | * aggregate contact. The sync adaptor deletes the raw contact on the server and |
Dmitri Plotnikov | d5f56d1 | 2009-07-27 09:26:05 -0700 | [diff] [blame] | 403 | * then calls ContactResolver.delete once more, this time passing the |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 404 | * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal. |
Dmitri Plotnikov | d5f56d1 | 2009-07-27 09:26:05 -0700 | [diff] [blame] | 405 | * <P>Type: INTEGER</P> |
| 406 | */ |
| 407 | public static final String DELETED = "deleted"; |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 408 | } |
| 409 | |
| 410 | /** |
Dmitri Plotnikov | 2365ded | 2009-07-27 09:36:09 -0700 | [diff] [blame] | 411 | * Constants for the raw_contacts table, which contains the base contact |
| 412 | * information per sync source. Sync adapters and contact management apps |
| 413 | * are the primary consumers of this API. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 414 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 415 | public static final class RawContacts implements BaseColumns, RawContactsColumns, |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 416 | ContactOptionsColumns, SyncColumns { |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 417 | /** |
| 418 | * This utility class cannot be instantiated |
| 419 | */ |
Dmitri Plotnikov | 2365ded | 2009-07-27 09:36:09 -0700 | [diff] [blame] | 420 | private RawContacts() { |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 424 | * The content:// style URI for this table |
| 425 | */ |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 426 | public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "raw_contacts"); |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 427 | |
| 428 | /** |
| 429 | * The content:// style URL for filtering people by email address. The |
| 430 | * filter argument should be passed as an additional path segment after |
| 431 | * this URI. |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 432 | * |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 433 | * @hide |
| 434 | */ |
Dmitri Plotnikov | d4e0b57 | 2009-08-06 20:19:29 -0700 | [diff] [blame] | 435 | @Deprecated |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 436 | public static final Uri CONTENT_FILTER_EMAIL_URI = |
| 437 | Uri.withAppendedPath(CONTENT_URI, "filter_email"); |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 438 | |
| 439 | /** |
| 440 | * The MIME type of {@link #CONTENT_URI} providing a directory of |
| 441 | * people. |
| 442 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 443 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 444 | |
| 445 | /** |
| 446 | * The MIME type of a {@link #CONTENT_URI} subdirectory of a single |
| 447 | * person. |
| 448 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 449 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 450 | |
| 451 | /** |
Dmitri Plotnikov | d5f56d1 | 2009-07-27 09:26:05 -0700 | [diff] [blame] | 452 | * Query parameter that can be passed with the {@link #CONTENT_URI} URI |
| 453 | * to the {@link android.content.ContentResolver#delete} method to |
| 454 | * indicate that the raw contact can be deleted physically, rather than |
| 455 | * merely marked as deleted. |
| 456 | */ |
| 457 | public static final String DELETE_PERMANENTLY = "delete_permanently"; |
| 458 | |
| 459 | /** |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 460 | * Aggregation mode: aggregate asynchronously. |
| 461 | */ |
| 462 | public static final int AGGREGATION_MODE_DEFAULT = 0; |
| 463 | |
| 464 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 465 | * Aggregation mode: aggregate at the time the raw contact is inserted/updated. |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 466 | */ |
| 467 | public static final int AGGREGATION_MODE_IMMEDITATE = 1; |
| 468 | |
| 469 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 470 | * Aggregation mode: never aggregate this raw contact (note that the raw contact will not |
Dmitri Plotnikov | c991bfc | 2009-07-14 17:27:31 -0700 | [diff] [blame] | 471 | * have a corresponding Aggregate and therefore will not be included in Aggregates |
| 472 | * query results.) |
| 473 | */ |
| 474 | public static final int AGGREGATION_MODE_DISABLED = 2; |
| 475 | |
| 476 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 477 | * A sub-directory of a single raw contact that contains all of their {@link Data} rows. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 478 | * To access this directory append |
| 479 | */ |
| 480 | public static final class Data implements BaseColumns, DataColumns { |
| 481 | /** |
| 482 | * no public constructor since this is a utility class |
| 483 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 484 | private Data() { |
| 485 | } |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 486 | |
| 487 | /** |
| 488 | * The directory twig for this sub-table |
| 489 | */ |
| 490 | public static final String CONTENT_DIRECTORY = "data"; |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | private interface DataColumns { |
| 495 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 496 | * The package name to use when creating {@link Resources} objects for |
| 497 | * this data row. This value is only designed for use when building user |
| 498 | * interfaces, and should not be used to infer the owner. |
| 499 | */ |
| 500 | public static final String RES_PACKAGE = "res_package"; |
| 501 | |
| 502 | /** |
| 503 | * The MIME type of the item represented by this row. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 504 | */ |
| 505 | public static final String MIMETYPE = "mimetype"; |
| 506 | |
| 507 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 508 | * A reference to the {@link RawContacts#_ID} |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 509 | * that this data belongs to. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 510 | */ |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 511 | public static final String RAW_CONTACT_ID = "raw_contact_id"; |
| 512 | |
Evan Millar | ab5742d | 2009-06-02 16:21:45 -0700 | [diff] [blame] | 513 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 514 | * Whether this is the primary entry of its kind for the raw contact it belongs to |
Evan Millar | ab5742d | 2009-06-02 16:21:45 -0700 | [diff] [blame] | 515 | * <P>Type: INTEGER (if set, non-0 means true)</P> |
| 516 | */ |
| 517 | public static final String IS_PRIMARY = "is_primary"; |
| 518 | |
| 519 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 520 | * Whether this is the primary entry of its kind for the aggregate |
| 521 | * contact it belongs to. Any data record that is "super primary" must |
| 522 | * also be "primary". |
Evan Millar | ab5742d | 2009-06-02 16:21:45 -0700 | [diff] [blame] | 523 | * <P>Type: INTEGER (if set, non-0 means true)</P> |
| 524 | */ |
| 525 | public static final String IS_SUPER_PRIMARY = "is_super_primary"; |
| 526 | |
Jeff Sharkey | 28b68e5 | 2009-06-10 15:26:58 -0700 | [diff] [blame] | 527 | /** |
Fred Quintana | c933fb6 | 2009-06-11 12:14:40 -0700 | [diff] [blame] | 528 | * The version of this data record. This is a read-only value. The data column is |
| 529 | * guaranteed to not change without the version going up. This value is monotonically |
| 530 | * increasing. |
| 531 | * <P>Type: INTEGER</P> |
| 532 | */ |
| 533 | public static final String DATA_VERSION = "data_version"; |
| 534 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 535 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 536 | public static final String DATA1 = "data1"; |
| 537 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 538 | public static final String DATA2 = "data2"; |
| 539 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 540 | public static final String DATA3 = "data3"; |
| 541 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 542 | public static final String DATA4 = "data4"; |
| 543 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 544 | public static final String DATA5 = "data5"; |
| 545 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 546 | public static final String DATA6 = "data6"; |
| 547 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 548 | public static final String DATA7 = "data7"; |
| 549 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 550 | public static final String DATA8 = "data8"; |
| 551 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 552 | public static final String DATA9 = "data9"; |
| 553 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 554 | public static final String DATA10 = "data10"; |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 555 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 556 | public static final String DATA11 = "data11"; |
| 557 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 558 | public static final String DATA12 = "data12"; |
| 559 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 560 | public static final String DATA13 = "data13"; |
| 561 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 562 | public static final String DATA14 = "data14"; |
| 563 | /** Generic data column, the meaning is {@link #MIMETYPE} specific */ |
| 564 | public static final String DATA15 = "data15"; |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 565 | |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 566 | /** Generic column for use by sync adapters. */ |
| 567 | public static final String SYNC1 = "data_sync1"; |
| 568 | /** Generic column for use by sync adapters. */ |
| 569 | public static final String SYNC2 = "data_sync2"; |
| 570 | /** Generic column for use by sync adapters. */ |
| 571 | public static final String SYNC3 = "data_sync3"; |
| 572 | /** Generic column for use by sync adapters. */ |
| 573 | public static final String SYNC4 = "data_sync4"; |
| 574 | |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 575 | /** |
Dmitri Plotnikov | 507f160 | 2009-08-10 17:37:36 -0700 | [diff] [blame^] | 576 | * An optional insert, update or delete URI parameter that determines if |
| 577 | * the corresponding raw contact should be marked as dirty. The default |
Dmitri Plotnikov | 91e4e85 | 2009-08-03 18:06:29 -0700 | [diff] [blame] | 578 | * value is true. |
| 579 | */ |
| 580 | public static final String MARK_AS_DIRTY = "mark_as_dirty"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 584 | * Constants for the data table, which contains data points tied to a raw contact. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 585 | * For example, a phone number or email address. Each row in this table contains a type |
| 586 | * definition and some generic columns. Each data type can define the meaning for each of |
| 587 | * the generic columns. |
| 588 | */ |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 589 | public static final class Data implements BaseColumns, DataColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 590 | /** |
| 591 | * This utility class cannot be instantiated |
| 592 | */ |
| 593 | private Data() {} |
| 594 | |
| 595 | /** |
| 596 | * The content:// style URI for this table |
| 597 | */ |
| 598 | public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "data"); |
| 599 | |
| 600 | /** |
| 601 | * The MIME type of {@link #CONTENT_URI} providing a directory of data. |
| 602 | */ |
| 603 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/data"; |
| 604 | } |
| 605 | |
| 606 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 607 | * A table that represents the result of looking up a phone number, for |
| 608 | * example for caller ID. The table joins that data row for the phone number |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 609 | * with the raw contact that owns the number. To perform a lookup you must |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 610 | * append the number you want to find to {@link #CONTENT_FILTER_URI}. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 611 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 612 | public static final class PhoneLookup implements BaseColumns, DataColumns, ContactsColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 613 | /** |
| 614 | * This utility class cannot be instantiated |
| 615 | */ |
| 616 | private PhoneLookup() {} |
| 617 | |
| 618 | /** |
| 619 | * The content:// style URI for this table. Append the phone number you want to lookup |
| 620 | * to this URI and query it to perform a lookup. For example: |
| 621 | * |
| 622 | * {@code |
| 623 | * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, phoneNumber); |
| 624 | * } |
| 625 | */ |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 626 | public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI, |
| 627 | "phone_lookup"); |
| 628 | } |
| 629 | |
| 630 | /** |
| 631 | * Additional data mixed in with {@link Im.CommonPresenceColumns} to link |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 632 | * back to specific {@link ContactsContract.Contacts#_ID} entries. |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 633 | */ |
| 634 | private interface PresenceColumns { |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 635 | |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 636 | /** |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 637 | * The unique ID for a row. |
| 638 | * <P>Type: INTEGER (long)</P> |
| 639 | */ |
| 640 | public static final String _ID = "presence_id"; |
| 641 | |
| 642 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 643 | * Reference to the {@link RawContacts#_ID} this presence references. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 644 | * <P>Type: INTEGER</P> |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 645 | */ |
Dmitri Plotnikov | d4e0b57 | 2009-08-06 20:19:29 -0700 | [diff] [blame] | 646 | public static final String RAW_CONTACT_ID = "presence_raw_contact_id"; |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 647 | |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 648 | /** |
| 649 | * Reference to the {@link Data#_ID} entry that owns this presence. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 650 | * <P>Type: INTEGER</P> |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 651 | */ |
Dmitri Plotnikov | d4e0b57 | 2009-08-06 20:19:29 -0700 | [diff] [blame] | 652 | public static final String DATA_ID = "presence_data_id"; |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 653 | |
| 654 | /** |
| 655 | * The IM service the presence is coming from. Formatted using either |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 656 | * {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)} or |
| 657 | * {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}. |
| 658 | * <P>Type: TEXT</P> |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 659 | */ |
| 660 | public static final String IM_PROTOCOL = "im_protocol"; |
| 661 | |
| 662 | /** |
| 663 | * The IM handle the presence item is for. The handle is scoped to the |
| 664 | * {@link #IM_PROTOCOL}. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 665 | * <P>Type: TEXT</P> |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 666 | */ |
| 667 | public static final String IM_HANDLE = "im_handle"; |
| 668 | |
| 669 | /** |
| 670 | * The IM account for the local user that the presence data came from. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 671 | * <P>Type: TEXT</P> |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 672 | */ |
| 673 | public static final String IM_ACCOUNT = "im_account"; |
| 674 | } |
| 675 | |
Dmitri Plotnikov | 55048a9 | 2009-07-24 10:25:34 -0700 | [diff] [blame] | 676 | public static final class Presence implements PresenceColumns, Im.CommonPresenceColumns { |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 677 | /** |
| 678 | * This utility class cannot be instantiated |
| 679 | */ |
| 680 | private Presence() { |
| 681 | } |
| 682 | |
| 683 | /** |
| 684 | * The content:// style URI for this table |
| 685 | */ |
| 686 | public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "presence"); |
| 687 | |
| 688 | /** |
| 689 | * Gets the resource ID for the proper presence icon. |
| 690 | * |
| 691 | * @param status the status to get the icon for |
| 692 | * @return the resource ID for the proper presence icon |
| 693 | */ |
| 694 | public static final int getPresenceIconResourceId(int status) { |
| 695 | switch (status) { |
| 696 | case AVAILABLE: |
| 697 | return android.R.drawable.presence_online; |
| 698 | case IDLE: |
| 699 | case AWAY: |
| 700 | return android.R.drawable.presence_away; |
| 701 | case DO_NOT_DISTURB: |
| 702 | return android.R.drawable.presence_busy; |
| 703 | case INVISIBLE: |
| 704 | return android.R.drawable.presence_invisible; |
| 705 | case OFFLINE: |
| 706 | default: |
| 707 | return android.R.drawable.presence_offline; |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | /** |
Evan Millar | c043752 | 2009-06-23 17:31:05 -0700 | [diff] [blame] | 712 | * Returns the precedence of the status code the higher number being the higher precedence. |
| 713 | * |
| 714 | * @param status The status code. |
| 715 | * @return An integer representing the precedence, 0 being the lowest. |
| 716 | */ |
| 717 | public static final int getPresencePrecedence(int status) { |
| 718 | // Keep this function here incase we want to enforce a different precedence than the |
| 719 | // natural order of the status constants. |
| 720 | return status; |
| 721 | } |
| 722 | |
| 723 | /** |
Jeff Sharkey | d530b3c | 2009-06-01 20:23:57 -0700 | [diff] [blame] | 724 | * The MIME type of {@link #CONTENT_URI} providing a directory of |
| 725 | * presence details. |
| 726 | */ |
| 727 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/im-presence"; |
| 728 | |
| 729 | /** |
| 730 | * The MIME type of a {@link #CONTENT_URI} subdirectory of a single |
| 731 | * presence detail. |
| 732 | */ |
| 733 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im-presence"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 734 | } |
| 735 | |
| 736 | /** |
| 737 | * Container for definitions of common data types stored in the {@link Data} table. |
| 738 | */ |
| 739 | public static final class CommonDataKinds { |
| 740 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 741 | * The {@link Data#RES_PACKAGE} value for common data that should be |
| 742 | * shown using a default style. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 743 | */ |
| 744 | public static final String PACKAGE_COMMON = "common"; |
| 745 | |
| 746 | /** |
| 747 | * Columns common across the specific types. |
| 748 | */ |
| 749 | private interface BaseCommonColumns { |
| 750 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 751 | * The package name to use when creating {@link Resources} objects for |
| 752 | * this data row. This value is only designed for use when building user |
| 753 | * interfaces, and should not be used to infer the owner. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 754 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 755 | public static final String RES_PACKAGE = "res_package"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 756 | |
| 757 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 758 | * The MIME type of the item represented by this row. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 759 | */ |
| 760 | public static final String MIMETYPE = "mimetype"; |
| 761 | |
| 762 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 763 | * The {@link RawContacts#_ID} that this data belongs to. |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 764 | */ |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 765 | public static final String RAW_CONTACT_ID = "raw_contact_id"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 766 | } |
| 767 | |
| 768 | /** |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 769 | * The base types that all "Typed" data kinds support. |
| 770 | */ |
| 771 | public interface BaseTypes { |
| 772 | |
| 773 | /** |
| 774 | * A custom type. The custom label should be supplied by user. |
| 775 | */ |
| 776 | public static int TYPE_CUSTOM = 0; |
| 777 | } |
| 778 | |
| 779 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 780 | * Columns common across the specific types. |
| 781 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 782 | private interface CommonColumns extends BaseTypes{ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 783 | /** |
| 784 | * The type of data, for example Home or Work. |
| 785 | * <P>Type: INTEGER</P> |
| 786 | */ |
| 787 | public static final String TYPE = "data1"; |
| 788 | |
| 789 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 790 | * The data for the contact method. |
| 791 | * <P>Type: TEXT</P> |
| 792 | */ |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 793 | public static final String DATA = "data2"; |
| 794 | |
| 795 | /** |
| 796 | * The user defined label for the the contact method. |
| 797 | * <P>Type: TEXT</P> |
| 798 | */ |
| 799 | public static final String LABEL = "data3"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | /** |
| 803 | * Parts of the name. |
| 804 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 805 | public static final class StructuredName implements BaseCommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 806 | private StructuredName() {} |
| 807 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 808 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 809 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name"; |
| 810 | |
| 811 | /** |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 812 | * The given name for the contact. |
| 813 | * <P>Type: TEXT</P> |
| 814 | */ |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 815 | public static final String GIVEN_NAME = "data1"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 816 | |
| 817 | /** |
| 818 | * The family name for the contact. |
| 819 | * <P>Type: TEXT</P> |
| 820 | */ |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 821 | public static final String FAMILY_NAME = "data2"; |
| 822 | |
| 823 | /** |
| 824 | * The contact's honorific prefix, e.g. "Sir" |
| 825 | * <P>Type: TEXT</P> |
| 826 | */ |
| 827 | public static final String PREFIX = "data3"; |
| 828 | |
| 829 | /** |
| 830 | * The contact's middle name |
| 831 | * <P>Type: TEXT</P> |
| 832 | */ |
| 833 | public static final String MIDDLE_NAME = "data4"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 834 | |
| 835 | /** |
| 836 | * The contact's honorific suffix, e.g. "Jr" |
| 837 | */ |
| 838 | public static final String SUFFIX = "data5"; |
| 839 | |
| 840 | /** |
| 841 | * The phonetic version of the given name for the contact. |
| 842 | * <P>Type: TEXT</P> |
| 843 | */ |
| 844 | public static final String PHONETIC_GIVEN_NAME = "data6"; |
| 845 | |
| 846 | /** |
| 847 | * The phonetic version of the additional name for the contact. |
| 848 | * <P>Type: TEXT</P> |
| 849 | */ |
| 850 | public static final String PHONETIC_MIDDLE_NAME = "data7"; |
| 851 | |
| 852 | /** |
| 853 | * The phonetic version of the family name for the contact. |
| 854 | * <P>Type: TEXT</P> |
| 855 | */ |
| 856 | public static final String PHONETIC_FAMILY_NAME = "data8"; |
| 857 | |
| 858 | /** |
| 859 | * The name that should be used to display the contact. |
| 860 | * <P>Type: TEXT</P> |
| 861 | */ |
| 862 | public static final String DISPLAY_NAME = "data9"; |
| 863 | } |
| 864 | |
| 865 | /** |
| 866 | * A nickname. |
| 867 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 868 | public static final class Nickname implements CommonColumns, BaseCommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 869 | private Nickname() {} |
| 870 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 871 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 872 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname"; |
| 873 | |
Evan Millar | 78e79ad | 2009-06-08 10:24:44 -0700 | [diff] [blame] | 874 | public static final int TYPE_DEFAULT = 1; |
| 875 | public static final int TYPE_OTHER_NAME = 2; |
| 876 | public static final int TYPE_MAINDEN_NAME = 3; |
| 877 | public static final int TYPE_SHORT_NAME = 4; |
| 878 | public static final int TYPE_INITIALS = 5; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 879 | |
| 880 | /** |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 881 | * The name itself |
| 882 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 883 | public static final String NAME = DATA; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 884 | } |
| 885 | |
| 886 | /** |
| 887 | * Common data definition for telephone numbers. |
| 888 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 889 | public static final class Phone implements BaseCommonColumns, CommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 890 | private Phone() {} |
| 891 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 892 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 893 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone"; |
| 894 | |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 895 | /** |
| 896 | * The MIME type of {@link #CONTENT_URI} providing a directory of |
| 897 | * phones. |
| 898 | */ |
| 899 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone"; |
| 900 | |
| 901 | /** |
| 902 | * The content:// style URI for all data records of the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 903 | * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 904 | * associated raw contact and aggregate contact data. |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 905 | */ |
| 906 | public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, |
| 907 | "phones"); |
| 908 | |
| 909 | /** |
| 910 | * The content:// style URI for filtering data records of the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 911 | * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 912 | * associated raw contact and aggregate contact data. The filter argument should |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 913 | * be passed as an additional path segment after this URI. |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 914 | */ |
| 915 | public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI, |
| 916 | "filter"); |
| 917 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 918 | public static final int TYPE_HOME = 1; |
| 919 | public static final int TYPE_MOBILE = 2; |
| 920 | public static final int TYPE_WORK = 3; |
| 921 | public static final int TYPE_FAX_WORK = 4; |
| 922 | public static final int TYPE_FAX_HOME = 5; |
| 923 | public static final int TYPE_PAGER = 6; |
| 924 | public static final int TYPE_OTHER = 7; |
Fred Quintana | 3f86715 | 2009-08-03 11:43:16 -0700 | [diff] [blame] | 925 | public static final int TYPE_CALLBACK = 8; |
| 926 | public static final int TYPE_CAR = 9; |
| 927 | public static final int TYPE_COMPANY_MAIN = 10; |
| 928 | public static final int TYPE_ISDN = 11; |
| 929 | public static final int TYPE_MAIN = 12; |
| 930 | public static final int TYPE_OTHER_FAX = 13; |
| 931 | public static final int TYPE_RADIO = 14; |
| 932 | public static final int TYPE_TELEX = 15; |
| 933 | public static final int TYPE_TTY_TDD = 16; |
| 934 | public static final int TYPE_WORK_MOBILE = 17; |
| 935 | public static final int TYPE_WORK_PAGER = 18; |
| 936 | public static final int TYPE_ASSISTANT = 19; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 937 | |
| 938 | /** |
| 939 | * The phone number as the user entered it. |
| 940 | * <P>Type: TEXT</P> |
| 941 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 942 | public static final String NUMBER = DATA; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 943 | } |
| 944 | |
| 945 | /** |
| 946 | * Common data definition for email addresses. |
| 947 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 948 | public static final class Email implements BaseCommonColumns, CommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 949 | private Email() {} |
| 950 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 951 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 952 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email"; |
| 953 | |
Dmitri Plotnikov | d4e0b57 | 2009-08-06 20:19:29 -0700 | [diff] [blame] | 954 | /** |
| 955 | * The content:// style URI for all data records of the |
| 956 | * {@link Email#CONTENT_ITEM_TYPE} MIME type, combined with the |
| 957 | * associated raw contact and aggregate contact data. |
| 958 | */ |
| 959 | public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, |
| 960 | "emails"); |
| 961 | |
| 962 | /** |
| 963 | * The content:// style URL for filtering data rows by email address. The |
| 964 | * filter argument should be passed as an additional path segment after |
| 965 | * this URI. |
| 966 | */ |
| 967 | public static final Uri CONTENT_FILTER_EMAIL_URI = Uri.withAppendedPath(CONTENT_URI, |
| 968 | "filter"); |
| 969 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 970 | public static final int TYPE_HOME = 1; |
| 971 | public static final int TYPE_WORK = 2; |
| 972 | public static final int TYPE_OTHER = 3; |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 973 | |
| 974 | /** |
| 975 | * The display name for the email address |
| 976 | * <P>Type: TEXT</P> |
| 977 | */ |
| 978 | public static final String DISPLAY_NAME = "data4"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 979 | } |
| 980 | |
| 981 | /** |
| 982 | * Common data definition for postal addresses. |
| 983 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 984 | public static final class StructuredPostal implements BaseCommonColumns, CommonColumns { |
| 985 | private StructuredPostal() { |
| 986 | } |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 987 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 988 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 989 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address"; |
| 990 | |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 991 | /** |
| 992 | * The MIME type of {@link #CONTENT_URI} providing a directory of |
| 993 | * postal addresses. |
| 994 | */ |
| 995 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address"; |
| 996 | |
| 997 | /** |
| 998 | * The content:// style URI for all data records of the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 999 | * {@link StructuredPostal#CONTENT_ITEM_TYPE} MIME type. |
Evan Millar | 161dd86 | 2009-06-12 16:02:43 -0700 | [diff] [blame] | 1000 | */ |
| 1001 | public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, |
| 1002 | "postals"); |
| 1003 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1004 | public static final int TYPE_HOME = 1; |
| 1005 | public static final int TYPE_WORK = 2; |
| 1006 | public static final int TYPE_OTHER = 3; |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1007 | |
| 1008 | /** |
| 1009 | * The full, unstructured postal address. |
| 1010 | * <p> |
| 1011 | * Type: TEXT |
| 1012 | */ |
| 1013 | public static final String FORMATTED_ADDRESS = DATA; |
| 1014 | |
| 1015 | /** |
| 1016 | * The agent who actually receives the mail. Used in work addresses. |
| 1017 | * Also for 'in care of' or 'c/o'. |
| 1018 | * <p> |
| 1019 | * Type: TEXT |
| 1020 | */ |
| 1021 | public static final String AGENT = "data4"; |
| 1022 | |
| 1023 | /** |
| 1024 | * Used in places where houses or buildings have names (and not |
| 1025 | * necessarily numbers), eg. "The Pillars". |
| 1026 | * <p> |
| 1027 | * Type: TEXT |
| 1028 | */ |
| 1029 | public static final String HOUSENAME = "data5"; |
| 1030 | |
| 1031 | /** |
| 1032 | * Can be street, avenue, road, etc. This element also includes the |
| 1033 | * house number and room/apartment/flat/floor number. |
| 1034 | * <p> |
| 1035 | * Type: TEXT |
| 1036 | */ |
| 1037 | public static final String STREET = "data6"; |
| 1038 | |
| 1039 | /** |
| 1040 | * Covers actual P.O. boxes, drawers, locked bags, etc. This is |
| 1041 | * usually but not always mutually exclusive with street. |
| 1042 | * <p> |
| 1043 | * Type: TEXT |
| 1044 | */ |
| 1045 | public static final String POBOX = "data7"; |
| 1046 | |
| 1047 | /** |
| 1048 | * This is used to disambiguate a street address when a city |
| 1049 | * contains more than one street with the same name, or to specify a |
| 1050 | * small place whose mail is routed through a larger postal town. In |
| 1051 | * China it could be a county or a minor city. |
| 1052 | * <p> |
| 1053 | * Type: TEXT |
| 1054 | */ |
Jeff Sharkey | ef348c7 | 2009-07-26 14:14:34 -0700 | [diff] [blame] | 1055 | public static final String NEIGHBORHOOD = "data8"; |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1056 | |
| 1057 | /** |
| 1058 | * Can be city, village, town, borough, etc. This is the postal town |
| 1059 | * and not necessarily the place of residence or place of business. |
| 1060 | * <p> |
| 1061 | * Type: TEXT |
| 1062 | */ |
| 1063 | public static final String CITY = "data9"; |
| 1064 | |
| 1065 | /** |
| 1066 | * Handles administrative districts such as U.S. or U.K. counties |
| 1067 | * that are not used for mail addressing purposes. Subregion is not |
| 1068 | * intended for delivery addresses. |
| 1069 | * <p> |
| 1070 | * Type: TEXT |
| 1071 | */ |
| 1072 | public static final String SUBREGION = "data10"; |
| 1073 | |
| 1074 | /** |
| 1075 | * A state, province, county (in Ireland), Land (in Germany), |
| 1076 | * departement (in France), etc. |
| 1077 | * <p> |
| 1078 | * Type: TEXT |
| 1079 | */ |
| 1080 | public static final String REGION = "data11"; |
| 1081 | |
| 1082 | /** |
Jeff Sharkey | ef348c7 | 2009-07-26 14:14:34 -0700 | [diff] [blame] | 1083 | * Postal code. Usually country-wide, but sometimes specific to the |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1084 | * city (e.g. "2" in "Dublin 2, Ireland" addresses). |
| 1085 | * <p> |
| 1086 | * Type: TEXT |
| 1087 | */ |
| 1088 | public static final String POSTCODE = "data12"; |
| 1089 | |
| 1090 | /** |
| 1091 | * The name or code of the country. |
| 1092 | * <p> |
| 1093 | * Type: TEXT |
| 1094 | */ |
| 1095 | public static final String COUNTRY = "data13"; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1096 | } |
| 1097 | |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1098 | /** |
| 1099 | * Common data definition for IM addresses. |
| 1100 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 1101 | public static final class Im implements BaseCommonColumns, CommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1102 | private Im() {} |
| 1103 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1104 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1105 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im"; |
| 1106 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1107 | public static final int TYPE_HOME = 1; |
| 1108 | public static final int TYPE_WORK = 2; |
| 1109 | public static final int TYPE_OTHER = 3; |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 1110 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1111 | public static final String PROTOCOL = "data5"; |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 1112 | |
Jeff Sharkey | 732da92 | 2009-07-30 09:59:31 -0700 | [diff] [blame] | 1113 | public static final String CUSTOM_PROTOCOL = "data6"; |
| 1114 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1115 | /** |
| 1116 | * The predefined IM protocol types. The protocol can either be non-present, one |
| 1117 | * of these types, or a free-form string. These cases are encoded in the PROTOCOL |
| 1118 | * column as: |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 1119 | * <ul> |
| 1120 | * <li>null</li> |
| 1121 | * <li>pre:<an integer, one of the protocols below></li> |
| 1122 | * <li>custom:<a string></li> |
| 1123 | * </ul> |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1124 | */ |
Jeff Sharkey | 732da92 | 2009-07-30 09:59:31 -0700 | [diff] [blame] | 1125 | public static final int PROTOCOL_CUSTOM = -1; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1126 | public static final int PROTOCOL_AIM = 0; |
| 1127 | public static final int PROTOCOL_MSN = 1; |
| 1128 | public static final int PROTOCOL_YAHOO = 2; |
| 1129 | public static final int PROTOCOL_SKYPE = 3; |
| 1130 | public static final int PROTOCOL_QQ = 4; |
| 1131 | public static final int PROTOCOL_GOOGLE_TALK = 5; |
| 1132 | public static final int PROTOCOL_ICQ = 6; |
| 1133 | public static final int PROTOCOL_JABBER = 7; |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1134 | public static final int PROTOCOL_NETMEETING = 8; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1135 | } |
| 1136 | |
| 1137 | /** |
| 1138 | * Common data definition for organizations. |
| 1139 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 1140 | public static final class Organization implements BaseCommonColumns, CommonColumns { |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1141 | private Organization() {} |
| 1142 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1143 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1144 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization"; |
| 1145 | |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 1146 | public static final int TYPE_WORK = 1; |
| 1147 | public static final int TYPE_OTHER = 2; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1148 | |
| 1149 | /** |
| 1150 | * The company as the user entered it. |
| 1151 | * <P>Type: TEXT</P> |
| 1152 | */ |
Dmitri Plotnikov | 761ef2a | 2009-07-17 10:51:06 -0700 | [diff] [blame] | 1153 | public static final String COMPANY = DATA; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1154 | |
| 1155 | /** |
| 1156 | * The position title at this company as the user entered it. |
| 1157 | * <P>Type: TEXT</P> |
| 1158 | */ |
| 1159 | public static final String TITLE = "data4"; |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1160 | |
| 1161 | /** |
| 1162 | * The department at this company as the user entered it. |
| 1163 | * <P>Type: TEXT</P> |
| 1164 | */ |
| 1165 | public static final String DEPARTMENT = "data5"; |
| 1166 | |
| 1167 | /** |
| 1168 | * The job description at this company as the user entered it. |
| 1169 | * <P>Type: TEXT</P> |
| 1170 | */ |
| 1171 | public static final String JOB_DESCRIPTION = "data6"; |
| 1172 | |
| 1173 | /** |
| 1174 | * The symbol of this company as the user entered it. |
| 1175 | * <P>Type: TEXT</P> |
| 1176 | */ |
| 1177 | public static final String SYMBOL = "data7"; |
| 1178 | |
| 1179 | /** |
| 1180 | * The phonetic name of this company as the user entered it. |
| 1181 | * <P>Type: TEXT</P> |
| 1182 | */ |
| 1183 | public static final String PHONETIC_NAME = "data8"; |
| 1184 | } |
| 1185 | |
| 1186 | /** |
| 1187 | * Common data definition for miscellaneous information. |
| 1188 | */ |
| 1189 | public static final class Miscellaneous implements BaseCommonColumns { |
| 1190 | private Miscellaneous() {} |
| 1191 | |
| 1192 | /** MIME type used when storing this in data table. */ |
| 1193 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/misc"; |
| 1194 | |
| 1195 | /** |
| 1196 | * The birthday as the user entered it. |
| 1197 | * <P>Type: TEXT</P> |
| 1198 | */ |
| 1199 | public static final String BIRTHDAY = "data1"; |
| 1200 | |
| 1201 | /** |
| 1202 | * The nickname as the user entered it. |
| 1203 | * <P>Type: TEXT</P> |
| 1204 | */ |
| 1205 | public static final String NICKNAME = "data2"; |
| 1206 | } |
| 1207 | |
| 1208 | /** |
| 1209 | * Common data definition for relations. |
| 1210 | */ |
| 1211 | public static final class Relation implements BaseCommonColumns, CommonColumns { |
| 1212 | private Relation() {} |
| 1213 | |
| 1214 | /** MIME type used when storing this in data table. */ |
| 1215 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/relation"; |
| 1216 | |
| 1217 | public static final int TYPE_ASSISTANT = 1; |
| 1218 | public static final int TYPE_BROTHER = 2; |
| 1219 | public static final int TYPE_CHILD = 3; |
| 1220 | public static final int TYPE_DOMESTIC_PARTNER = 4; |
| 1221 | public static final int TYPE_FATHER = 5; |
| 1222 | public static final int TYPE_FRIEND = 6; |
| 1223 | public static final int TYPE_MANAGER = 7; |
| 1224 | public static final int TYPE_MOTHER = 8; |
| 1225 | public static final int TYPE_PARENT = 9; |
| 1226 | public static final int TYPE_PARTNER = 10; |
| 1227 | public static final int TYPE_REFERRED_BY = 11; |
| 1228 | public static final int TYPE_RELATIVE = 12; |
| 1229 | public static final int TYPE_SISTER = 13; |
| 1230 | public static final int TYPE_SPOUSE = 14; |
| 1231 | |
| 1232 | /** |
| 1233 | * The name of the relative as the user entered it. |
| 1234 | * <P>Type: TEXT</P> |
| 1235 | */ |
| 1236 | public static final String NAME = DATA; |
| 1237 | } |
| 1238 | |
| 1239 | /** |
| 1240 | * Common data definition for events. |
| 1241 | */ |
| 1242 | public static final class Event implements BaseCommonColumns, CommonColumns { |
| 1243 | private Event() {} |
| 1244 | |
| 1245 | /** MIME type used when storing this in data table. */ |
| 1246 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/event"; |
| 1247 | |
| 1248 | public static final int TYPE_ANNIVERSARY = 1; |
| 1249 | public static final int TYPE_OTHER = 2; |
Dmitri Plotnikov | d4e0b57 | 2009-08-06 20:19:29 -0700 | [diff] [blame] | 1250 | |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1251 | /** |
| 1252 | * The event start date as the user entered it. |
| 1253 | * <P>Type: TEXT</P> |
| 1254 | */ |
| 1255 | public static final String START_DATE = DATA; |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1256 | } |
| 1257 | |
| 1258 | /** |
| 1259 | * Photo of the contact. |
| 1260 | */ |
| 1261 | public static final class Photo implements BaseCommonColumns { |
| 1262 | private Photo() {} |
| 1263 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1264 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1265 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo"; |
| 1266 | |
| 1267 | /** |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 1268 | * Thumbnail photo of the raw contact. This is the raw bytes of an image |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1269 | * that could be inflated using {@link BitmapFactory}. |
| 1270 | * <p> |
| 1271 | * Type: BLOB |
| 1272 | */ |
| 1273 | public static final String PHOTO = "data1"; |
| 1274 | } |
| 1275 | |
| 1276 | /** |
| 1277 | * Notes about the contact. |
| 1278 | */ |
| 1279 | public static final class Note implements BaseCommonColumns { |
| 1280 | private Note() {} |
| 1281 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1282 | /** MIME type used when storing this in data table. */ |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1283 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note"; |
| 1284 | |
| 1285 | /** |
| 1286 | * The note text. |
| 1287 | * <P>Type: TEXT</P> |
| 1288 | */ |
| 1289 | public static final String NOTE = "data1"; |
| 1290 | } |
Dmitri Plotnikov | 5692777 | 2009-05-28 17:23:39 -0700 | [diff] [blame] | 1291 | |
Dmitri Plotnikov | c926054 | 2009-05-28 17:55:12 -0700 | [diff] [blame] | 1292 | /** |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1293 | * Group Membership. |
Dmitri Plotnikov | ceaafa5 | 2009-06-03 10:46:44 -0700 | [diff] [blame] | 1294 | */ |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1295 | public static final class GroupMembership implements BaseCommonColumns { |
| 1296 | private GroupMembership() {} |
Dmitri Plotnikov | ceaafa5 | 2009-06-03 10:46:44 -0700 | [diff] [blame] | 1297 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1298 | /** MIME type used when storing this in data table. */ |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1299 | public static final String CONTENT_ITEM_TYPE = |
| 1300 | "vnd.android.cursor.item/group_membership"; |
Dmitri Plotnikov | ceaafa5 | 2009-06-03 10:46:44 -0700 | [diff] [blame] | 1301 | |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1302 | /** |
Fred Quintana | ffc34c1 | 2009-07-14 16:02:58 -0700 | [diff] [blame] | 1303 | * The row id of the group that this group membership refers to. Exactly one of |
| 1304 | * this or {@link #GROUP_SOURCE_ID} must be set when inserting a row. |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1305 | * <P>Type: INTEGER</P> |
| 1306 | */ |
| 1307 | public static final String GROUP_ROW_ID = "data1"; |
Dmitri Plotnikov | ceaafa5 | 2009-06-03 10:46:44 -0700 | [diff] [blame] | 1308 | |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1309 | /** |
Fred Quintana | ffc34c1 | 2009-07-14 16:02:58 -0700 | [diff] [blame] | 1310 | * The sourceid of the group that this group membership refers to. Exactly one of |
| 1311 | * this or {@link #GROUP_ROW_ID} must be set when inserting a row. |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1312 | * <P>Type: TEXT</P> |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1313 | */ |
Fred Quintana | ffc34c1 | 2009-07-14 16:02:58 -0700 | [diff] [blame] | 1314 | public static final String GROUP_SOURCE_ID = "group_sourceid"; |
Fred Quintana | d8dfeb5 | 2009-06-04 10:28:49 -0700 | [diff] [blame] | 1315 | } |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1316 | |
| 1317 | /** |
| 1318 | * Website related to the contact. |
| 1319 | */ |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1320 | public static final class Website implements BaseCommonColumns, CommonColumns { |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1321 | private Website() {} |
| 1322 | |
| 1323 | /** MIME type used when storing this in data table. */ |
| 1324 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website"; |
| 1325 | |
Fred Quintana | 8851e16 | 2009-08-05 21:06:45 -0700 | [diff] [blame] | 1326 | public static final int TYPE_HOMEPAGE = 1; |
| 1327 | public static final int TYPE_BLOG = 2; |
| 1328 | public static final int TYPE_PROFILE = 3; |
| 1329 | public static final int TYPE_HOME = 4; |
| 1330 | public static final int TYPE_WORK = 5; |
| 1331 | public static final int TYPE_FTP = 6; |
| 1332 | public static final int TYPE_OTHER = 7; |
| 1333 | |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1334 | /** |
| 1335 | * The website URL string. |
| 1336 | * <P>Type: TEXT</P> |
| 1337 | */ |
| 1338 | public static final String URL = "data1"; |
| 1339 | } |
Dmitri Plotnikov | ceaafa5 | 2009-06-03 10:46:44 -0700 | [diff] [blame] | 1340 | } |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1341 | |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1342 | public interface GroupsColumns { |
| 1343 | /** |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1344 | * The display title of this group. |
| 1345 | * <p> |
| 1346 | * Type: TEXT |
| 1347 | */ |
| 1348 | public static final String TITLE = "title"; |
| 1349 | |
| 1350 | /** |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1351 | * The package name to use when creating {@link Resources} objects for |
| 1352 | * this group. This value is only designed for use when building user |
| 1353 | * interfaces, and should not be used to infer the owner. |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1354 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1355 | public static final String RES_PACKAGE = "res_package"; |
| 1356 | |
| 1357 | /** |
| 1358 | * The display title of this group to load as a resource from |
| 1359 | * {@link #RES_PACKAGE}, which may be localized. |
| 1360 | * <P>Type: TEXT</P> |
| 1361 | */ |
| 1362 | public static final String TITLE_RES = "title_res"; |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1363 | |
| 1364 | /** |
Dmitri Plotnikov | 02c5b45 | 2009-07-22 15:13:08 -0700 | [diff] [blame] | 1365 | * Notes about the group. |
| 1366 | * <p> |
| 1367 | * Type: TEXT |
| 1368 | */ |
| 1369 | public static final String NOTES = "notes"; |
| 1370 | |
| 1371 | /** |
| 1372 | * The ID of this group if it is a System Group, i.e. a group that has a special meaning |
| 1373 | * to the sync adapter, null otherwise. |
| 1374 | * <P>Type: TEXT</P> |
| 1375 | */ |
| 1376 | public static final String SYSTEM_ID = "system_id"; |
| 1377 | |
| 1378 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1379 | * The total number of {@link Contacts} that have |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1380 | * {@link GroupMembership} in this group. Read-only value that is only |
| 1381 | * present when querying {@link Groups#CONTENT_SUMMARY_URI}. |
| 1382 | * <p> |
| 1383 | * Type: INTEGER |
| 1384 | */ |
| 1385 | public static final String SUMMARY_COUNT = "summ_count"; |
| 1386 | |
| 1387 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1388 | * The total number of {@link Contacts} that have both |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1389 | * {@link GroupMembership} in this group, and also have phone numbers. |
| 1390 | * Read-only value that is only present when querying |
| 1391 | * {@link Groups#CONTENT_SUMMARY_URI}. |
| 1392 | * <p> |
| 1393 | * Type: INTEGER |
| 1394 | */ |
| 1395 | public static final String SUMMARY_WITH_PHONES = "summ_phones"; |
| 1396 | |
| 1397 | /** |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1398 | * Flag indicating if the contacts belonging to this group should be |
| 1399 | * visible in any user interface. |
| 1400 | * <p> |
| 1401 | * Type: INTEGER |
| 1402 | */ |
| 1403 | public static final String GROUP_VISIBLE = "group_visible"; |
Fred Quintana | 00c89f6 | 2009-08-10 14:43:24 -0700 | [diff] [blame] | 1404 | |
| 1405 | /** |
| 1406 | * The "deleted" flag: "0" by default, "1" if the row has been marked |
| 1407 | * for deletion. When {@link android.content.ContentResolver#delete} is |
| 1408 | * called on a raw contact, it is marked for deletion and removed from its |
| 1409 | * aggregate contact. The sync adaptor deletes the raw contact on the server and |
| 1410 | * then calls ContactResolver.delete once more, this time passing the |
| 1411 | * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal. |
| 1412 | * <P>Type: INTEGER</P> |
| 1413 | */ |
| 1414 | public static final String DELETED = "deleted"; |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1415 | } |
| 1416 | |
| 1417 | /** |
| 1418 | * Constants for the groups table. |
| 1419 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1420 | public static final class Groups implements BaseColumns, GroupsColumns, SyncColumns { |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1421 | /** |
| 1422 | * This utility class cannot be instantiated |
| 1423 | */ |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1424 | private Groups() { |
| 1425 | } |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1426 | |
| 1427 | /** |
| 1428 | * The content:// style URI for this table |
| 1429 | */ |
| 1430 | public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "groups"); |
| 1431 | |
| 1432 | /** |
| 1433 | * The content:// style URI for this table joined with details data from |
Dmitri Plotnikov | 02c5b45 | 2009-07-22 15:13:08 -0700 | [diff] [blame] | 1434 | * {@link Data}. |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1435 | */ |
| 1436 | public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI, |
| 1437 | "groups_summary"); |
| 1438 | |
| 1439 | /** |
| 1440 | * The MIME type of a directory of groups. |
| 1441 | */ |
| 1442 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group"; |
| 1443 | |
| 1444 | /** |
| 1445 | * The MIME type of a single group. |
| 1446 | */ |
| 1447 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group"; |
Fred Quintana | 00c89f6 | 2009-08-10 14:43:24 -0700 | [diff] [blame] | 1448 | |
| 1449 | /** |
| 1450 | * Query parameter that can be passed with the {@link #CONTENT_URI} URI |
| 1451 | * to the {@link android.content.ContentResolver#delete} method to |
| 1452 | * indicate that the raw contact can be deleted physically, rather than |
| 1453 | * merely marked as deleted. |
| 1454 | */ |
| 1455 | public static final String DELETE_PERMANENTLY = "delete_permanently"; |
Dmitri Plotnikov | 507f160 | 2009-08-10 17:37:36 -0700 | [diff] [blame^] | 1456 | |
| 1457 | /** |
| 1458 | * An optional update or insert URI parameter that determines if the |
| 1459 | * group should be marked as dirty. The default value is true. |
| 1460 | */ |
| 1461 | public static final String MARK_AS_DIRTY = "mark_as_dirty"; |
Jeff Sharkey | b2909eb | 2009-06-16 16:55:31 -0700 | [diff] [blame] | 1462 | } |
| 1463 | |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1464 | /** |
| 1465 | * Constants for the contact aggregation exceptions table, which contains |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1466 | * aggregation rules overriding those used by automatic aggregation. This type only |
| 1467 | * supports query and update. Neither insert nor delete are supported. |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1468 | */ |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 1469 | public static final class AggregationExceptions implements BaseColumns { |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1470 | /** |
| 1471 | * This utility class cannot be instantiated |
| 1472 | */ |
| 1473 | private AggregationExceptions() {} |
| 1474 | |
| 1475 | /** |
| 1476 | * The content:// style URI for this table |
| 1477 | */ |
| 1478 | public static final Uri CONTENT_URI = |
| 1479 | Uri.withAppendedPath(AUTHORITY_URI, "aggregation_exceptions"); |
| 1480 | |
| 1481 | /** |
| 1482 | * The MIME type of {@link #CONTENT_URI} providing a directory of data. |
| 1483 | */ |
| 1484 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception"; |
| 1485 | |
| 1486 | /** |
Dmitri Plotnikov | 0918bf0 | 2009-06-10 16:13:08 -0700 | [diff] [blame] | 1487 | * The MIME type of a {@link #CONTENT_URI} subdirectory of an aggregation exception |
| 1488 | */ |
| 1489 | public static final String CONTENT_ITEM_TYPE = |
| 1490 | "vnd.android.cursor.item/aggregation_exception"; |
| 1491 | |
| 1492 | /** |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1493 | * The type of exception: {@link #TYPE_KEEP_IN}, {@link #TYPE_KEEP_OUT} or |
| 1494 | * {@link #TYPE_AUTOMATIC}. |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1495 | * |
| 1496 | * <P>Type: INTEGER</P> |
| 1497 | */ |
| 1498 | public static final String TYPE = "type"; |
| 1499 | |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1500 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1501 | * Allows the provider to automatically decide whether the aggregate |
| 1502 | * contact should include a particular raw contact or not. |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1503 | */ |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1504 | public static final int TYPE_AUTOMATIC = 0; |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1505 | |
| 1506 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1507 | * Makes sure that the specified raw contact is included in the |
| 1508 | * specified aggregate contact. |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1509 | */ |
| 1510 | public static final int TYPE_KEEP_IN = 1; |
| 1511 | |
| 1512 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1513 | * Makes sure that the specified raw contact is NOT included in the |
| 1514 | * specified aggregate contact. |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1515 | */ |
| 1516 | public static final int TYPE_KEEP_OUT = 2; |
| 1517 | |
| 1518 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1519 | * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the |
| 1520 | * aggregate contact that the rule applies to. |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1521 | */ |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1522 | public static final String CONTACT_ID = "contact_id"; |
Dmitri Plotnikov | 9d04451 | 2009-06-16 13:21:23 -0700 | [diff] [blame] | 1523 | |
| 1524 | /** |
Dmitri Plotnikov | 7cca5f8 | 2009-07-27 20:25:59 -0700 | [diff] [blame] | 1525 | * A reference to the {@link RawContacts#_ID} of the raw contact that the rule applies to. |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1526 | */ |
Dmitri Plotnikov | facbbb3 | 2009-07-27 15:18:19 -0700 | [diff] [blame] | 1527 | public static final String RAW_CONTACT_ID = "raw_contact_id"; |
Fred Quintana | 435e427 | 2009-06-04 17:30:28 -0700 | [diff] [blame] | 1528 | } |
Jeff Sharkey | 28b68e5 | 2009-06-10 15:26:58 -0700 | [diff] [blame] | 1529 | |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 1530 | /** |
| 1531 | * Contains helper classes used to create or manage {@link android.content.Intent Intents} |
| 1532 | * that involve contacts. |
| 1533 | */ |
| 1534 | public static final class Intents { |
| 1535 | /** |
| 1536 | * This is the intent that is fired when a search suggestion is clicked on. |
| 1537 | */ |
| 1538 | public static final String SEARCH_SUGGESTION_CLICKED = |
| 1539 | "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED"; |
| 1540 | |
| 1541 | /** |
| 1542 | * This is the intent that is fired when a search suggestion for dialing a number |
| 1543 | * is clicked on. |
| 1544 | */ |
| 1545 | public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = |
| 1546 | "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED"; |
| 1547 | |
| 1548 | /** |
| 1549 | * This is the intent that is fired when a search suggestion for creating a contact |
| 1550 | * is clicked on. |
| 1551 | */ |
| 1552 | public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = |
| 1553 | "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED"; |
| 1554 | |
| 1555 | /** |
| 1556 | * Starts an Activity that lets the user pick a contact to attach an image to. |
| 1557 | * After picking the contact it launches the image cropper in face detection mode. |
| 1558 | */ |
| 1559 | public static final String ATTACH_IMAGE = |
| 1560 | "com.android.contacts.action.ATTACH_IMAGE"; |
| 1561 | |
| 1562 | /** |
| 1563 | * Takes as input a data URI with a mailto: or tel: scheme. If a single |
| 1564 | * contact exists with the given data it will be shown. If no contact |
| 1565 | * exists, a dialog will ask the user if they want to create a new |
| 1566 | * contact with the provided details filled in. If multiple contacts |
| 1567 | * share the data the user will be prompted to pick which contact they |
| 1568 | * want to view. |
| 1569 | * <p> |
| 1570 | * For <code>mailto:</code> URIs, the scheme specific portion must be a |
| 1571 | * raw email address, such as one built using |
| 1572 | * {@link Uri#fromParts(String, String, String)}. |
| 1573 | * <p> |
| 1574 | * For <code>tel:</code> URIs, the scheme specific portion is compared |
| 1575 | * to existing numbers using the standard caller ID lookup algorithm. |
| 1576 | * The number must be properly encoded, for example using |
| 1577 | * {@link Uri#fromParts(String, String, String)}. |
| 1578 | * <p> |
| 1579 | * Any extras from the {@link Insert} class will be passed along to the |
| 1580 | * create activity if there are no contacts to show. |
| 1581 | * <p> |
| 1582 | * Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip |
| 1583 | * prompting the user when the contact doesn't exist. |
| 1584 | */ |
| 1585 | public static final String SHOW_OR_CREATE_CONTACT = |
| 1586 | "com.android.contacts.action.SHOW_OR_CREATE_CONTACT"; |
| 1587 | |
| 1588 | /** |
| 1589 | * Used with {@link #SHOW_OR_CREATE_CONTACT} to force creating a new |
| 1590 | * contact if no matching contact found. Otherwise, default behavior is |
| 1591 | * to prompt user with dialog before creating. |
| 1592 | * <p> |
| 1593 | * Type: BOOLEAN |
| 1594 | */ |
| 1595 | public static final String EXTRA_FORCE_CREATE = |
| 1596 | "com.android.contacts.action.FORCE_CREATE"; |
| 1597 | |
| 1598 | /** |
| 1599 | * Used with {@link #SHOW_OR_CREATE_CONTACT} to specify an exact |
| 1600 | * description to be shown when prompting user about creating a new |
| 1601 | * contact. |
| 1602 | * <p> |
| 1603 | * Type: STRING |
| 1604 | */ |
| 1605 | public static final String EXTRA_CREATE_DESCRIPTION = |
| 1606 | "com.android.contacts.action.CREATE_DESCRIPTION"; |
| 1607 | |
| 1608 | /** |
Jeff Sharkey | 1132200 | 2009-06-04 17:25:51 -0700 | [diff] [blame] | 1609 | * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a |
| 1610 | * dialog location using screen coordinates. When not specified, the |
| 1611 | * dialog will be centered. |
| 1612 | */ |
| 1613 | public static final String EXTRA_TARGET_RECT = "target_rect"; |
| 1614 | |
| 1615 | /** |
Jeff Sharkey | 6bfe14d | 2009-08-05 15:49:48 -0700 | [diff] [blame] | 1616 | * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a |
| 1617 | * desired dialog style, usually a variation on size. One of |
| 1618 | * {@link #MODE_SMALL}, {@link #MODE_MEDIUM}, or {@link #MODE_LARGE}. |
| 1619 | */ |
| 1620 | public static final String EXTRA_MODE = "mode"; |
| 1621 | |
| 1622 | /** |
| 1623 | * Value for {@link #EXTRA_MODE} to show a small-sized dialog. |
| 1624 | */ |
| 1625 | public static final int MODE_SMALL = 1; |
| 1626 | |
| 1627 | /** |
| 1628 | * Value for {@link #EXTRA_MODE} to show a medium-sized dialog. |
| 1629 | */ |
| 1630 | public static final int MODE_MEDIUM = 2; |
| 1631 | |
| 1632 | /** |
| 1633 | * Value for {@link #EXTRA_MODE} to show a large-sized dialog. |
| 1634 | */ |
| 1635 | public static final int MODE_LARGE = 3; |
| 1636 | |
| 1637 | /** |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 1638 | * Intents related to the Contacts app UI. |
| 1639 | */ |
| 1640 | public static final class UI { |
| 1641 | /** |
| 1642 | * The action for the default contacts list tab. |
| 1643 | */ |
| 1644 | public static final String LIST_DEFAULT = |
| 1645 | "com.android.contacts.action.LIST_DEFAULT"; |
| 1646 | |
| 1647 | /** |
| 1648 | * The action for the contacts list tab. |
| 1649 | */ |
| 1650 | public static final String LIST_GROUP_ACTION = |
| 1651 | "com.android.contacts.action.LIST_GROUP"; |
| 1652 | |
| 1653 | /** |
| 1654 | * When in LIST_GROUP_ACTION mode, this is the group to display. |
| 1655 | */ |
| 1656 | public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP"; |
| 1657 | |
| 1658 | /** |
| 1659 | * The action for the all contacts list tab. |
| 1660 | */ |
| 1661 | public static final String LIST_ALL_CONTACTS_ACTION = |
| 1662 | "com.android.contacts.action.LIST_ALL_CONTACTS"; |
| 1663 | |
| 1664 | /** |
| 1665 | * The action for the contacts with phone numbers list tab. |
| 1666 | */ |
| 1667 | public static final String LIST_CONTACTS_WITH_PHONES_ACTION = |
| 1668 | "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES"; |
| 1669 | |
| 1670 | /** |
| 1671 | * The action for the starred contacts list tab. |
| 1672 | */ |
| 1673 | public static final String LIST_STARRED_ACTION = |
| 1674 | "com.android.contacts.action.LIST_STARRED"; |
| 1675 | |
| 1676 | /** |
| 1677 | * The action for the frequent contacts list tab. |
| 1678 | */ |
| 1679 | public static final String LIST_FREQUENT_ACTION = |
| 1680 | "com.android.contacts.action.LIST_FREQUENT"; |
| 1681 | |
| 1682 | /** |
| 1683 | * The action for the "strequent" contacts list tab. It first lists the starred |
| 1684 | * contacts in alphabetical order and then the frequent contacts in descending |
| 1685 | * order of the number of times they have been contacted. |
| 1686 | */ |
| 1687 | public static final String LIST_STREQUENT_ACTION = |
| 1688 | "com.android.contacts.action.LIST_STREQUENT"; |
| 1689 | |
| 1690 | /** |
| 1691 | * A key for to be used as an intent extra to set the activity |
| 1692 | * title to a custom String value. |
| 1693 | */ |
| 1694 | public static final String TITLE_EXTRA_KEY = |
| 1695 | "com.android.contacts.extra.TITLE_EXTRA"; |
| 1696 | |
| 1697 | /** |
| 1698 | * Activity Action: Display a filtered list of contacts |
| 1699 | * <p> |
| 1700 | * Input: Extra field {@link #FILTER_TEXT_EXTRA_KEY} is the text to use for |
| 1701 | * filtering |
| 1702 | * <p> |
| 1703 | * Output: Nothing. |
| 1704 | */ |
| 1705 | public static final String FILTER_CONTACTS_ACTION = |
| 1706 | "com.android.contacts.action.FILTER_CONTACTS"; |
| 1707 | |
| 1708 | /** |
| 1709 | * Used as an int extra field in {@link #FILTER_CONTACTS_ACTION} |
| 1710 | * intents to supply the text on which to filter. |
| 1711 | */ |
| 1712 | public static final String FILTER_TEXT_EXTRA_KEY = |
| 1713 | "com.android.contacts.extra.FILTER_TEXT"; |
| 1714 | } |
| 1715 | |
| 1716 | /** |
| 1717 | * Convenience class that contains string constants used |
| 1718 | * to create contact {@link android.content.Intent Intents}. |
| 1719 | */ |
| 1720 | public static final class Insert { |
| 1721 | /** The action code to use when adding a contact */ |
| 1722 | public static final String ACTION = Intent.ACTION_INSERT; |
| 1723 | |
| 1724 | /** |
| 1725 | * If present, forces a bypass of quick insert mode. |
| 1726 | */ |
| 1727 | public static final String FULL_MODE = "full_mode"; |
| 1728 | |
| 1729 | /** |
| 1730 | * The extra field for the contact name. |
| 1731 | * <P>Type: String</P> |
| 1732 | */ |
| 1733 | public static final String NAME = "name"; |
| 1734 | |
| 1735 | // TODO add structured name values here. |
| 1736 | |
| 1737 | /** |
| 1738 | * The extra field for the contact phonetic name. |
| 1739 | * <P>Type: String</P> |
| 1740 | */ |
| 1741 | public static final String PHONETIC_NAME = "phonetic_name"; |
| 1742 | |
| 1743 | /** |
| 1744 | * The extra field for the contact company. |
| 1745 | * <P>Type: String</P> |
| 1746 | */ |
| 1747 | public static final String COMPANY = "company"; |
| 1748 | |
| 1749 | /** |
| 1750 | * The extra field for the contact job title. |
| 1751 | * <P>Type: String</P> |
| 1752 | */ |
| 1753 | public static final String JOB_TITLE = "job_title"; |
| 1754 | |
| 1755 | /** |
| 1756 | * The extra field for the contact notes. |
| 1757 | * <P>Type: String</P> |
| 1758 | */ |
| 1759 | public static final String NOTES = "notes"; |
| 1760 | |
| 1761 | /** |
| 1762 | * The extra field for the contact phone number. |
| 1763 | * <P>Type: String</P> |
| 1764 | */ |
| 1765 | public static final String PHONE = "phone"; |
| 1766 | |
| 1767 | /** |
| 1768 | * The extra field for the contact phone number type. |
| 1769 | * <P>Type: Either an integer value from |
| 1770 | * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, |
| 1771 | * or a string specifying a custom label.</P> |
| 1772 | */ |
| 1773 | public static final String PHONE_TYPE = "phone_type"; |
| 1774 | |
| 1775 | /** |
| 1776 | * The extra field for the phone isprimary flag. |
| 1777 | * <P>Type: boolean</P> |
| 1778 | */ |
| 1779 | public static final String PHONE_ISPRIMARY = "phone_isprimary"; |
| 1780 | |
| 1781 | /** |
| 1782 | * The extra field for an optional second contact phone number. |
| 1783 | * <P>Type: String</P> |
| 1784 | */ |
| 1785 | public static final String SECONDARY_PHONE = "secondary_phone"; |
| 1786 | |
| 1787 | /** |
| 1788 | * The extra field for an optional second contact phone number type. |
| 1789 | * <P>Type: Either an integer value from |
| 1790 | * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, |
| 1791 | * or a string specifying a custom label.</P> |
| 1792 | */ |
| 1793 | public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type"; |
| 1794 | |
| 1795 | /** |
| 1796 | * The extra field for an optional third contact phone number. |
| 1797 | * <P>Type: String</P> |
| 1798 | */ |
| 1799 | public static final String TERTIARY_PHONE = "tertiary_phone"; |
| 1800 | |
| 1801 | /** |
| 1802 | * The extra field for an optional third contact phone number type. |
| 1803 | * <P>Type: Either an integer value from |
| 1804 | * {@link android.provider.Contacts.PhonesColumns PhonesColumns}, |
| 1805 | * or a string specifying a custom label.</P> |
| 1806 | */ |
| 1807 | public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type"; |
| 1808 | |
| 1809 | /** |
| 1810 | * The extra field for the contact email address. |
| 1811 | * <P>Type: String</P> |
| 1812 | */ |
| 1813 | public static final String EMAIL = "email"; |
| 1814 | |
| 1815 | /** |
| 1816 | * The extra field for the contact email type. |
| 1817 | * <P>Type: Either an integer value from |
| 1818 | * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} |
| 1819 | * or a string specifying a custom label.</P> |
| 1820 | */ |
| 1821 | public static final String EMAIL_TYPE = "email_type"; |
| 1822 | |
| 1823 | /** |
| 1824 | * The extra field for the email isprimary flag. |
| 1825 | * <P>Type: boolean</P> |
| 1826 | */ |
| 1827 | public static final String EMAIL_ISPRIMARY = "email_isprimary"; |
| 1828 | |
| 1829 | /** |
| 1830 | * The extra field for an optional second contact email address. |
| 1831 | * <P>Type: String</P> |
| 1832 | */ |
| 1833 | public static final String SECONDARY_EMAIL = "secondary_email"; |
| 1834 | |
| 1835 | /** |
| 1836 | * The extra field for an optional second contact email type. |
| 1837 | * <P>Type: Either an integer value from |
| 1838 | * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} |
| 1839 | * or a string specifying a custom label.</P> |
| 1840 | */ |
| 1841 | public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type"; |
| 1842 | |
| 1843 | /** |
| 1844 | * The extra field for an optional third contact email address. |
| 1845 | * <P>Type: String</P> |
| 1846 | */ |
| 1847 | public static final String TERTIARY_EMAIL = "tertiary_email"; |
| 1848 | |
| 1849 | /** |
| 1850 | * The extra field for an optional third contact email type. |
| 1851 | * <P>Type: Either an integer value from |
| 1852 | * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} |
| 1853 | * or a string specifying a custom label.</P> |
| 1854 | */ |
| 1855 | public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type"; |
| 1856 | |
| 1857 | /** |
| 1858 | * The extra field for the contact postal address. |
| 1859 | * <P>Type: String</P> |
| 1860 | */ |
| 1861 | public static final String POSTAL = "postal"; |
| 1862 | |
| 1863 | /** |
| 1864 | * The extra field for the contact postal address type. |
| 1865 | * <P>Type: Either an integer value from |
| 1866 | * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns} |
| 1867 | * or a string specifying a custom label.</P> |
| 1868 | */ |
| 1869 | public static final String POSTAL_TYPE = "postal_type"; |
| 1870 | |
| 1871 | /** |
| 1872 | * The extra field for the postal isprimary flag. |
| 1873 | * <P>Type: boolean</P> |
| 1874 | */ |
| 1875 | public static final String POSTAL_ISPRIMARY = "postal_isprimary"; |
| 1876 | |
| 1877 | /** |
| 1878 | * The extra field for an IM handle. |
| 1879 | * <P>Type: String</P> |
| 1880 | */ |
| 1881 | public static final String IM_HANDLE = "im_handle"; |
| 1882 | |
| 1883 | /** |
| 1884 | * The extra field for the IM protocol |
Jeff Sharkey | 8a0193e | 2009-07-20 23:28:23 -0700 | [diff] [blame] | 1885 | * <P>Type: the result of {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)} |
| 1886 | * or {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}.</P> |
Evan Millar | dc2da5f | 2009-06-18 16:07:13 -0700 | [diff] [blame] | 1887 | */ |
| 1888 | public static final String IM_PROTOCOL = "im_protocol"; |
| 1889 | |
| 1890 | /** |
| 1891 | * The extra field for the IM isprimary flag. |
| 1892 | * <P>Type: boolean</P> |
| 1893 | */ |
| 1894 | public static final String IM_ISPRIMARY = "im_isprimary"; |
| 1895 | } |
| 1896 | } |
| 1897 | |
Evan Millar | 088b291 | 2009-05-28 15:24:37 -0700 | [diff] [blame] | 1898 | } |