]> sjero.net Git - linphone/blobdiff - java/common/org/linphone/core/LinphoneChatMessage.java
Added GetTime method to LinphoneChatMessage java impl
[linphone] / java / common / org / linphone / core / LinphoneChatMessage.java
index 77238d27070b31ed6233d518b756b830f7c0f39f..b6b6c30ec3c59026b07041e44984b251f88802aa 100644 (file)
@@ -7,8 +7,8 @@ public interface LinphoneChatMessage {
        interface StateListener{
                void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state);
        }
-       static class State {
-               static private Vector values = new Vector();
+       public static class State {
+               static private Vector<State> values = new Vector<State>();
                private final int mValue;
                public final int value() {return mValue;}
                
@@ -47,7 +47,69 @@ public interface LinphoneChatMessage {
                public String toString() {
                        return mStringValue;
                }
+               public int toInt() {
+                       return mValue;
+               }
        }
+       
+       long getNativePtr();
+       
        Object getUserData();
+       
        void setUserData();
+       
+       /**
+        * get text associated to this LinphoneChatMessage
+        * 
+        * @return text sent along with the message
+        */
+       String getText();
+       
+       /**
+        * get peer address associated to this LinphoneChatMessage
+        *
+        * @return LinphoneAddress peer address
+        */
+       LinphoneAddress getPeerAddress();
+       
+       /**
+        * get from address associated to this LinphoneChatMessage
+        *
+        * @return LinphoneAddress from address
+        */
+       LinphoneAddress getFrom();
+       
+       /**
+        * Linphone message can carry external body as defined by rfc2017
+        * @param message #LinphoneChatMessage
+        * @return return external body url null if not present.
+        */
+       String getExternalBodyUrl();
+       
+       /**
+        * Linphone message can carry external body as defined by rfc2017
+        * @param  #LinphoneChatMessage  
+        * @param url ex: access-type=URL; URL="http://www.foo.com/file"
+        */
+       void setExternalBodyUrl(String url);
+       
+       /**
+        * Add a custom header into the message.
+        * @param name
+        * @param value
+        */
+       void addCustomHeader(String name, String value);
+       
+       /**
+        * Obtain a header value.
+        * @param name
+        * @return the value of the header, or null if not found.
+        */
+       String  getCustomHeader(String name);
+       
+       /**
+        * Gets the time at which the message was sent
+        * @return the time in milliseconds
+        */
+       long getTime();
 }