1/*
2 * Copyright (C) 2011 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.internal.appwidget;
18
19import android.content.ComponentName;
20import android.content.Intent;
21import android.appwidget.AppWidgetProviderInfo;
22import com.android.internal.appwidget.IAppWidgetHost;
23import android.os.IBinder;
24import android.widget.RemoteViews;
25
26/** {@hide} */
27interface IAppWidgetService {
28
29    //
30    // for AppWidgetHost
31    //
32    int[] startListening(IAppWidgetHost host, String packageName, int hostId,
33            out List<RemoteViews> updatedViews);
34    void stopListening(int hostId);
35    int allocateAppWidgetId(String packageName, int hostId);
36    void deleteAppWidgetId(int appWidgetId);
37    void deleteHost(int hostId);
38    void deleteAllHosts();
39    RemoteViews getAppWidgetViews(int appWidgetId);
40
41    //
42    // for AppWidgetManager
43    //
44    void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views);
45    void partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views);
46    void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views);
47    void notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId);
48    List<AppWidgetProviderInfo> getInstalledProviders();
49    AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId);
50    void bindAppWidgetId(int appWidgetId, in ComponentName provider);
51    void bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection);
52    void unbindRemoteViewsService(int appWidgetId, in Intent intent);
53    int[] getAppWidgetIds(in ComponentName provider);
54
55}
56
57