blob: 8cc2559f75022e51d58d60720b743bad9f72b209 [file] [log] [blame]
The Android Open Source Project31dd5032009-03-03 19:32:27 -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 {
Romain Guy73b979d2009-06-09 12:57:21 -070026 static interface BaseLauncherColumns extends BaseColumns {
27 /**
28 * Descriptive name of the gesture that can be displayed to the user.
29 * <P>Type: TEXT</P>
30 */
31 static final String TITLE = "title";
32
33 /**
34 * The Intent URL of the gesture, describing what it points to. This
Romain Guy1ce1a242009-06-23 17:34:54 -070035 * value is given to {@link android.content.Intent#parseUri(String, int)} to create
Romain Guy73b979d2009-06-09 12:57:21 -070036 * an Intent that can be launched.
37 * <P>Type: TEXT</P>
38 */
39 static final String INTENT = "intent";
40
41 /**
42 * The type of the gesture
43 *
44 * <P>Type: INTEGER</P>
45 */
46 static final String ITEM_TYPE = "itemType";
47
48 /**
49 * The gesture is an application
50 */
51 static final int ITEM_TYPE_APPLICATION = 0;
52
53 /**
54 * The gesture is an application created shortcut
55 */
56 static final int ITEM_TYPE_SHORTCUT = 1;
57
58 /**
59 * The icon type.
60 * <P>Type: INTEGER</P>
61 */
62 static final String ICON_TYPE = "iconType";
63
64 /**
65 * The icon is a resource identified by a package name and an integer id.
66 */
67 static final int ICON_TYPE_RESOURCE = 0;
68
69 /**
70 * The icon is a bitmap.
71 */
72 static final int ICON_TYPE_BITMAP = 1;
73
74 /**
75 * The icon package name, if icon type is ICON_TYPE_RESOURCE.
76 * <P>Type: TEXT</P>
77 */
78 static final String ICON_PACKAGE = "iconPackage";
79
80 /**
81 * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
82 * <P>Type: TEXT</P>
83 */
84 static final String ICON_RESOURCE = "iconResource";
85
86 /**
87 * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
88 * <P>Type: BLOB</P>
89 */
90 static final String ICON = "icon";
91 }
92
93 static final class Gestures implements BaseLauncherColumns {
94 /**
95 * The content:// style URL for this table
96 */
97 static final Uri CONTENT_URI = Uri.parse("content://" +
98 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
99 "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
100
101 /**
102 * The content:// style URL for this table. When this Uri is used, no notification is
103 * sent if the content changes.
104 */
105 static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
106 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
107 "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
108
109 /**
110 * The content:// style URL for a given row, identified by its id.
111 *
112 * @param id The row id.
113 * @param notify True to send a notification is the content changes.
114 *
115 * @return The unique content URL for the specified row.
116 */
117 static Uri getContentUri(long id, boolean notify) {
118 return Uri.parse("content://" + LauncherProvider.AUTHORITY +
119 "/" + LauncherProvider.TABLE_GESTURES + "/" + id + "?" +
120 LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
121 }
122 }
123
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800124 /**
125 * Favorites. When changing these values, be sure to update
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700126 * {@link com.android.settings.LauncherAppWidgetBinder} as needed.
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800127 */
Romain Guy73b979d2009-06-09 12:57:21 -0700128 static final class Favorites implements BaseLauncherColumns {
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800129 /**
130 * The content:// style URL for this table
131 */
132 static final Uri CONTENT_URI = Uri.parse("content://" +
133 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
134 "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
135
136 /**
137 * The content:// style URL for this table. When this Uri is used, no notification is
138 * sent if the content changes.
139 */
140 static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
141 LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
142 "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
143
144 /**
145 * The content:// style URL for a given row, identified by its id.
146 *
147 * @param id The row id.
148 * @param notify True to send a notification is the content changes.
149 *
150 * @return The unique content URL for the specified row.
151 */
152 static Uri getContentUri(long id, boolean notify) {
153 return Uri.parse("content://" + LauncherProvider.AUTHORITY +
154 "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
155 LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
156 }
157
158 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800159 * The container holding the favorite
160 * <P>Type: INTEGER</P>
161 */
162 static final String CONTAINER = "container";
163
164 /**
165 * The icon is a resource identified by a package name and an integer id.
166 */
167 static final int CONTAINER_DESKTOP = -100;
168
169 /**
170 * The screen holding the favorite (if container is CONTAINER_DESKTOP)
171 * <P>Type: INTEGER</P>
172 */
173 static final String SCREEN = "screen";
174
175 /**
176 * The X coordinate of the cell holding the favorite
177 * (if container is CONTAINER_DESKTOP or CONTAINER_DOCK)
178 * <P>Type: INTEGER</P>
179 */
180 static final String CELLX = "cellX";
181
182 /**
183 * The Y coordinate of the cell holding the favorite
184 * (if container is CONTAINER_DESKTOP)
185 * <P>Type: INTEGER</P>
186 */
187 static final String CELLY = "cellY";
188
189 /**
190 * The X span of the cell holding the favorite
191 * <P>Type: INTEGER</P>
192 */
193 static final String SPANX = "spanX";
194
195 /**
196 * The Y span of the cell holding the favorite
197 * <P>Type: INTEGER</P>
198 */
199 static final String SPANY = "spanY";
200
201 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800202 * The favorite is a user created folder
203 */
204 static final int ITEM_TYPE_USER_FOLDER = 2;
205
206 /**
207 * The favorite is a live folder
208 */
209 static final int ITEM_TYPE_LIVE_FOLDER = 3;
210
211 /**
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700212 * The favorite is a widget
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800213 */
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700214 static final int ITEM_TYPE_APPWIDGET = 4;
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800215
216 /**
217 * The favorite is a clock
218 */
219 static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
220
221 /**
222 * The favorite is a search widget
223 */
224 static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
225
226 /**
227 * The favorite is a photo frame
228 */
229 static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
230
231 /**
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700232 * The appWidgetId of the widget
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800233 *
234 * <P>Type: INTEGER</P>
235 */
The Android Open Source Projectca9475f2009-03-13 13:04:24 -0700236 static final String APPWIDGET_ID = "appWidgetId";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800237
238 /**
239 * Indicates whether this favorite is an application-created shortcut or not.
240 * If the value is 0, the favorite is not an application-created shortcut, if the
241 * value is 1, it is an application-created shortcut.
242 * <P>Type: INTEGER</P>
243 */
Romain Guy73b979d2009-06-09 12:57:21 -0700244 @Deprecated
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800245 static final String IS_SHORTCUT = "isShortcut";
246
247 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800248 * The URI associated with the favorite. It is used, for instance, by
249 * live folders to find the content provider.
250 * <P>Type: TEXT</P>
251 */
252 static final String URI = "uri";
253
254 /**
255 * The display mode if the item is a live folder.
256 * <P>Type: INTEGER</P>
257 *
258 * @see android.provider.LiveFolders#DISPLAY_MODE_GRID
259 * @see android.provider.LiveFolders#DISPLAY_MODE_LIST
260 */
261 static final String DISPLAY_MODE = "displayMode";
262 }
263}