/soc/2012/michael/android: 2628902dc26f: Added most important ge...

Michael Zangl michael at soc.pidgin.im
Sat Jul 7 03:34:26 EDT 2012


Changeset: 2628902dc26fe31b8ad018f7887ab42f431d7ff3
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2012-06-30 17:13 +0200
Branch:	 soc.2012.android
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/2628902dc26f

Description:

Added most important getters for Blist nodes with jni function calls.

diffstat:

 android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistGroup.java |   6 +
 android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java  |  32 ++++++++++
 android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java    |   6 +
 android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java      |  26 ++++++++
 4 files changed, 70 insertions(+), 0 deletions(-)

diffs (115 lines):

diff --git a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistGroup.java b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistGroup.java
--- a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistGroup.java
+++ b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistGroup.java
@@ -8,4 +8,10 @@
 		super(nativePointer, manager);
 	}
 
+	public String getName() {
+		return getName_native();
+	}
+
+	private native String getName_native();
+
 }
diff --git a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java
--- a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java
+++ b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java
@@ -25,6 +25,8 @@
 			return new PurpleBuddy(nativePointer, manager);
 		case BlistConstants.PURPLE_BLIST_CONTACT_NODE:
 			return new PurpleContact(nativePointer, manager);
+		case BlistConstants.PURPLE_BLIST_GROUP_NODE:
+			return new PurpleBlistGroup(nativePointer, manager);
 
 		default:
 			return new PurpleBlistNode(nativePointer, manager);
@@ -32,4 +34,34 @@
 	}
 
 	private static native int getTypeFor_native(long nativePointer);
+
+	private PurpleBlistNode getNode(long nativePointer) {
+		// TODO: Cache java objects
+		return constructNode(nativePointer, getManager());
+	}
+
+	public PurpleBlistNode getNext() {
+		return getNode(getNext_native());
+	}
+
+	private native long getNext_native();
+
+	public PurpleBlistNode getPrevious() {
+		return getNode(getPrevious_native());
+	}
+
+	private native long getPrevious_native();
+
+	public PurpleBlistNode getParent() {
+		return getNode(getParent_native());
+	}
+
+	private native long getParent_native();
+
+	public PurpleBlistNode getFirstChild() {
+		return getNode(getFirstChild_native());
+	}
+
+	private native long getFirstChild_native();
+
 }
diff --git a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java
--- a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java
+++ b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java
@@ -8,4 +8,10 @@
 		super(nativePointer, manager);
 	}
 
+	public String getAlias() {
+		return getAlias_native();
+	}
+
+	private native String getAlias_native();
+
 }
diff --git a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java
--- a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java
+++ b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java
@@ -1,5 +1,6 @@
 package im.pidgin.libpurple.buddy;
 
+import im.pidgin.libpurple.account.PurpleAccount;
 import im.pidgin.libpurple.blist.PurpleBlistNode;
 import im.pidgin.libpurple.core.CoreManager;
 
@@ -9,4 +10,29 @@
 		super(nativePointer, manager);
 	}
 
+	public String getName() {
+		return getName_native();
+	}
+
+	private native String getName_native();
+
+	public String getAlias() {
+		return getAlias_native();
+	}
+
+	private native String getAlias_native();
+
+	public String getServerAlias() {
+		return getServerAlias_native();
+	}
+
+	private native String getServerAlias_native();
+
+	public PurpleAccount getAccount() {
+		return getAccount_native();
+	}
+
+	private native PurpleAccount getAccount_native();
+
+	
 }



More information about the Commits mailing list