1af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann/*
2af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * Copyright (C) 2010 The Android Open Source Project
3af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann *
4af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * Licensed under the Apache License, Version 2.0 (the "License");
5af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * you may not use this file except in compliance with the License.
6af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * You may obtain a copy of the License at
7af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann *
8af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann *      http://www.apache.org/licenses/LICENSE-2.0
9af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann *
10af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * Unless required by applicable law or agreed to in writing, software
11af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * distributed under the License is distributed on an "AS IS" BASIS,
12af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * See the License for the specific language governing permissions and
14af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * limitations under the License.
15af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann */
16af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
17af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannpackage com.android.contacts.quickcontact;
18af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
19af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannimport com.android.contacts.Collapser;
20af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
21af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannimport android.content.Intent;
22af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannimport android.graphics.drawable.Drawable;
23af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannimport android.net.Uri;
24af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
25af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann/**
26af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * Abstract definition of an action that could be performed, along with
27af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann * string description and icon.
28af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann */
29af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmannpublic interface Action extends Collapser.Collapsible<Action> {
30af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    public CharSequence getBody();
31edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    public CharSequence getSubtitle();
32af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
33af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    public String getMimeType();
34af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
35edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    /** Returns an icon that can be clicked for the alternate action. */
36edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    public Drawable getAlternateIcon();
37edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann
38ee05dcdd4b066ad909322c10919fb1812214673bKatherine Kuan    /** Returns the content description of the icon for the alternate action. */
39ee05dcdd4b066ad909322c10919fb1812214673bKatherine Kuan    public String getAlternateIconDescription();
40ee05dcdd4b066ad909322c10919fb1812214673bKatherine Kuan
41edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    /** Build an {@link Intent} that will perform this action. */
42af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    public Intent getIntent();
43af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
44edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    /** Build an {@link Intent} that will perform the alternate action. */
45edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    public Intent getAlternateIntent();
46edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann
47edb576aab33efff623691a89ace3c76cb2ff12d1Daniel Lehmann    /** Checks if the contact data for this action is primary. */
48af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    public Boolean isPrimary();
49af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann
50af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    /**
510f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann     * Returns a lookup (@link Uri) for the contact data item or null if there is no data item
520f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann     * corresponding to this row
53af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann     */
54af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann    public Uri getDataUri();
550f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann
560f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann    /**
570f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann     * Returns the id of the contact data item or -1 of there is no data item corresponding to this
580f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann     * row
590f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann     */
600f78e8b198c56963d6d6044839bb0679f4afd075Daniel Lehmann    public long getDataId();
61af8e3864a2d0131f72337165c846fe909a099e52Daniel Lehmann}
62