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 import com.android.contacts.Collapser; 23 24 /** 25 * Abstract definition of an action that could be performed, along with 26 * string description and icon. 27 */ 28 public interface Action extends Collapser.Collapsible<Action> { getBody()29 public CharSequence getBody(); getSubtitle()30 public CharSequence getSubtitle(); 31 getMimeType()32 public String getMimeType(); 33 34 /** Returns an icon that can be clicked for the alternate action. */ getAlternateIcon()35 public Drawable getAlternateIcon(); 36 37 /** Returns the content description of the icon for the alternate action. */ getAlternateIconDescription()38 public String getAlternateIconDescription(); 39 40 /** Build an {@link Intent} that will perform this action. */ getIntent()41 public Intent getIntent(); 42 43 /** Build an {@link Intent} that will perform the alternate action. */ getAlternateIntent()44 public Intent getAlternateIntent(); 45 46 /** Checks if the contact data for this action is primary. */ isPrimary()47 public boolean isPrimary(); 48 49 /** Checks if the contact data for this action is super primary. */ isSuperPrimary()50 public boolean isSuperPrimary(); 51 52 /** 53 * Returns a lookup (@link Uri) for the contact data item or null if there is no data item 54 * corresponding to this row 55 */ getDataUri()56 public Uri getDataUri(); 57 58 /** 59 * Returns the id of the contact data item or -1 of there is no data item corresponding to this 60 * row 61 */ getDataId()62 public long getDataId(); 63 64 /** Returns the presence of this item or -1 if it was never set */ getPresence()65 public int getPresence(); 66 } 67