blob: c68f9d267a75eb446e1efbdbd4895f2c4d456205 [file] [log] [blame]
Mindy Pereira6f92de62011-12-19 11:31:48 -08001/**
2 * Copyright (c) 2011, Google Inc.
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
17package com.android.email.providers;
18
19import android.net.Uri;
20import android.provider.BaseColumns;
21
22
23public class UIProvider {
24 // This authority is only needed to get to the account list
25 // NOTE: Overlay applications may want to override this authority
26 public static final String AUTHORITY = "com.android.email.providers";
27
28 static final String BASE_URI_STRING = "content://" + AUTHORITY;
29
30 public static final String ACCOUNT_LIST_TYPE =
31 "vnd.android.cursor.dir/vnd.com.android.email.account";
32 public static final String ACCOUNT_TYPE =
33 "vnd.android.cursor.item/vnd.com.android.email.account";
34
35 public static final String[] ACCOUNTS_PROJECTION = {
36 BaseColumns._ID,
37 AccountColumns.NAME,
38 AccountColumns.PROVIDER_VERSION,
39 AccountColumns.URI,
40 AccountColumns.CAPABILITIES,
41 AccountColumns.FOLDER_LIST_URI,
42 AccountColumns.SEARCH_URI,
43 AccountColumns.ACCOUNT_FROM_ADDRESSES_URI,
44 };
45
46 public static final class AccountCapabilities {
47 public static final int SUPPORTS_SYNCABLE_FOLDERS = 0x0001;
48 public static final int SUPPORTS_REPORT_SPAM = 0x0002;
49 public static final int SUPPORTS_ARCHIVE = 0x0004;
50 public static final int SUPPORTS_SERVER_SEARCH = 0x0008;
51 public static final int SUPPORTS_FOLDER_SERVER_SEARCH = 0x00018;
52 public static final int RETURNS_SANITIZED_HTML = 0x0020;
53 public static final int SUPPORTS_DRAFT_SYNCHRONIZATION = 0x0040;
54 public static final int SUPPORTS_MULTIPLE_FROM_ADDRESSES = 0x0080;
55 public static final int SUPPORTS_SMART_REPLY = 0x0100;
56 public static final int SUPPORTS_LOCAL_SEARCH = 0x0200;
57 public static final int SUPPORTS_THREADED_CONVERSATIONS = 0x0400;
58 }
59
60 public static final class AccountColumns {
61 public static final String NAME = "name";
62 public static final String PROVIDER_VERSION = "providerVersion";
63 public static final String URI = "uri";
64 public static final String CAPABILITIES = "capabilities";
65 public static final String FOLDER_LIST_URI = "folderListUri";
66 public static final String SEARCH_URI = "searchUri";
67 public static final String ACCOUNT_FROM_ADDRESSES_URI = "accountFromAddressesUri";
68 public static final String SAVE_NEW_DRAFT_URI = "saveNewDraftUri";
69
70 private AccountColumns() {};
71 }
72
73 /**
74 * Returns a uri that, when queried, will return a cursor with a list of information for the
75 * list of configured accounts.
76 * @return
77 */
78 public static Uri getAccountsUri() {
79 return Uri.parse(BASE_URI_STRING + "/");
80 }
81
82
83 public static final class MessageColumns {
84 public static final String ID = "_id";
85 public static final String URI = "uri";
86 public static final String MESSAGE_ID = "messageId";
87 public static final String CONVERSATION_ID = "conversation";
88 public static final String SUBJECT = "subject";
89 public static final String SNIPPET = "snippet";
90 public static final String FROM = "fromAddress";
91 public static final String TO = "toAddresses";
92 public static final String CC = "ccAddresses";
93 public static final String BCC = "bccAddresses";
94 public static final String REPLY_TO = "replyToAddresses";
95 public static final String DATE_SENT_MS = "dateSentMs";
96 public static final String DATE_RECEIVED_MS = "dateReceivedMs";
97 public static final String LIST_INFO = "listInfo";
98 public static final String BODY = "body";
99 public static final String EMBEDS_EXTERNAL_RESOURCES = "bodyEmbedsExternalResources";
100 public static final String REF_MESSAGE_ID = "refMessageId";
101 public static final String FORWARD = "forward";
102 public static final String INCLUDE_QUOTED_TEXT = "includeQuotedText";
103 public static final String QUOTE_START_POS = "quoteStartPos";
104 public static final String CLIENT_CREATED = "clientCreated";
105 public static final String CUSTOM_FROM_ADDRESS = "customFromAddress";
106
107 // TODO: Add attachments, flags
108
109 private MessageColumns() {}
110 }
111}