Home | History | Annotate | Download | only in quickcontact
      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     /**
     51      * Returns a lookup (@link Uri) for the contact data item or null if there is no data item
     52      * corresponding to this row
     53      */
     54     public Uri getDataUri();
     55 
     56     /**
     57      * Returns the id of the contact data item or -1 of there is no data item corresponding to this
     58      * row
     59      */
     60     public long getDataId();
     61 
     62     /** Returns the presence of this item or -1 if it was never set */
     63     public int getPresence();
     64 }
     65