36 #include "identitydrag.h"
41 static const char kmailIdentityMimeType[] = "application/x-kmail-identity-drag";
43 IdentityDrag::IdentityDrag( const KPIM::Identity & ident,
44 TQWidget * dragSource, const char * name )
45 : TQDragObject( dragSource, name ), mIdent( ident )
50 const char * IdentityDrag::format( int i ) const {
52 return kmailIdentityMimeType;
57 TQByteArray IdentityDrag::encodedData( const char * mimetype ) const {
60 if ( !qstrcmp( mimetype, kmailIdentityMimeType ) ) {
61 TQDataStream s( a, IO_WriteOnly );
68 bool IdentityDrag::canDecode( const TQMimeSource * e ) {
70 return e->provides( kmailIdentityMimeType );
73 bool IdentityDrag::decode( const TQMimeSource * e, KPIM::Identity & i ) {
75 if ( e->provides( kmailIdentityMimeType ) ) {
76 TQDataStream s( e->encodedData( kmailIdentityMimeType ), IO_ReadOnly );
86 #include "identitydrag.moc"
|