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 19 import android.content.Intent; 20 import android.graphics.drawable.Drawable; 21 import android.net.Uri; 22 23 import com.android.contacts.common.Collapser; 24 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> { 30 public CharSequence getBody(); 31 public CharSequence getSubtitle(); 32 33 public String getMimeType(); 34 35 /** Returns an icon that can be clicked for the alternate action. */ 36 public Drawable getAlternateIcon(); 37 38 /** Returns the content description of the icon for the alternate action. */ 39 public String getAlternateIconDescription(); 40 41 /** Build an {@link Intent} that will perform this action. */ 42 public Intent getIntent(); 43 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. */ 48 public boolean isPrimary(); 49 50 /** Checks if the contact data for this action is super primary. */ 51 public boolean isSuperPrimary(); 52 53 /** 54 * Returns a lookup (@link Uri) for the contact data item or null if there is no data item 55 * corresponding to this row 56 */ 57 public Uri getDataUri(); 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(); 64 65 /** Returns the presence of this item or -1 if it was never set */ 66 public int getPresence(); 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(); 77 } 78