configure.in |2
tubes/CppunitTest_tubes_test.mk |4
tubes/Library_tubes.mk |1
tubes/inc/tubes/contact-list.hxx | 60 +
tubes/qa/test_manager.cxx| 56
tubes/source/contact-list.cxx| 169 +++
6 files changed, 291 insertions(+), 1 deletion(-)
New commits:
commit 3cd4a8e788d01e87a2e6dbc768b99668443b0839
Author: Will Thompson
Date: Wed Mar 21 11:13:04 2012 +
tubes: add API to find contacts with LibO tube support
diff --git a/configure.in b/configure.in
index af324fc..7fdabdb 100644
--- a/configure.in
+++ b/configure.in
@@ -8369,7 +8369,7 @@ AC_MSG_CHECKING([whether to enable Telepathy support])
if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" =
"yes"; then
ENABLE_TELEPATHY="TRUE"
AC_MSG_RESULT([yes])
-PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.16.4 glib-2.0
gobject-2.0 gthread-2.0 dbus-1 dbus-glib-1 )
+PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.16.4 glib-2.0
gobject-2.0 gthread-2.0 gio-2.0 dbus-1 dbus-glib-1 )
else
AC_MSG_RESULT([no])
fi
diff --git a/tubes/CppunitTest_tubes_test.mk b/tubes/CppunitTest_tubes_test.mk
index 32810f9..7b558d7 100644
--- a/tubes/CppunitTest_tubes_test.mk
+++ b/tubes/CppunitTest_tubes_test.mk
@@ -36,6 +36,10 @@ $(eval $(call gb_CppunitTest_add_linked_libs,tubes_test, \
$(gb_STDLIBS) \
))
+$(eval $(call gb_CppunitTest_add_libs,tubes_test, \
+$$(TELEPATHY_LIBS) \
+))
+
$(eval $(call gb_CppunitTest_set_include,tubes_test,\
-I$(realpath $(SRCDIR)/tubes/inc) \
$$(TELEPATHY_CFLAGS) \
diff --git a/tubes/Library_tubes.mk b/tubes/Library_tubes.mk
index 2ab2616..48ef793 100644
--- a/tubes/Library_tubes.mk
+++ b/tubes/Library_tubes.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_add_exception_objects,tubes,\
tubes/source/conference \
tubes/source/manager \
tubes/source/packet \
+ tubes/source/contact-list \
))
# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/tubes/inc/tubes/contact-list.hxx b/tubes/inc/tubes/contact-list.hxx
new file mode 100644
index 000..bf1e0f7
--- /dev/null
+++ b/tubes/inc/tubes/contact-list.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_TUBES_CONTACT_LIST_HXX
+#define INCLUDED_TUBES_CONTACT_LIST_HXX
+
+#include
+#include
+
+#include
+
+#include "tubes/tubesdllapi.h"
+
+typedef ::std::pair< TpAccount *, TpContact * > AccountContactPair;
+typedef ::std::vector< AccountContactPair > AccountContactPairV;
+
+class TUBES_DLLPUBLIC ContactList
+{
+public:
+ContactList();
+~ContactList();
+
+typedef void (*PrepareCallback)( GError *errorOr0, void *user_data );
+voidprepare( PrepareCallback callback, void *user_data
);
+
+AccountContactPairV getContacts();
+
+private:
+TpAccountManager* mpAccountManager;
+
+};
+
+#endif // INCLUDED_TUBES_CONTACT_LIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index 07dd264..f017a9c 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -28,6 +28,7 @@
#include
+#include
#include
#include
@@ -45,6 +46,7 @@ public:
TestTeleTubes();
~TestTeleTubes();
+void testContactList();
void testSetupManager1();
void testSetupManager2();
void testConnect1();
@@ -60,8 +62,11 @@ public:
void testDestroyManager2();
void testFailAlways();
+GMainLoop* mpMainLoop;
+
// Order is significant.
CPPUNIT_TEST_SUITE( TestTeleTubes );
+CPPUNIT_TEST( testContactList );
CPPUNIT_TEST( testSetupManager1 );
CPPUNIT_TEST( testSetupManager2 );
CPPUNIT_TEST( testConnect1 );
@@ -103,6 +108,57 @@ TestTeleTubes::~TestTeleTubes