there was a file in $KDEDIR/share/apps/kopete/eventsrc
[!Global!] IconName=kopete Comment=Kopete Messenger [kopete_incoming] Name=Incoming Comment=An incoming message has been received default_sound=Kopete_Received.ogg default_presentation=64 ....
[Global] IconName=kopete Comment=Kopete Messenger [Event/kopete_incoming] Name=Incoming Comment=An incoming message has been received Sound=Kopete_Received.ogg Action=Sound|Popup|Taskbar ...
  KNotifyClient::event( someWidget->winId() , "kopete_incoming", i18n("you received a message from %1").arg( contactName ) );
 KNotification::event( "kopete_incoming" , i18n("you received a message from %1",  contactName ) , QPixmap() , someWidget );
or, which is probably better API
  KNotification *notification= new KNotification ( "kopete_incoming" , someWidget );
  notification->setText( i18n("you received a message from %1",  contactName ) );
  notification->sendEvent();