a340a4291fff8b5b2996166d4930e07e1a02eb40
[pub/Android/ownCloud.git] / actionbarsherlock / src / com / actionbarsherlock / view / Window.java
1 /*
2 * Copyright (C) 2006 The Android Open Source Project
3 * Copyright (C) 2011 Jake Wharton
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 package com.actionbarsherlock.view;
19
20 import android.content.Context;
21
22 /**
23 * <p>Abstract base class for a top-level window look and behavior policy. An
24 * instance of this class should be used as the top-level view added to the
25 * window manager. It provides standard UI policies such as a background, title
26 * area, default key processing, etc.</p>
27 *
28 * <p>The only existing implementation of this abstract class is
29 * android.policy.PhoneWindow, which you should instantiate when needing a
30 * Window. Eventually that class will be refactored and a factory method added
31 * for creating Window instances without knowing about a particular
32 * implementation.</p>
33 */
34 public abstract class Window extends android.view.Window {
35 public static final long FEATURE_ACTION_BAR = android.view.Window.FEATURE_ACTION_BAR;
36 public static final long FEATURE_ACTION_BAR_OVERLAY = android.view.Window.FEATURE_ACTION_BAR_OVERLAY;
37 public static final long FEATURE_ACTION_MODE_OVERLAY = android.view.Window.FEATURE_ACTION_MODE_OVERLAY;
38 public static final long FEATURE_NO_TITLE = android.view.Window.FEATURE_NO_TITLE;
39 public static final long FEATURE_PROGRESS = android.view.Window.FEATURE_PROGRESS;
40 public static final long FEATURE_INDETERMINATE_PROGRESS = android.view.Window.FEATURE_INDETERMINATE_PROGRESS;
41
42 /**
43 * Create a new instance for a context.
44 *
45 * @param context Context.
46 */
47 private Window(Context context) {
48 super(context);
49 }
50
51
52 public interface Callback {
53 /**
54 * Called when a panel's menu item has been selected by the user.
55 *
56 * @param featureId The panel that the menu is in.
57 * @param item The menu item that was selected.
58 *
59 * @return boolean Return true to finish processing of selection, or
60 * false to perform the normal menu handling (calling its
61 * Runnable or sending a Message to its target Handler).
62 */
63 public boolean onMenuItemSelected(int featureId, MenuItem item);
64 }
65 }