1 package org.linphone.core;
3 import java.util.Vector;
6 public interface LinphoneChatMessage {
7 interface StateListener{
8 void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state);
11 static private Vector values = new Vector();
12 private final int mValue;
13 public final int value() {return mValue;}
15 private final String mStringValue;
19 public final static State Idle = new State(0,"Idle");
21 * Incoming call received.
23 public final static State InProgress = new State(1,"InProgress");
25 * Outgoing call initialiazed.
27 public final static State Delivered = new State(2,"Delivered");
29 * Outgoing call in progress.
31 public final static State NotDelivered = new State(3,"NotDelivered");
33 private State(int value,String stringValue) {
35 values.addElement(this);
36 mStringValue=stringValue;
39 public static State fromInt(int value) {
41 for (int i=0; i<values.size();i++) {
42 State state = (State) values.elementAt(i);
43 if (state.mValue == value) return state;
45 throw new RuntimeException("state not found ["+value+"]");
47 public String toString() {