// UniBioMessageDataPlugin::attachmentList()
// @see header
//---------------------------------------------------------------
UniMessageInfoList UniBioMessageDataPlugin::attachmentList()
{
    RFile file;
    QT_TRAP_THROWING(file = d_ptr->attachmentL());

    if(attachmentCount() == 0)
    {
        file.Close();
        return QList<UniMessageInfo*> ();
    }
     
    UniMessageInfoList attlist;

    QString path;
    QString mimetype;
    int size = 0;

    TFileName fullName;
    qt_symbian_throwIfError(file.FullName(fullName));
    qt_symbian_throwIfError(file.Size(size));

    path = XQConversions::s60DescToQString(*fullName.AllocL());

    UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
    attlist << msgobj;
    file.Close();
    return attlist;
}
// UniBioMessageDataPlugin::hasAttachment()
// @see header
//---------------------------------------------------------------
bool UniBioMessageDataPlugin::hasAttachment()
{
    if(attachmentCount() > 0)
        return true;
    else
        return false; 
        
}
bool Module::unload(const ModuleCallback &callback)
{
    StLock<Mutex> _(mLock);
    // locked module - no more attachment creations possible
    if (callbackCount() == 1) {
        // would be last callback if successful, check for actual unload
        if (attachmentCount() > 0)
            CssmError::throwMe(CSSM_ERRCODE_FUNCTION_FAILED);	// @# module is busy
        // no attachments active - we are idle and ready to unload
        if (CSSM_RETURN err = plugin->unload(&gGuidCssm, // CSSM's Guid
                &myGuid(),		// module's Guid
                spiEventRelay, this)) // our callback
            CssmError::throwMe(err);	// tough...
        // okay, commit
        remove(callback);
        plugin->unload();
        return true;
    } else {
        // more callbacks - we're not going to unload
        remove(callback);
        return false;
    }
}