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