blob: c5dfd1ff02986f49eb95fefc7312f074d2e200df [file] [log] [blame]
The Android Open Source Projectd097a182008-12-17 18:05:58 -08001/*
2 * Copyright (C) 2008 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
17package com.android.launcher;
18
19import android.provider.BaseColumns;
20import android.net.Uri;
21
22/**
23 * Settings related utilities.
24 */
25class LauncherSettings {
26 /**
27 * Favorites.
28 */
29 static final class Favorites implements BaseColumns {
30 /**
31 * The content:// style URL for this table
32 */
33 static final Uri CONTENT_URI = Uri.parse("content://" +
34 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
35 "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
36
37 /**
38 * The content:// style URL for this table. When this Uri is used, no notification is
39 * sent if the content changes.
40 */
41 static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
42 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
43 "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
44
45 /**
46 * The content:// style URL for a given row, identified by its id.
47 *
48 * @param id The row id.
49 * @param notify True to send a notification is the content changes.
50 *
51 * @return The unique content URL for the specified row.
52 */
53 static Uri getContentUri(long id, boolean notify) {
54 return Uri.parse("content://" + LauncherProvider.AUTHORITY +
55 "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
56 LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
57 }
58
59 /**
60 * The row ID.
61 * <p>Type: INTEGER</p>
62 */
63 static final String ID = "_id";
64
65 /**
66 * Descriptive name of the favorite that can be displayed to the user.
67 * <P>Type: TEXT</P>
68 */
69 static final String TITLE = "title";
70
71 /**
72 * The Intent URL of the favorite, describing what it points to. This
73 * value is given to {@link android.content.Intent#getIntent} to create
74 * an Intent that can be launched.
75 * <P>Type: TEXT</P>
76 */
77 static final String INTENT = "intent";
78
79 /**
80 * The container holding the favorite
81 * <P>Type: INTEGER</P>
82 */
83 static final String CONTAINER = "container";
84
85 /**
86 * The icon is a resource identified by a package name and an integer id.
87 */
88 static final int CONTAINER_DESKTOP = -100;
89
90 /**
91 * The screen holding the favorite (if container is CONTAINER_DESKTOP)
92 * <P>Type: INTEGER</P>
93 */
94 static final String SCREEN = "screen";
95
96 /**
97 * The X coordinate of the cell holding the favorite
98 * (if container is CONTAINER_DESKTOP or CONTAINER_DOCK)
99 * <P>Type: INTEGER</P>
100 */
101 static final String CELLX = "cellX";
102
103 /**
104 * The Y coordinate of the cell holding the favorite
105 * (if container is CONTAINER_DESKTOP)
106 * <P>Type: INTEGER</P>
107 */
108 static final String CELLY = "cellY";
109
110 /**
111 * The X span of the cell holding the favorite
112 * <P>Type: INTEGER</P>
113 */
114 static final String SPANX = "spanX";
115
116 /**
117 * The Y span of the cell holding the favorite
118 * <P>Type: INTEGER</P>
119 */
120 static final String SPANY = "spanY";
121
122 /**
123 * The type of the favorite
124 *
125 * <P>Type: INTEGER</P>
126 */
127 static final String ITEM_TYPE = "itemType";
128
129 /**
130 * The favorite is an application
131 */
132 static final int ITEM_TYPE_APPLICATION = 0;
133
134 /**
135 * The favorite is an application created shortcut
136 */
137 static final int ITEM_TYPE_SHORTCUT = 1;
138
139 /**
140 * The favorite is a user created folder
141 */
142 static final int ITEM_TYPE_USER_FOLDER = 2;
143
144 /**
145 * The favorite is a live folder
146 */
147 static final int ITEM_TYPE_LIVE_FOLDER = 3;
148
149 /**
150 * The favorite is a clock
151 */
152 static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
153
154 /**
155 * The favorite is a search widget
156 */
157 static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
158
159 /**
160 * The favorite is a photo frame
161 */
162 static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
163
164 /**
165 * Indicates whether this favorite is an application-created shortcut or not.
166 * If the value is 0, the favorite is not an application-created shortcut, if the
167 * value is 1, it is an application-created shortcut.
168 * <P>Type: INTEGER</P>
169 */
170 static final String IS_SHORTCUT = "isShortcut";
171
172 /**
173 * The icon type.
174 * <P>Type: INTEGER</P>
175 */
176 static final String ICON_TYPE = "iconType";
177
178 /**
179 * The icon is a resource identified by a package name and an integer id.
180 */
181 static final int ICON_TYPE_RESOURCE = 0;
182
183 /**
184 * The icon is a bitmap.
185 */
186 static final int ICON_TYPE_BITMAP = 1;
187
188 /**
189 * The icon package name, if icon type is ICON_TYPE_RESOURCE.
190 * <P>Type: TEXT</P>
191 */
192 static final String ICON_PACKAGE = "iconPackage";
193
194 /**
195 * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
196 * <P>Type: TEXT</P>
197 */
198 static final String ICON_RESOURCE = "iconResource";
199
200 /**
201 * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
202 * <P>Type: BLOB</P>
203 */
204 static final String ICON = "icon";
205
206 /**
207 * The URI associated with the favorite. It is used, for instance, by
208 * live folders to find the content provider.
209 * <P>Type: TEXT</P>
210 */
211 static final String URI = "uri";
212
213 /**
214 * The display mode if the item is a live folder.
215 * <P>Type: INTEGER</P>
216 *
217 * @see android.provider.LiveFolders#DISPLAY_MODE_GRID
218 * @see android.provider.LiveFolders#DISPLAY_MODE_LIST
219 */
220 static final String DISPLAY_MODE = "displayMode";
221 }
222}