1 /*
2  * Copyright (c) 2016 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.ims.internal.uce.presence;
18 
19 import com.android.ims.internal.uce.common.StatusCode;
20 import com.android.ims.internal.uce.presence.PresPublishTriggerType;
21 import com.android.ims.internal.uce.presence.PresCmdStatus;
22 import com.android.ims.internal.uce.presence.PresCapInfo;
23 import com.android.ims.internal.uce.presence.PresSipResponse;
24 import com.android.ims.internal.uce.presence.PresTupleInfo;
25 import com.android.ims.internal.uce.presence.PresResInstanceInfo;
26 import com.android.ims.internal.uce.presence.PresResInfo;
27 import com.android.ims.internal.uce.presence.PresRlmiInfo;
28 
29 
30 /**
31  * IPresenceListener
32  * {@hide} */
33 interface IPresenceListener
34 {
35     /**
36      * Gets the version of the presence listener implementation.
37      * @param version, version information.
38      */
getVersionCb(in String version )39     void getVersionCb(in String version );
40 
41     /**
42      * Callback function to be invoked by the Presence service to notify the listener of service
43      * availability.
44      * @param statusCode, UCE_SUCCESS as service availability.
45      */
serviceAvailable(in StatusCode statusCode)46     void serviceAvailable(in StatusCode statusCode);
47 
48     /**
49      * Callback function to be invoked by the Presence service to notify the listener of service
50      * unavailability.
51      * @param statusCode, UCE_SUCCESS as service unAvailability.
52      */
serviceUnAvailable(in StatusCode statusCode)53     void serviceUnAvailable(in StatusCode statusCode);
54 
55     /**
56      * Callback function to be invoked by the Presence service to notify the listener to send a
57      * publish request.
58      * @param publishTrigger, Publish trigger for the network being supported.
59      */
publishTriggering(in PresPublishTriggerType publishTrigger)60     void publishTriggering(in PresPublishTriggerType publishTrigger);
61 
62     /**
63      * Callback function to be invoked to inform the client of the status of an asynchronous call.
64      * @param cmdStatus, command status of the request placed.
65      */
cmdStatus( in PresCmdStatus cmdStatus)66     void cmdStatus( in PresCmdStatus cmdStatus);
67 
68     /**
69      * Callback function to be invoked to inform the client when the response for a SIP message,
70      * such as PUBLISH or SUBSCRIBE, has been received.
71      * @param sipResponse, network response received for the request placed.
72      */
sipResponseReceived(in PresSipResponse sipResponse)73     void sipResponseReceived(in PresSipResponse sipResponse);
74 
75     /**
76      * Callback function to be invoked to inform the client when the NOTIFY message carrying a
77      * single contact's capabilities information is received.
78      * @param presentityURI, URI of the remote entity the request was placed.
79      * @param tupleInfo, array of capability information remote entity supports.
80      */
capInfoReceived(in String presentityURI, in PresTupleInfo [] tupleInfo)81     void capInfoReceived(in String presentityURI,
82                          in PresTupleInfo [] tupleInfo);
83 
84     /**
85      * Callback function to be invoked to inform the client when the NOTIFY message carrying
86      * contact's capabilities information is received.
87      * @param rlmiInfo, resource infomation received from network.
88      * @param resInfo, array of capabilities received from network for the list of  remore URI.
89      */
listCapInfoReceived(in PresRlmiInfo rlmiInfo, in PresResInfo [] resInfo)90     void listCapInfoReceived(in PresRlmiInfo rlmiInfo,
91                              in PresResInfo [] resInfo);
92 
93     /**
94      * Callback function to be invoked to inform the client when Unpublish message
95      * is sent to network.
96      */
unpublishMessageSent()97     void unpublishMessageSent();
98 
99 }