Monday, January 25, 2010

Introducing TelepathyQt4

So this is the beginning of a series of blog posts about TelepathyQt4. I am going to start with a basic introduction: what it is and the ideas behind it.

These blog posts are intended to explain what TelepathyQt4 is, and how to use it to write IM/VoIP/Communication applications. They are not meant to explain what Telepathy is, or what it's intended for. Please check the wiki page for a quick introduction to Telepathy.

- First: what is TelepathyQt4?

TelepathyQt4 is a convenience library, written in Qt4, for those who want to write applications that use the Telepathy framework. The idea is to have a high-level, but complete, API that hides most underlying D-Bus calls, making it easy to communicate with other applications using Telepathy.

- Why TelepathyQt4?

Up until we started writing it, there were only convenience libraries for Glib and Python, so Qt4 developers were left behind. Those who wanted to use Telepathy had to stick to those libraries or use D-Bus directly. This was limiting the usage of Telepathy across Qt/KDE applications.

- What kind of application can make use of TelepathyQt4?

Right now we have a Kopete branch (implemented as a Kopete protocol plugin) that makes use of TelepathyQt4, and an experimental krdc/krfb branch that enables sharing the desktop among IM contacts. Other applications that can use TelepathyQt4 include: * instant messaging programs * email applications that want to show contacts' presence * word processors that want to let users collaborate across the internet

- Components:

TelepathyQt4 is divided into 2 parts: the classes that are auto-generated from the spec, and the high-level API that uses the auto-generated classes internally, exposing an easy-to-use API for applications. We tried to make it as extensible as possible, so adding support for new D-Bus interfaces is quite easy.

We just hit the first milestone with the 0.2 version, which will be API/ABI compatible across the 0.2.x release cycle.The library is maintained by Collabora and any help is appreciated.

If you have interest in using/collaborating with TelepathyQt4, you can join #telepathy@freenode or #kde-telepathy@freenode for more KDE-specific questions or check the mailing list.You can also poke me (andrunko - current maintainer) or Simon (smcv - official reviewer).

Development is done in the git repository found here and releases can be found here.

In the next blog posts I will be talking about how to use it, so stay tuned.

Is this still relevant, can you write connection managers with the qt bindings now?

Do the Kopete protocols become protocol managers with the help of the qt bindings or does most of the code from Kopete get thrown away and Kopete merely becomes a wrapper for the glib connection managers because you can't write those with qt?

@Mayer Decibel is a different project that could use TelepathyQt4 if it was the case. Decibel idea was to write a so called Telepathy Account Manager (AM) and Channel Dispatcher )CD) and afaik nobody is developing it anymore. You should use MC5 (mission control 5) if you want a working Telepathy AM/CD

@Anonymous Unfortunately we don't support writing connection manager using TelepathyQt4 for now, maybe in the future we will add support for this. TelepathyQt4 as of now is a client side API, that can be used by applications wanting to communicate with CMs, etc.

As for Kopete the current experimental branch only implements a new kopete protocol plugin using telepathy. The idea is to show that using telepathy is possible. It's up to the kopete devs to decide whether they want to replace kopete protocol plugin code with telepathy or not.

Hi,I have tried to use qt to communicate through dbus with some services on maemo. It worked in some cases, but there is one problem, that I could not overcome. I can't create an array of arrays of bytes and send it as an argument when I make a call. I wan't able to do that either with glib libraries. The only one solution I found was to use python in following way:

ay = dbus.Array(byte_sequence)aay = dbus.Array([ay])

Is it possible to the same with TelepathyQt4?

I want to mention that using qtdbus module I was able to send an array of variant arrays of bytes, but I can't have this variant in the middle if I want to make that certain service work.

@headless What CM are you using? gabble supports http proxy for a long time. You just need to set the proper params to the account. Actually this is completely unrelated to TelepathyQt4, whether the CM supports feature X or Y, tp-qt4 should be able to communicate with them.

@headless I am not aware of what version of gabble (or other CM) is used in n810. What I can say is that gabble supports http proxy for a long time, and I believe it should work on the device. The thing is that it's probably not respecting the general device proxy settings, but you can overcome this by manually configuring the account to support http proxies. You can find me at #telepathy@freenode, pvt me if you want (nickname andrunko)