]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneCoreListener.java
cfe43895ef82ac45e897d6d1df90decb16c065c9
[linphone] / java / common / org / linphone / core / LinphoneCoreListener.java
1 /*
2 LinphoneCoreListener.java
3 Copyright (C) 2010  Belledonne Communications, Grenoble, France
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18  */
19 package org.linphone.core;
20
21
22 /**
23  * 
24  *This interface holds all callbacks that the application should implement. None is mandatory.
25  */
26 public interface LinphoneCoreListener {
27
28         /**< Notifies the application that it should show up
29          * @return */
30         void show(LinphoneCore lc);
31
32         /**< Ask the application some authentication information 
33          * @return */
34         void authInfoRequested(LinphoneCore lc,String realm,String username); 
35
36         /**< Callback that notifies various events with human readable text.
37          * @return */
38         void displayStatus(LinphoneCore lc,String message);
39
40         /**< Callback to display a message to the user 
41          * @return */
42         void displayMessage(LinphoneCore lc,String message);
43
44         /** Callback to display a warning to the user 
45          * @return */
46         void displayWarning(LinphoneCore lc,String message);
47
48         /** General State notification  
49          * @param state LinphoneCore.State
50          * @return 
51          * */           
52         void globalState(LinphoneCore lc,LinphoneCore.GlobalState state, String message);
53
54         /** Call  State notification  
55          * @param state LinphoneCall.State
56          * @return 
57          * */           
58         void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State cstate,String message);
59
60         /**
61          * Callback to display change in encryption state.
62          * @param encrypted true if all streams of the call are encrypted
63          * @param authenticationToken token like ZRTP SAS that may be displayed to user
64          */
65         void callEncryptionChanged(LinphoneCore lc, LinphoneCall call, boolean encrypted, String authenticationToken);
66
67         /**
68          * Registration state notification
69          * */
70         void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState cstate, String smessage);
71
72         /**
73          * Reports that a new subscription request has been received and wait for a decision. 
74          *Status on this subscription request is notified by changing policy for this friend
75          *@param lc LinphoneCore        
76          *@param lf LinphoneFriend corresponding to the subscriber
77          *@param url of the subscriber
78          * 
79          */
80         void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url);
81
82         /**
83          * Report status change for a friend previously added to LinphoneCore.
84          * @param lc LinphoneCore
85          * @param lf updated LinphoneFriend
86          */
87         void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);
88
89         /**
90          * invoked when a new text message is received
91          * @param lc LinphoneCore
92          * @param  room         LinphoneChatRoom involved in this conversation. Can be be created by the framework in case the from is not present in any chat room.
93          * @param from          LinphoneAddress from
94          * @param message       incoming message
95          */
96         void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message);
97
98         /**
99          * Invoked when echo cancalation calibration is completed
100          * @param lc LinphoneCore
101          * @param status 
102          * @param delay_ms echo delay
103          * @param data
104          */
105         void ecCalibrationStatus(LinphoneCore lc,LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data);
106 }
107