]> sjero.net Git - linphone/commitdiff
forgot to commit a file
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 5 Sep 2012 12:19:50 +0000 (14:19 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 5 Sep 2012 12:19:50 +0000 (14:19 +0200)
java/common/org/linphone/core/LinphoneChatMessage.java [new file with mode: 0644]

diff --git a/java/common/org/linphone/core/LinphoneChatMessage.java b/java/common/org/linphone/core/LinphoneChatMessage.java
new file mode 100644 (file)
index 0000000..77238d2
--- /dev/null
@@ -0,0 +1,53 @@
+package org.linphone.core;
+
+import java.util.Vector;
+
+
+public interface LinphoneChatMessage {
+       interface StateListener{
+               void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state);
+       }
+       static class State {
+               static private Vector values = new Vector();
+               private final int mValue;
+               public final int value() {return mValue;}
+               
+               private final String mStringValue;
+               /**
+                * Idle
+                */
+               public final static State Idle = new State(0,"Idle");
+               /**
+                * Incoming call received.
+                */
+               public final static State InProgress = new State(1,"InProgress");
+               /**
+                * Outgoing call initialiazed.
+                */
+               public final static State Delivered = new State(2,"Delivered");
+               /**
+                * Outgoing call in progress. 
+                */
+               public final static State NotDelivered = new State(3,"NotDelivered");
+               
+               private State(int value,String stringValue) {
+                       mValue = value;
+                       values.addElement(this);
+                       mStringValue=stringValue;
+               }
+               
+               public static State fromInt(int value) {
+
+                       for (int i=0; i<values.size();i++) {
+                               State state = (State) values.elementAt(i);
+                               if (state.mValue == value) return state;
+                       }
+                       throw new RuntimeException("state not found ["+value+"]");
+               }
+               public String toString() {
+                       return mStringValue;
+               }
+       }
+       Object getUserData();
+       void setUserData();
+}