195a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira/* 2194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy * Copyright (C) 2013 The Android Open Source Project 395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * 495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Licensed under the Apache License, Version 2.0 (the "License"); 595a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * you may not use this file except in compliance with the License. 695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * You may obtain a copy of the License at 795a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * 895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * http://www.apache.org/licenses/LICENSE-2.0 995a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * 1095a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Unless required by applicable law or agreed to in writing, software 1195a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * distributed under the License is distributed on an "AS IS" BASIS, 1295a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * See the License for the specific language governing permissions and 1495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * limitations under the License. 1595a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 1695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 17194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedypackage com.android.ex.chips.recipientchip; 1895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 19194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedyimport com.android.ex.chips.RecipientEntry; 2095a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 2195a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira/** 22194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy * BaseRecipientChip defines an object that contains information relevant to a 2395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * particular recipient. 2495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 25194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedyinterface BaseRecipientChip { 2695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 2795a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 2895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Set the selected state of the chip. 2995a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 30194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy void setSelected(boolean selected); 31194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy 3295a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 3395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Return true if the chip is selected. 3495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 35194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy boolean isSelected(); 3695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 3795a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 3895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Get the text displayed in the chip. 3995a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 40194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy CharSequence getDisplay(); 4195a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 4295a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 4395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Get the text value this chip represents. 4495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 45194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy CharSequence getValue(); 4695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 4795a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 4895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Get the id of the contact associated with this chip. 4995a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 50194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy long getContactId(); 5195a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 5295a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 537a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy * Get the directory id of the contact associated with this chip. 547a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy */ 557a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy Long getDirectoryId(); 567a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy 577a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy /** 587a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy * Get the directory lookup key associated with this chip, or <code>null</code>. 597a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy */ 607a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy String getLookupKey(); 617a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy 627a4e67708498ec46c2e9b3bad69d3807d88c064eScott Kennedy /** 6395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Get the id of the data associated with this chip. 6495a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 65194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy long getDataId(); 6695a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira 6795a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira /** 6895a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira * Get associated RecipientEntry. 6995a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira */ 70194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy RecipientEntry getEntry(); 716a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp 726a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp /** 736a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp * Set the text in the edittextview originally associated with this chip 746a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp * before any reverse lookups. 756a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp */ 76194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy void setOriginalText(String text); 77e1bfc9218326c02ff51985dcb22ee9b0ae385807Mindy Pereira 786a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp /** 796a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp * Set the text in the edittextview originally associated with this chip 806a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp * before any reverse lookups. 816a8c8d837e53897f19539e0c2455e3d5fc579b5emindyp */ 82194d427ebcfc2133bda410e0e4c399250d9a6066Scott Kennedy CharSequence getOriginalText(); 8395a692517516f6cdcd77dd13582e679dd59fcef7Mindy Pereira} 84