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 @SuppressWarnings("rawtypes")
12 static private Vector values = new Vector();
13 private final int mValue;
14 public final int value() {return mValue;}
16 private final String mStringValue;
20 public final static State Idle = new State(0,"Idle");
22 * Incoming call received.
24 public final static State InProgress = new State(1,"InProgress");
26 * Outgoing call initialiazed.
28 public final static State Delivered = new State(2,"Delivered");
30 * Outgoing call in progress.
32 public final static State NotDelivered = new State(3,"NotDelivered");
34 @SuppressWarnings("unchecked")
35 private State(int value,String stringValue) {
37 values.addElement(this);
38 mStringValue=stringValue;
41 public static State fromInt(int value) {
43 for (int i=0; i<values.size();i++) {
44 State state = (State) values.elementAt(i);
45 if (state.mValue == value) return state;
47 throw new RuntimeException("state not found ["+value+"]");
49 public String toString() {