Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.contacts.quickcontact; |
| 18 | |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 19 | import android.content.Intent; |
| 20 | import android.graphics.drawable.Drawable; |
| 21 | import android.net.Uri; |
| 22 | |
Gary Mai | 0a49afa | 2016-12-05 15:53:58 -0800 | [diff] [blame^] | 23 | import com.android.contacts.Collapser; |
Chiao Cheng | e0b2f1e | 2012-06-12 13:07:56 -0700 | [diff] [blame] | 24 | |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 25 | /** |
| 26 | * Abstract definition of an action that could be performed, along with |
| 27 | * string description and icon. |
| 28 | */ |
| 29 | public interface Action extends Collapser.Collapsible<Action> { |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 30 | public CharSequence getBody(); |
Daniel Lehmann | edb576a | 2011-07-27 16:45:13 -0700 | [diff] [blame] | 31 | public CharSequence getSubtitle(); |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 32 | |
| 33 | public String getMimeType(); |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 34 | |
Daniel Lehmann | edb576a | 2011-07-27 16:45:13 -0700 | [diff] [blame] | 35 | /** Returns an icon that can be clicked for the alternate action. */ |
| 36 | public Drawable getAlternateIcon(); |
| 37 | |
Katherine Kuan | ee05dcd | 2011-10-05 20:18:12 -0700 | [diff] [blame] | 38 | /** Returns the content description of the icon for the alternate action. */ |
| 39 | public String getAlternateIconDescription(); |
| 40 | |
Daniel Lehmann | edb576a | 2011-07-27 16:45:13 -0700 | [diff] [blame] | 41 | /** Build an {@link Intent} that will perform this action. */ |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 42 | public Intent getIntent(); |
| 43 | |
Daniel Lehmann | edb576a | 2011-07-27 16:45:13 -0700 | [diff] [blame] | 44 | /** 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 Soulos | 1633933 | 2014-06-24 13:59:56 -0700 | [diff] [blame] | 48 | public boolean isPrimary(); |
| 49 | |
| 50 | /** Checks if the contact data for this action is super primary. */ |
| 51 | public boolean isSuperPrimary(); |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 52 | |
| 53 | /** |
Daniel Lehmann | 0f78e8b | 2010-11-24 17:32:03 -0800 | [diff] [blame] | 54 | * Returns a lookup (@link Uri) for the contact data item or null if there is no data item |
| 55 | * corresponding to this row |
Daniel Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 56 | */ |
| 57 | public Uri getDataUri(); |
Daniel Lehmann | 0f78e8b | 2010-11-24 17:32:03 -0800 | [diff] [blame] | 58 | |
| 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 Lehmann | 9daca14 | 2011-12-20 11:41:22 +0200 | [diff] [blame] | 64 | |
| 65 | /** Returns the presence of this item or -1 if it was never set */ |
| 66 | public int getPresence(); |
Paul Soulos | 1633933 | 2014-06-24 13:59:56 -0700 | [diff] [blame] | 67 | |
| 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 Lehmann | af8e386 | 2010-11-19 15:38:44 -0800 | [diff] [blame] | 77 | } |