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 package com.android.contacts.list;
17 
18 import android.net.Uri;
19 
20 /**
21  * Action callbacks that can be sent by a contact list.
22  */
23 public interface OnContactBrowserActionListener  {
24 
25     /**
26      * Notification of selection change, invoked when the selection of activated
27      * item(s) is change by either a user action or some other event, e.g. sync.
28      */
onSelectionChange()29     void onSelectionChange();
30 
31     /**
32      * Opens the specified contact for viewing.
33      *
34      * @param position The index of the contact that should be opened
35      * @param contactLookupUri The lookup-uri of the contact that should be opened
36      */
onViewContactAction(int position, Uri contactLookupUri, boolean isEnterpriseContact)37     void onViewContactAction(int position, Uri contactLookupUri, boolean isEnterpriseContact);
38 
39     /**
40      * Initiates the contact deletion process.
41      */
onDeleteContactAction(Uri contactUri)42     void onDeleteContactAction(Uri contactUri);
43 
44     /**
45      * Closes the contact browser.
46      */
onFinishAction()47     void onFinishAction();
48 
49     /**
50      * Invoked if the requested selected contact is not found in the list.
51      */
onInvalidSelection()52     void onInvalidSelection();
53 }
54