blob: 77bdc73fea34dac5a4b9f55e28768d01685b5bc1 [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 /**
The Android Open Source Project15a88802009-02-10 15:44:05 -0800150 * The favorite is a gadget
151 */
152 static final int ITEM_TYPE_GADGET = 4;
153
154 /**
The Android Open Source Projectd097a182008-12-17 18:05:58 -0800155 * The favorite is a clock
156 */
157 static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
158
159 /**
160 * The favorite is a search widget
161 */
162 static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
163
164 /**
165 * The favorite is a photo frame
166 */
167 static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
168
169 /**
The Android Open Source Project15a88802009-02-10 15:44:05 -0800170 * The gadgetId of the gadget
171 *
172 * <P>Type: INTEGER</P>
173 */
174 static final String GADGET_ID = "gadgetId";
175
176 /**
The Android Open Source Projectd097a182008-12-17 18:05:58 -0800177 * Indicates whether this favorite is an application-created shortcut or not.
178 * If the value is 0, the favorite is not an application-created shortcut, if the
179 * value is 1, it is an application-created shortcut.
180 * <P>Type: INTEGER</P>
181 */
182 static final String IS_SHORTCUT = "isShortcut";
183
184 /**
185 * The icon type.
186 * <P>Type: INTEGER</P>
187 */
188 static final String ICON_TYPE = "iconType";
189
190 /**
191 * The icon is a resource identified by a package name and an integer id.
192 */
193 static final int ICON_TYPE_RESOURCE = 0;
194
195 /**
196 * The icon is a bitmap.
197 */
198 static final int ICON_TYPE_BITMAP = 1;
199
200 /**
201 * The icon package name, if icon type is ICON_TYPE_RESOURCE.
202 * <P>Type: TEXT</P>
203 */
204 static final String ICON_PACKAGE = "iconPackage";
205
206 /**
207 * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
208 * <P>Type: TEXT</P>
209 */
210 static final String ICON_RESOURCE = "iconResource";
211
212 /**
213 * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
214 * <P>Type: BLOB</P>
215 */
216 static final String ICON = "icon";
217
218 /**
219 * The URI associated with the favorite. It is used, for instance, by
220 * live folders to find the content provider.
221 * <P>Type: TEXT</P>
222 */
223 static final String URI = "uri";
224
225 /**
226 * The display mode if the item is a live folder.
227 * <P>Type: INTEGER</P>
228 *
229 * @see android.provider.LiveFolders#DISPLAY_MODE_GRID
230 * @see android.provider.LiveFolders#DISPLAY_MODE_LIST
231 */
232 static final String DISPLAY_MODE = "displayMode";
233 }
234}