diff --git a/src/org/linphone/BootReceiver.java b/src/org/linphone/BootReceiver.java index 7a4e6f99f..097767fab 100644 --- a/src/org/linphone/BootReceiver.java +++ b/src/org/linphone/BootReceiver.java @@ -33,6 +33,6 @@ public class BootReceiver extends BroadcastReceiver { lLinphoneServiceIntent.setClass(context, LinphoneService.class); context.startService(lLinphoneServiceIntent);; } - } + } diff --git a/src/org/linphone/core/LinphoneChatRoomImpl.java b/src/org/linphone/core/LinphoneChatRoomImpl.java new file mode 100644 index 000000000..76874675d --- /dev/null +++ b/src/org/linphone/core/LinphoneChatRoomImpl.java @@ -0,0 +1,37 @@ +/* +LinphoneChatRoomImpl.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +class LinphoneChatRoomImpl implements LinphoneChatRoom { + protected final long nativePtr; + private native long getPeerAddress(long ptr); + private native void sendMessage(long ptr, String message); + + protected LinphoneChatRoomImpl(long aNativePtr) { + nativePtr = aNativePtr; + } + + public LinphoneAddress getPeerAddress() { + return new LinphoneAddressImpl(getPeerAddress(nativePtr)); + } + + public void sendMessage(String message) { + sendMessage(nativePtr,message); + } +} diff --git a/src/org/linphone/core/LinphoneFriendImpl.java b/src/org/linphone/core/LinphoneFriendImpl.java new file mode 100644 index 000000000..bae44679f --- /dev/null +++ b/src/org/linphone/core/LinphoneFriendImpl.java @@ -0,0 +1,80 @@ +/* +LinphoneFriendImpl.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +class LinphoneFriendImpl implements LinphoneFriend { + protected final long nativePtr; + private native long newLinphoneFriend(String friendUri); + private native void setAddress(long nativePtr,long friend); + private native long getAddress(long nativePtr); + private native void setIncSubscribePolicy(long nativePtr,int enumValue); + private native int getIncSubscribePolicy(long nativePtr); + private native void enableSubscribes(long nativePtr,boolean value); + private native boolean isSubscribesEnabled(long nativePtr); + private native int getStatus(long nativePtr); + private native void edit(long nativePtr); + private native void done(long nativePtr); + + private native void delete(long ptr); + boolean ownPtr = false; + protected LinphoneFriendImpl() { + nativePtr = newLinphoneFriend(null); + } + protected LinphoneFriendImpl(String friendUri) { + nativePtr = newLinphoneFriend(friendUri); + } + protected LinphoneFriendImpl(long aNativePtr) { + nativePtr = aNativePtr; + ownPtr=false; + } + protected void finalize() throws Throwable { + if (ownPtr) delete(nativePtr); + } + public void setAddress(LinphoneAddress anAddress) { + this.setAddress(nativePtr, ((LinphoneAddressImpl)anAddress).nativePtr); + + } + public LinphoneAddress getAddress() { + return new LinphoneAddressImpl(getAddress(nativePtr)); + } + public void setIncSubscribePolicy(SubscribePolicy policy) { + setIncSubscribePolicy(nativePtr,policy.mValue); + + } + public SubscribePolicy getIncSubscribePolicy() { + return SubscribePolicy.fromInt(getIncSubscribePolicy(nativePtr)) ; + } + public void enableSubscribes(boolean enable) { + enableSubscribes(nativePtr, enable); + } + public boolean isSubscribesEnabled() { + return isSubscribesEnabled(nativePtr); + } + + public OnlineStatus getStatus() { + return OnlineStatus.fromInt(getStatus(nativePtr)); + } + public void edit() { + edit(nativePtr); + } + public void done() { + done(nativePtr); + } + +}