Monday, March 26, 2007

Jabber client example in KDE/QT

This is a small client I developed for educational purposes on top of KDE and gloox (for simplicity) in C++.

Basic ideas:

  • Jabber data processing needs a loop and/or an event handler (depending on architecture). Most graphical systems will also need one, this can cause problems. In this example, we used QT's idle processing feature, which called a single cycle of Gloox's message processing. A kgloox wrapper class was written for this.

  • In case writing a client application (not a bot or likesome), we need to connect conversations to windows. Most users feel comfortable that they have one window for each contact (or at least, each resource). Because of incoming messages, we'll need a mapping of contact -> window, and also a window->contact mapping. Although the second one could be stored in the window class itself in some environments, the first one will definitely need some window manager object. Some would argue that it's just a matter of observer pattern, but I'd say that it's easier to implement this way, because of contact we haven't opened a window for yet.

  • In most of the time, we need to subscribe to specific kind of messages, like messages of specific type (message/presence), of specific origin (given user), or specific namespace (feature query). It's a good idea to have some general handling pattern of such - like, observer pattern, signal-slot mechanisms, or packet catchers/interceptors. It's also a good idea to make it either hierarchical or precisely catcheable (like a PresenceProcessor class catches all <Presence/> stanzas coming from a JabberConnection class, then individual viewports could catch for a specific user, ie. when a window is open with a given contact, it's a good feature that you could see when the contact goes away.)

  • It's good to have separate layers of application: not all the components would be responsible, for example, processing of Jabber XML streams, nor all the layers have a hardwired reference of UI.



You can download the KDE source here.



Requirements for build:



It was coded with kdevelop because it's easier to write it in an IDE, it's c++, not javascript... ;)

Screenshots


28 comments:

aiyipianni said...

Aston Villa rode their luck at Hull City where an 88-minute own goal from Kamil Zayatte saw them leapfrog three points clear of Arsenal and into fourth place in the Premier League wow gold with a 1-0 win.

Villa had to survive Hull penalty appeals for a handball against Ashley Young in time added on, television replays showing that referee Steve Bennett wow gold correctly rejected the claims after consulting a linesman.

Bennett had been involved in controversy after just five minutes when American goalkeeper Brad Friedel looked to have handed Hull the initiative and threaten Villa's return to the Champions League qualifying wow gold zone.

Friedel spilled wow gold the ball under pressure from Nick Barmby and stand-in right-back Nigel Reo-Coker turned it into his own net as he attempted to wow gold clear.

But Bennett cut short wow gold celebrations at the KC Stadium -- and let Friedel off the hook -- when he ruled out the score for an apparent infringement by Barmby.

Zayatte's intervention from a Young cross bound for wow gold Gabriel Agbonlahor then saw Villa leapfrog Arsenal and draw level with Manchester United on 38 points -- seven adrift of leaders Liverpool and four wow gold behind Chelsea.

Stung by an on-pitch dressing down wow gold by manager Phil Brown at Manchester City last week, Hull showed five changes and a vastly improved performance.

Promoted Hull were looking for only their second win in 11 games while wow gold Villa arrived unbeaten in seven and it looked to be heading for a goalless draw when the home side suffered a cruel late blow.

aiyipianni said...

Premier League leaders Liverpool thrrew their "full support" world of warcraft gold behind Steven Gerrard after their captain was charged with assault on Tuesday following an incident at a local nightclub.

Gerrard, 28, and two other men were charged with assault occasioning bodily harm and affray, Merseyside police said.

They are scheduled to world of warcraft gold appear in court on January 23.

In the wake of the charges, Liverpool issued a wow power leveling statement on their official Web site.

"Steven has been an outstanding servant to world of warcraft gold Liverpool for the last ten years and the club will give him all the support he needs at this time," it read.

The offenses with which Gerrard have been charged carry cheap wow gold a maximum penalty of five years in prison.

Three other men, who were also arrested, were world of warcraft gold released without charge pending further inquiries.

Gerrard was arrested cheap wow gold in the early hours of Monday morning and eventually charged after over 20 hours in police custody.

His wife Alex Curran was seen near the police station where world of warcraft gold he was held but drove off without talking to reporters.

Gerrard had been celebrating his side's 5-1 buy wow gold win over Newcastle on Sunday when the alleged altercation occurred.

He had scored two goals in the victory at St James' Park which left world of warcraft gold Liverpool top of the English Premier League and on course for their first English title in 18 years.

He was released on bail to wow power leveling appear in court on January 23 with John Doran, 29, and Ian Smith, 19, who were charged with the same offenses.

Gerrard, who has spent his entire career with Liverpool, world of warcraft gold is one of the most celebrated players in the club's history and renowned as a model professional.

In 2005 he lifted the European Cup -- Liverpool's fifth -- wow gold kaufen after a thrilling penalty shooting victory over AC Milan and turned down the advances of cash-rich Chelsea to stay with his local club.

The midfielder has also made 70 appearances for England, dofus kamas captaining his country on four occasions.

He was made an Member of the British Empire (MBE) last year and received an honorary fellowship from Liverpool's John Moores University.

Liverpool's next match is against Preston in the kamas dofusEnglish FA Cup on Saturday, a game Gerrard was due to sit out because of suspension

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
big boobs

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
http://bigboobs.cc2cc.com/

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
boobies

mcmature said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
Reseller Hosting

ryan said...

the red hands look sharp and charismatically spooky against the black.
http://www.watchestoo.com
SWISS ROLEX DAYTONA 116509A
SWISS ROLEX DAYTONA 116509E
SWISS ROLEX DAYTONA 116523C
SWISS ROLEX EXPLORER II 16570A
SWISS ROLEX EXPLORER II 16570C
SWISS ROLEX GMT-MASTER
SWISS ROLEX GMT-MASTER
SWISS ROLEX SUBMARINER 14060
SWISS ROLEX SUBMARINER 14060M
SWISS ROLEX SUBMARINER 16600
SWISS ROLEX SUBMARINER 5513A
SWISS ROLEX SUBMARINER DATE 16610LV
SWISS ROLEX SUBMARINER DATE 16610

gethqnet said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
big boobs

walkintub said...

That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
I bookmarked it into my facebook and digg and share the good stuff with my friends too,Keep up work.Is there more aspect about this subject?I am looking forward to seeing it.

walk in tub|walk in tubs|
walk in baths|walk in bathtubs

longge said...

What is Breitling? Do you know Breitling Watches? Buy these Breitling Watches sale on line.More cheap Breitling Watches for sale! 小强测试

kobe123456 said...

Buffalo Bills jerseys
Buffalo Bills apparel
Buffalo Bills shirts
Jimmy Choo shoes
Chanel Shoes
YSL Shoes
air jordan shoes sale
michael jordan shoes sale
micheal jordan shoes
free shipping wholesale jordan shoes
RL Classic-Fit Polos Men's
RL long sleeve polos Men's
RL Solid Polo Shirts Men's

longge said...

If you want to adorn your handbag collection and you do not have even a single piece of louis vuitton wallets , then your handbag collection is definitely incomplete and dull. If you are interesting in enhancing the beauty of your purse collection, then you should have at last few pieces of louis vuitton wallet . Every time louis vuitton replica handbags comes up with its new collection, women go crazy and just want to have each and every bag.

shoppingugg said...

ED clothing was inspired by the man who also gave the line hardy shirt name, the legendary tattoo artist, ED Hardy Shoes . Known as "the godfather of modern tattoo" in many tattoo circles, ED Hardy Shoes blend of Japanese and American styles is highly sought after around the world.

The Breitling Watches is part of the Breitling Aeromarine series. There are several variations of this timepiece to include highly customized versions. While the physical design each watch differs, there are several mechanical specifications that are common in all variations in Breitling Windrider series. These Bentley 6.75 specifications include: super quartz movement, a uni-directional bezel and a sapphire crystal.

When you buy women's Christian Louboutin , not only are you getting to wear the same shoes as your favorite celebrity, you are also getting a pair of Christian Louboutin Pumps that will last longer and look better than almost any other shoes you have ever bought. Christian Louboutin Boots are a particular favorite with celebrities such as Victoria Beckham and Kate Moss, and they can both be seen sporting the latest designs to come from that particular design house - but even with a discount you would need to save for quite a while for Christian Louboutin Sandals .

Carmina said...

thanks for this example in KDE/QT I have heard of it, but only descriptions not something like this, thanks! I will show you an example of Sildenafil when I got it done!

Evichen said...

ugg ultimate combines fashion with function to create a
great comfortable ugg bailey.
With corset-style lacing up the back the UGG sundance offers
comfort and durability with twin-faced sheepskin and a molded rubber outsole for traction and a suede heel guard.

Emma jacob said...

I adore your blog because I never know about Handwriting expert what I am getting into when I open a new post. You do a great Job, regarding Handwriting analyst Quality content always have a dash of personal life and my next task I collect some more info about Handwriting analysis .Any how Keep up the great blogging and! Good luck with your new project--I hope everything works out for you! Happy 2011 :).
Forged documents | Forgery

admin said...

Hey - good blog, simply wanting around some blogs, appears a reasonably nice platform you might be using. I’m presently utilizing WordPress for just a few of my sites however seeking to change considered one of them over to a platform similar to yours as a trial run. Something in particular you'll advocate about it?
genital wart treatment

Allen Smith said...

Good submit with some useful data! Can’t say I completely agree with all that you've got advised right here, however there are a great quantity of necessary data you could have highlighted that can be very helpful on canine coaching and related topics. Please continue offering extra suggestions on this matter and related subjects, as there are lots of on the market like me who're trying to get to know the ups and downs.
acid reflux remedies
blemish treatment
cholesterol lowering foods

Allen Smith said...

Good submit with some useful data! Can’t say I completely agree with all that you've got advised right here, however there are a great quantity of necessary data you could have highlighted that can be very helpful on canine coaching and related topics. Please continue offering extra suggestions on this matter and related subjects, as there are lots of on the market like me who're trying to get to know the ups and downs.
constipation remedies
excessive sweating treatment
how to get rid of cellulite

Allen Smith said...

When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a remark is added I get four emails with the identical comment. Is there any manner you may remove me from that service? Thanks
how to stop snoring
head lice treatment
sinus infection home remedy
yeast infection home remedy

yafan430 said...

ugg http://www.ugg.ne.jp
アバクロ http://www.abercrombies.jp
エドハーディー http://www.ed-hardy.jp
トリーバーチ http://www.toryburch001.com
モンクレール http://www.moncler.ne.jp
モンクレール http://www.moncler007.com
クロックス http://www.crocsshop.jp
iPhone 4 ケース http://www.iphonecases.jp
ゴルフ クラブ/ゴルフ用品 http://www.callaway-golfclub.com/

yafan430 said...

ugg http://www.ugg.ne.jp
アバクロ http://www.abercrombies.jp
エドハーディー http://www.ed-hardy.jp
トリーバーチ http://www.toryburch001.com
モンクレール http://www.moncler.ne.jp
モンクレール http://www.moncler007.com
クロックス http://www.crocsshop.jp
iPhone 4 ケース http://www.iphonecases.jp
ゴルフ クラブ/ゴルフ用品 http://www.callaway-golfclub.com/

James said...

hey there and thank you for your info �V I��ve certainly picked up anything new from right here. I did however expertise some technical points using this site, as I experienced to reload the web site lots of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I'm complaining, but slow loading instances times will sometimes affect your placement in google and can damage your high-quality score if advertising and marketing with Adwords. Well I��m adding this RSS to my e-mail and could look out for much more of your respective intriguing content. Make sure you update this again soon..

moncler said...

Aston Villa rode their luck at Hull City where an 88-minute own goal from Kamil Zayatte saw them leapfrog three points clear of Arsenal and into fourth place in the Premier Leamoncler

Mantiz said...

Very good post, the whole code is very good, you light years ahead of me.

samrx

Cheap Down Jacket said...

This variety of products that are stuffed with Wholly Totally 100 % pure limit calculate disbursing out from the a higher price simply because there're going to go on interior phenomenon for a number of Moncler Coat
and look for your property or even family related with vast Moncler
. Though purchasing one another, check out a few fundamental traits you will probably have advantageous for the Moncler Jackets.

Herschel Muehlbach said...

Style will be the at any time changing idea regarding making use of more recent plus greater developments. moncler outlet variety with wardrobe possesses accomplished a endorsement regarding guys as well as women both alike. A leather coats also are sewed inside a specific fashion that provides way more longevity to the utilization of moncler outlet spencer. The discolored in addition to fruit colored moncler canada goose outdoor jackets had been by far the most favorite piece of clothing in that case, and they became the most looked for immediately after Jackets within European union.

instantinsurance said...

These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post, writing is simply great, thank you for the post Woodcock