/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.cyanogenmod.trebuchet; import android.net.Uri; import android.provider.BaseColumns; /** * Settings related utilities. */ class LauncherSettings { static interface BaseLauncherColumns extends BaseColumns { /** * Descriptive name of the gesture that can be displayed to the user. *

Type: TEXT

*/ static final String TITLE = "title"; /** * The Intent URL of the gesture, describing what it points to. This * value is given to {@link android.content.Intent#parseUri(String, int)} to create * an Intent that can be launched. *

Type: TEXT

*/ static final String INTENT = "intent"; /** * The type of the gesture * *

Type: INTEGER

*/ static final String ITEM_TYPE = "itemType"; /** * The gesture is an application */ static final int ITEM_TYPE_APPLICATION = 0; /** * The gesture is an application created shortcut */ static final int ITEM_TYPE_SHORTCUT = 1; /** * The gesture is a launcher action */ static final int ITEM_TYPE_ALLAPPS = 3; /** * The icon type. *

Type: INTEGER

*/ static final String ICON_TYPE = "iconType"; /** * The icon is a resource identified by a package name and an integer id. */ static final int ICON_TYPE_RESOURCE = 0; /** * The icon is a bitmap. */ static final int ICON_TYPE_BITMAP = 1; /** * The icon package name, if icon type is ICON_TYPE_RESOURCE. *

Type: TEXT

*/ static final String ICON_PACKAGE = "iconPackage"; /** * The icon resource id, if icon type is ICON_TYPE_RESOURCE. *

Type: TEXT

*/ static final String ICON_RESOURCE = "iconResource"; /** * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP. *

Type: BLOB

*/ static final String ICON = "icon"; } /** * Favorites. */ static final class Favorites implements BaseLauncherColumns { /** * The content:// style URL for this table */ static final Uri CONTENT_URI = Uri.parse("content://" + LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + "?" + LauncherProvider.PARAMETER_NOTIFY + "=true"); /** * The content:// style URL for this table. When this Uri is used, no notification is * sent if the content changes. */ static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" + LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + "?" + LauncherProvider.PARAMETER_NOTIFY + "=false"); /** * The content:// style URL for a given row, identified by its id. * * @param id The row id. * @param notify True to send a notification is the content changes. * * @return The unique content URL for the specified row. */ static Uri getContentUri(long id, boolean notify) { return Uri.parse("content://" + LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" + LauncherProvider.PARAMETER_NOTIFY + "=" + notify); } /** * The container holding the favorite *

Type: INTEGER

*/ static final String CONTAINER = "container"; /** * The icon is a resource identified by a package name and an integer id. */ static final int CONTAINER_DESKTOP = -100; static final int CONTAINER_HOTSEAT = -101; /** * The screen holding the favorite (if container is CONTAINER_DESKTOP) *

Type: INTEGER

*/ static final String SCREEN = "screen"; /** * The X coordinate of the cell holding the favorite * (if container is CONTAINER_HOTSEAT or CONTAINER_HOTSEAT) *

Type: INTEGER

*/ static final String CELLX = "cellX"; /** * The Y coordinate of the cell holding the favorite * (if container is CONTAINER_DESKTOP) *

Type: INTEGER

*/ static final String CELLY = "cellY"; /** * The X span of the cell holding the favorite *

Type: INTEGER

*/ static final String SPANX = "spanX"; /** * The Y span of the cell holding the favorite *

Type: INTEGER

*/ static final String SPANY = "spanY"; /** * The favorite is a user created folder */ static final int ITEM_TYPE_FOLDER = 2; /** * The favorite is a widget */ static final int ITEM_TYPE_APPWIDGET = 4; /** * The appWidgetId of the widget * *

Type: INTEGER

*/ static final String APPWIDGET_ID = "appWidgetId"; } }