blob: a99bc9ad954911a572dd8f7ede5388b1d3a0eb49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.contactsource;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
* The <tt>SourceContact</tt> is the result contact of a search in the
* source. It should be identifier by a display name, an image if available
* and a telephony string, which would allow to call this contact through the
* preferred telephony provider defined in the <tt>ContactSourceService</tt>.
*
* @author Yana Stamcheva
*/
public interface SourceContact
{
/**
* Returns the display name of this search contact. This is a user-friendly
* name that could be shown in the user interface.
*
* @return the display name of this search contact
*/
public String getDisplayName();
/**
* The key that can be used to store <tt>SourceContact</tt> ids
* where need it.
*/
public static final String DATA_ID = SourceContact.class.getName() + ".id";
/**
* Returns the parent <tt>ContactSourceService</tt> from which this contact
* came from.
* @return the parent <tt>ContactSourceService</tt> from which this contact
* came from
*/
public ContactSourceService getContactSource();
/**
* Returns the display details of this search contact. This could be any
* important information that should be shown to the user.
*
* @return the display details of the search contact
*/
public String getDisplayDetails();
/**
* Returns a list of available contact details.
* @return a list of available contact details
*/
public List<ContactDetail> getContactDetails();
/**
* Returns a list of all <tt>ContactDetail</tt>s supporting the given
* <tt>OperationSet</tt> class.
* @param operationSet the <tt>OperationSet</tt> class we're looking for
* @return a list of all <tt>ContactDetail</tt>s supporting the given
* <tt>OperationSet</tt> class
*/
public List<ContactDetail> getContactDetails(
Class<? extends OperationSet> operationSet);
/**
* Returns a list of all <tt>ContactDetail</tt>s corresponding to the given
* category.
* @param category the <tt>OperationSet</tt> class we're looking for
* @return a list of all <tt>ContactDetail</tt>s corresponding to the given
* category
*
* @throws OperationNotSupportedException if categories aren't supported
* for call history records
*/
public List<ContactDetail> getContactDetails(
ContactDetail.Category category)
throws OperationNotSupportedException;
/**
* Returns the preferred <tt>ContactDetail</tt> for a given
* <tt>OperationSet</tt> class.
* @param operationSet the <tt>OperationSet</tt> class, for which we would
* like to obtain a <tt>ContactDetail</tt>
* @return the preferred <tt>ContactDetail</tt> for a given
* <tt>OperationSet</tt> class
*/
public ContactDetail getPreferredContactDetail(
Class<? extends OperationSet> operationSet);
/**
* An image (or avatar) corresponding to this search contact. If such is
* not available this method will return null.
*
* @return the byte array of the image or null if no image is available
*/
public byte[] getImage();
/**
* Gets the user data associated with this instance and a specific key.
*
* @param key the key of the user data associated with this instance to be
* retrieved
* @return an <tt>Object</tt> which represents the value associated with
* this instance and the specified <tt>key</tt>; <tt>null</tt> if no
* association with the specified <tt>key</tt> exists in this instance
*/
public Object getData(Object key);
/**
* Sets a user-specific association in this instance in the form of a
* key-value pair. If the specified <tt>key</tt> is already associated in
* this instance with a value, the existing value is overwritten with the
* specified <tt>value</tt>.
* <p>
* The user-defined association created by this method and stored in this
* instance is not serialized by this instance and is thus only meant for
* runtime use.
* </p>
* <p>
* The storage of the user data is implementation-specific and is thus not
* guaranteed to be optimized for execution time and memory use.
* </p>
*
* @param key the key to associate in this instance with the specified value
* @param value the value to be associated in this instance with the
* specified <tt>key</tt>
*/
public void setData(Object key, Object value);
/**
* Returns the status of the source contact. And null if such information
* is not available.
* @return the PresenceStatus representing the state of this source contact.
*/
public PresenceStatus getPresenceStatus();
}
|