blob: 7d7e852d9814312bbab610183dabcfa9a57bd054 [file] [log] [blame]
Daniel Lehmannaf8e3862010-11-19 15:38:44 -08001/*
2 * Copyright (C) 2010 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.contacts.quickcontact;
18
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080019import android.content.Intent;
20import android.graphics.drawable.Drawable;
21import android.net.Uri;
22
Gary Mai0a49afa2016-12-05 15:53:58 -080023import com.android.contacts.Collapser;
Chiao Chenge0b2f1e2012-06-12 13:07:56 -070024
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080025/**
26 * Abstract definition of an action that could be performed, along with
27 * string description and icon.
28 */
29public interface Action extends Collapser.Collapsible<Action> {
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080030 public CharSequence getBody();
Daniel Lehmannedb576a2011-07-27 16:45:13 -070031 public CharSequence getSubtitle();
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080032
33 public String getMimeType();
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080034
Daniel Lehmannedb576a2011-07-27 16:45:13 -070035 /** Returns an icon that can be clicked for the alternate action. */
36 public Drawable getAlternateIcon();
37
Katherine Kuanee05dcd2011-10-05 20:18:12 -070038 /** Returns the content description of the icon for the alternate action. */
39 public String getAlternateIconDescription();
40
Daniel Lehmannedb576a2011-07-27 16:45:13 -070041 /** Build an {@link Intent} that will perform this action. */
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080042 public Intent getIntent();
43
Daniel Lehmannedb576a2011-07-27 16:45:13 -070044 /** Build an {@link Intent} that will perform the alternate action. */
45 public Intent getAlternateIntent();
46
47 /** Checks if the contact data for this action is primary. */
Paul Soulos16339332014-06-24 13:59:56 -070048 public boolean isPrimary();
49
50 /** Checks if the contact data for this action is super primary. */
51 public boolean isSuperPrimary();
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080052
53 /**
Daniel Lehmann0f78e8b2010-11-24 17:32:03 -080054 * Returns a lookup (@link Uri) for the contact data item or null if there is no data item
55 * corresponding to this row
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080056 */
57 public Uri getDataUri();
Daniel Lehmann0f78e8b2010-11-24 17:32:03 -080058
59 /**
60 * Returns the id of the contact data item or -1 of there is no data item corresponding to this
61 * row
62 */
63 public long getDataId();
Daniel Lehmann9daca142011-12-20 11:41:22 +020064
65 /** Returns the presence of this item or -1 if it was never set */
66 public int getPresence();
Paul Soulos16339332014-06-24 13:59:56 -070067
68 /**
69 * Returns the number of times this action has been used.
70 */
71 public Integer getTimesUsed();
72
73 /**
74 * Returns the last time this action was used.
75 */
76 public Long getLastTimeUsed();
Daniel Lehmannaf8e3862010-11-19 15:38:44 -080077}