1 /*
2  * Copyright (C) 2013 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.ex.chips.recipientchip;
18 
19 import com.android.ex.chips.RecipientEntry;
20 
21 /**
22  * BaseRecipientChip defines an object that contains information relevant to a
23  * particular recipient.
24  */
25 interface BaseRecipientChip {
26 
27     /**
28      * Set the selected state of the chip.
29      */
setSelected(boolean selected)30     void setSelected(boolean selected);
31 
32     /**
33      * Return true if the chip is selected.
34      */
isSelected()35     boolean isSelected();
36 
37     /**
38      * Get the text displayed in the chip.
39      */
getDisplay()40     CharSequence getDisplay();
41 
42     /**
43      * Get the text value this chip represents.
44      */
getValue()45     CharSequence getValue();
46 
47     /**
48      * Get the id of the contact associated with this chip.
49      */
getContactId()50     long getContactId();
51 
52     /**
53      * Get the directory id of the contact associated with this chip.
54      */
getDirectoryId()55     Long getDirectoryId();
56 
57     /**
58      * Get the directory lookup key associated with this chip, or <code>null</code>.
59      */
getLookupKey()60     String getLookupKey();
61 
62     /**
63      * Get the id of the data associated with this chip.
64      */
getDataId()65     long getDataId();
66 
67     /**
68      * Get associated RecipientEntry.
69      */
getEntry()70     RecipientEntry getEntry();
71 
72     /**
73      * Set the text in the edittextview originally associated with this chip
74      * before any reverse lookups.
75      */
setOriginalText(String text)76     void setOriginalText(String text);
77 
78     /**
79      * Set the text in the edittextview originally associated with this chip
80      * before any reverse lookups.
81      */
getOriginalText()82     CharSequence getOriginalText();
83 }
84