KMessage/KMessageHandler: a core/ui seperation for displaying message.

Michaël Larouche michael.larouche at kdemail.net
Sun May 28 18:06:47 BST 2006


I rencently wanted to make a notification framework for Kopete4 to replace all 
the KMessageBox in the code. Then Olivier Goffart remembered me of the 
thread "core/ui separation".

So I've made the required classes to separate the message display.

kdecore: KMessage and KMessageHandler
KMessage is the "frontend" API static class developers use the display a 
message. You must supply a KMessageHandler to work properly.

KMessageHandler is the abstract class for the message handle.

kdeui: KMessageBoxMessageHandler and KPassivePopupMessageHandler
Those are obvious, there are KMessageHandler implementation that developers 
can use right away.

So it is used like 

KMessage::setMessageHandler( new KMessageBoxHandler(this) );
KMessage::message(  KMessage::Information, i18n("Information"), 
i18n("Caption") );

Applications can develop custom KMessageHandler for fine grained control in 
their application, like amaroK could use it with their KDE::StatusBar class.

The patch include:
-KMessage,KMessageHandler,KMessageBoxMessageHandler,KPassivePopupMessageHandler
-KMessage_Test in kdeui/tets
-- 
Michaël Larouche
KDE developer working on Kopete, Kamefu, Solid...on dial-up :P
--------------------------------------
Website: http://www.tehbisnatch.org/
MSN/Email: michael.larouche at kdemail.net
IRC: irc.freenode.org/DarkShock on #kopete,#solid,#kamefu,#plasma
Jabber: darkshock at myjabber.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmessage.patch.gz
Type: application/x-gzip
Size: 4735 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060528/090494d3/attachment.bin>


More information about the kde-core-devel mailing list