1 /*
2  * Copyright (C) 2014 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 
17 package android.appwidget.cts.provider;
18 
19 import android.appwidget.AppWidgetManager;
20 import android.appwidget.AppWidgetProvider;
21 import android.content.Context;
22 import android.os.Bundle;
23 
24 public abstract class AppWidgetProviderCallbacks {
25 
26     private AppWidgetProvider mProvider;
27 
getProvider()28     public final AppWidgetProvider getProvider() {
29         return mProvider;
30     }
31 
setProvider(AppWidgetProvider provider)32     public final void setProvider(AppWidgetProvider provider) {
33         mProvider = provider;
34     }
35 
onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)36     public abstract void onUpdate(Context context, AppWidgetManager appWidgetManager,
37              int[] appWidgetIds);
38 
onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions)39     public abstract void onAppWidgetOptionsChanged(Context context,
40             AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions);
41 
onDeleted(Context context, int[] appWidgetIds)42     public abstract void onDeleted(Context context, int[] appWidgetIds);
43 
onEnabled(Context context)44     public abstract void onEnabled(Context context);
45 
onDisabled(Context context)46     public abstract void onDisabled(Context context);
47 
onRestored(Context context, int[] oldWidgetIds, int[] newWidgetIds)48     public abstract void onRestored(Context context, int[] oldWidgetIds, int[] newWidgetIds);
49 }
50