create changelog entry
[debian/openrocket] / android-libraries / ActionBarSherlock / src / com / actionbarsherlock / view / SubMenu.java
1 /*
2  * Copyright (C) 2007 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 com.actionbarsherlock.view;
18
19 import android.graphics.drawable.Drawable;
20 import android.view.View;
21
22 /**
23  * Subclass of {@link Menu} for sub menus.
24  * <p>
25  * Sub menus do not support item icons, or nested sub menus.
26  *
27  * <div class="special reference">
28  * <h3>Developer Guides</h3>
29  * <p>For information about creating menus, read the
30  * <a href="{@docRoot}guide/topics/ui/menus.html">Menus</a> developer guide.</p>
31  * </div>
32  */
33
34 public interface SubMenu extends Menu {
35     /**
36      * Sets the submenu header's title to the title given in <var>titleRes</var>
37      * resource identifier.
38      *
39      * @param titleRes The string resource identifier used for the title.
40      * @return This SubMenu so additional setters can be called.
41      */
42     public SubMenu setHeaderTitle(int titleRes);
43
44     /**
45      * Sets the submenu header's title to the title given in <var>title</var>.
46      *
47      * @param title The character sequence used for the title.
48      * @return This SubMenu so additional setters can be called.
49      */
50     public SubMenu setHeaderTitle(CharSequence title);
51
52     /**
53      * Sets the submenu header's icon to the icon given in <var>iconRes</var>
54      * resource id.
55      *
56      * @param iconRes The resource identifier used for the icon.
57      * @return This SubMenu so additional setters can be called.
58      */
59     public SubMenu setHeaderIcon(int iconRes);
60
61     /**
62      * Sets the submenu header's icon to the icon given in <var>icon</var>
63      * {@link Drawable}.
64      *
65      * @param icon The {@link Drawable} used for the icon.
66      * @return This SubMenu so additional setters can be called.
67      */
68     public SubMenu setHeaderIcon(Drawable icon);
69
70     /**
71      * Sets the header of the submenu to the {@link View} given in
72      * <var>view</var>. This replaces the header title and icon (and those
73      * replace this).
74      *
75      * @param view The {@link View} used for the header.
76      * @return This SubMenu so additional setters can be called.
77      */
78     public SubMenu setHeaderView(View view);
79
80     /**
81      * Clears the header of the submenu.
82      */
83     public void clearHeader();
84
85     /**
86      * Change the icon associated with this submenu's item in its parent menu.
87      *
88      * @see MenuItem#setIcon(int)
89      * @param iconRes The new icon (as a resource ID) to be displayed.
90      * @return This SubMenu so additional setters can be called.
91      */
92     public SubMenu setIcon(int iconRes);
93
94     /**
95      * Change the icon associated with this submenu's item in its parent menu.
96      *
97      * @see MenuItem#setIcon(Drawable)
98      * @param icon The new icon (as a Drawable) to be displayed.
99      * @return This SubMenu so additional setters can be called.
100      */
101     public SubMenu setIcon(Drawable icon);
102
103     /**
104      * Gets the {@link MenuItem} that represents this submenu in the parent
105      * menu.  Use this for setting additional item attributes.
106      *
107      * @return The {@link MenuItem} that launches the submenu when invoked.
108      */
109     public MenuItem getItem();
110 }