std::vector<EziFacebookFriend*> buildFriendsArray(std::string data)
{
    std::vector<EziFacebookFriend*> resultArray;
    std::vector< std::string > strings = EziSocialObject::tokenizeStr( data, ";");
    EziFacebookFriend* fbFriend = NULL;//EziFacebookFriend::create();
    
    for (int i = 1; i < strings.size(); i += 2)
    {
        if ( i > 1 && strings[i-1] == strings[0] )
        {
            if (fbFriend)
                resultArray.push_back(fbFriend);
            fbFriend = NULL;
        }
        
        if ( fbFriend == NULL )
            fbFriend = EziFacebookFriend::create("");
        
        fbFriend->saveData(strings[i].c_str(), strings[i-1].c_str());
        //tempDictionary->setObject(cocos2d::CCString::createWithFormat("%s", strings[i].c_str(), NULL), strings[i-1].c_str());
    
    }
    
    if (fbFriend)
    {
        resultArray.push_back(fbFriend);
    }
    
    return resultArray;
}
Example #2
0
void RequestList::downloadNextPhoto()
{
    if (mPhotoLoadIndex > 0)
    {
        mPhotoLoadIndex--;
        int index = mPhotoLoadIndex;
        EziFBIncomingRequest* incomingRequest = NULL;
        EziFacebookFriend *friendObject = NULL;
        
        incomingRequest = (EziFBIncomingRequest*)_fbIncomingRequestList->objectAtIndex(index);
                
        friendObject = incomingRequest->getSender();
        
        unsigned int size = 200;
        
        if (PHOTO_SCALE <= 0.5 && PHOTO_SCALE > 0.25)
        {
            size = 100;
        }
        else if (PHOTO_SCALE < 0.25)
        {
            size = 50;
        }
        
        EziSocialObject::sharedObject()->getProfilePicForID(friendObject->getFBID(),
                                                            size, size, false);
    }
    else
    {
        this->unscheduleUpdate();
        ALL_DOWNLOAD_COMPLETE = true;
        this->hideLoadingAction();
    }
}
Example #3
0
void FriendList::fbUserPhotoCallback(const char *userPhotoPath)
{
    EziFacebookFriend* friendDetails = (EziFacebookFriend*)mFriendList->objectAtIndex(mPhotoLoadIndex);
    friendDetails->setPhotoPath(userPhotoPath);
    
    mReadyForNextDownload = true;
}
void FriendListScene::fbUserPhotoCallback(const char *userPhotoPath, const char* fbID)
{
    if (_friendDictionary.size() == 0)
    {
        return;
    }
    
    EziFacebookFriend* myFriend = _friendDictionary.at(fbID);
    
    if (myFriend)
    {
        myFriend->saveData(userPhotoPath, "photo");        
        CCLOG("Downloaded photo for = %s", myFriend->getName().c_str());
    }
    else
    {
        CCLOG("Friend with ID = %s not found.", fbID);
    }
    
    _downloadCount++;
    if (_downloadCount == _friendList.size())
    {
        // this is the last we fetched. We can refresh the table view now.
        CCLOG("Download completed...");
        _tableView->reloadData();
    }
    
}
Example #5
0
void FriendList::downloadNextPhoto()
{
    if (mPhotoLoadIndex > 0)
    {
        mPhotoLoadIndex--;
        EziFacebookFriend* friendDetails = (EziFacebookFriend*)mFriendList->objectAtIndex(mPhotoLoadIndex);
        
        unsigned int size = 200;
        
        if (PHOTO_SCALE <= 0.5 && PHOTO_SCALE > 0.25)
        {
            size = 100;
        }
        else if (PHOTO_SCALE < 0.25)
        {
            size = 50;
        }
        
        EziSocialObject::sharedObject()->getProfilePicForID(friendDetails->getFBID(),
                                                            size, size, false);
    }
    else
    {
        this->unscheduleUpdate();
        ALL_DOWNLOAD_COMPLETE = true;
        this->hideLoadingAction();
    }
}
void FriendListScene::fbFriendsCallback(int responseCode, const char *responseMessage, std::vector<EziFacebookFriend*> friends)
{
    MessageBox(responseMessage, "Friends Callback");
    
    // Empty the current friend list & dictionary.
    _friendList.clear();
    _friendDictionary.clear();
    
    _friendList.swap(friends);
    
    int totalFriends = _friendList.size()-1;
    _downloadCount = 0;
    
    for (int i=totalFriends; i >= 0; i--)
    {
        EziFacebookFriend* myFriend = (EziFacebookFriend*)_friendList.at(i);
        
        CCLOG("%d. %s", i+1, myFriend->getProfileID().c_str());
        
        //_friendDictionary.insert("ABC", "ABC");
        
        
        _friendDictionary.insert(myFriend->getProfileID(), myFriend);
        
        myFriend->getPhoto(CC_CALLBACK_2(FriendListScene::applyPhoto, this), false, SCALED_VALUE(85.0f), SCALED_VALUE(85.0f));
        
        //EziSocialObject::sharedObject()->getProfilePicForID(this, myFriend->getProfileID().c_str(), SCALED_VALUE(85.0f), SCALED_VALUE(85.0f), false);
    }
    
    
    _tableView->reloadData();
}
Example #7
0
void RequestList::fbUserPhotoCallback(const char *userPhotoPath)
{
    int index = mPhotoLoadIndex;
    EziFBIncomingRequest* incomingRequest = NULL;
    EziFacebookFriend *friendObject = NULL;
    
    incomingRequest = (EziFBIncomingRequest*)_fbIncomingRequestList->objectAtIndex(index);
        
    friendObject = incomingRequest->getSender();
    friendObject->setPhotoPath(userPhotoPath);
    
    mReadyForNextDownload = true;
}
EziFacebookFriend* EziFacebookFriend::create()
{
    EziFacebookFriend* fbFriend = new EziFacebookFriend();
    if (fbFriend)
    {
        fbFriend->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(fbFriend);
        return NULL;
    }
    
    return fbFriend;
}
CCObject* EziFacebookFriend::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    EziFacebookFriend* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject)
    {
        //in case of being called at sub class
        pCopy = (EziFacebookFriend*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new EziFacebookFriend();
        pNewZone = new CCZone(pCopy);
    }
    
    pCopy->setName(getName());
    pCopy->setID(getFBID());
    pCopy->setScore(getScore());
    pCopy->setPhotoPath(getPhotoPath());
    pCopy->setInstalled(isInstalled());
    pCopy->setPhotoURL(getPhotoURL());
    
    //pCopy->initWithAction((CCActionInterval *)(m_pInner->copy()->autorelease()));
    
    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}
Example #10
0
EziFacebookFriend* EziFacebookFriend::create(const std::string& fbID,const std::string& name, long score, const std::string& photoPath, bool installed)
{
    EziFacebookFriend* fbFriend = new EziFacebookFriend();
    if (fbFriend)
    {
        fbFriend->_fbID = fbID;
        fbFriend->_name = name;
        fbFriend->_score = score;
        fbFriend->_photoPath = photoPath;
        fbFriend->_installed = installed;
        fbFriend->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(fbFriend);
        return NULL;
    }
    
    return fbFriend;
}
Example #11
0
void BaseScene::fbFriendsCallback(int responseCode, const char* responseMessage, cocos2d::CCArray* friends)
{
    if (responseCode == EziSocialWrapperNS::RESPONSE_CODE::FB_FRIEND_GET_SUCCESS)
    {
        for (int i=0; i<friends->count(); i++)
        {
            EziFacebookFriend* myFriend = (EziFacebookFriend*)(friends->objectAtIndex(i));
            CCString* friendKey = CCString::createWithFormat("Friend_ID_%d", (i+1), NULL);
            CCUserDefault::sharedUserDefault()->setStringForKey(friendKey->getCString(), myFriend->getFBID());
        }
        
        if (friends->count() > 0)
        {
            CCLOG("[EziSocial Log]: %d friends saved in DB for future use.", friends->count());
            CCUserDefault::sharedUserDefault()->setIntegerForKey("FRIENDS_COUNT", friends->count());
            
            // Save these friends for future use ;)
            CCUserDefault::sharedUserDefault()->flush();
        }
    }
}
Example #12
0
CCTableViewCell* RequestList::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
    int index = idx;    
    EziFBIncomingRequest* fbRequest = (EziFBIncomingRequest*)_fbIncomingRequestList->objectAtIndex(index);
    EziFacebookFriend* sender       = fbRequest->getSender();
    
    const char* senderName = sender->getName();
    
    // Create the fancy test.
    EziSocialWrapperNS::FB_REQUEST::TYPE requestType = fbRequest->getRequestType();
    std::string messageToDisplay = "";
    
    switch (requestType)
    {
        case EziSocialWrapperNS::FB_REQUEST::REQUEST_INVITE:
            messageToDisplay.append(senderName).append(" has sent invitation to you.");
            break;

        case EziSocialWrapperNS::FB_REQUEST::REQUEST_GIFT:
            messageToDisplay.append(senderName).append(" has sent gift to you.");
            break;

        case EziSocialWrapperNS::FB_REQUEST::REQUEST_CHALLENGE:
            messageToDisplay.append(senderName).append(" has challenged to you.");
            break;
            
        default:
            messageToDisplay.append("Unknown message");
            break;
    }
    
    // Means users have already used this request.
    bool requestConsumed = fbRequest->isConsumed();
    
    CCSprite* profilePic            = NULL;
    ccColor4B bgColor = ccc4(20, 0, 40, 255);
    
    if (requestConsumed == false)
    {
        bgColor = ccc4(50, 50, 20, 255);
    }

    
    // Build the table cell.
    CCTableViewCell *cell = table->dequeueCell();
    
    if (cell == NULL)
    {
        cell = new CCTableViewCell();
        cell->autorelease();

                
        // Create the back layer of the cell.
        CCLayerColor* colorLayer = CCLayerColor::create(bgColor, SCREEN_WIDTH, CELL_HEIGHT);
        colorLayer->setTag(BACKGROUND_TAG);
        
        cell->addChild(colorLayer);
        
        // Get the sender profile picture path. Create it if path is available.
        if (sender != NULL && strcmp(sender->getPhotoPath(), "") != 0)
        {
            const char*  picPath = sender->getPhotoPath();
            profilePic = CCSprite::create(picPath);
        }
        else
        {
            profilePic = CCSprite::create(FB_DEFAULT_PHOTO);
        }

        // Add the profile pic to the cell row.
        profilePic->setAnchorPoint(ccp(0, 0.5));
        profilePic->setPosition(ccp(20, CELL_HEIGHT/2));
        cell->addChild(profilePic);
        profilePic->setTag(FRIEND_PHOTO_TAG);
        
        // Set the message.
        CCLabelTTF *messageLabel = CCLabelTTF::create(messageToDisplay.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE);
        messageLabel->setAnchorPoint(ccp(0, 0.5));
        messageLabel->setPosition(ccp(20 + 20 + profilePic->getContentSize().width, CELL_HEIGHT/2));
        messageLabel->setTag(REQUEST_MESSAGE_LABEL_TAG);
        messageLabel->setDimensions(CCSizeMake(SCREEN_WIDTH - (profilePic->getContentSize().width * 2) - 60, CELL_HEIGHT-5));
        messageLabel->setHorizontalAlignment(kCCTextAlignmentLeft);
        cell->addChild(messageLabel);

        CCMenuItemImage* constumeItemButton = NULL;
        constumeItemButton = CCMenuItemImage::create("use.png", "use_pressed.png");
        

        constumeItemButton->setTag(idx);
        constumeItemButton->setTarget(this, menu_selector(RequestList::useItem));
        constumeItemButton->setScale(SCALE_FACTOR * 0.8);
        constumeItemButton->setTag(FRIEND_CONSUME_BUTTON_TAG);
        
        CCMenu* consumeMenu = CCMenu::create(constumeItemButton, NULL);
        consumeMenu->setTag(FRIEND_CONSUME_MENU_TAG);
        consumeMenu->setPosition(ccp(SCREEN_WIDTH - (constumeItemButton->getContentSize().width*SCALE_FACTOR*0.4),
                                       (CELL_HEIGHT - (constumeItemButton->getContentSize().height)*SCALE_FACTOR*0.4)));
        
        
        cell->addChild(consumeMenu);
        
        
    }
    else
    {
        // Refresh the cell data based upon idx.
        
        // 1. Refresh the profile picture.
        CCSprite* cellProfilePic = (CCSprite*)cell->getChildByTag(FRIEND_PHOTO_TAG);
        
        if (strcmp("", sender->getPhotoPath()) != 0 )
        {
            const char*  picPath = sender->getPhotoPath();
            profilePic = CCSprite::create(picPath);
            
        }
        else
        {
            profilePic = CCSprite::create(FB_DEFAULT_PHOTO);
        }
        
        cellProfilePic->setTexture(profilePic->getTexture());
        
        // Update the message Label.
        CCLabelTTF *messageLabel = (CCLabelTTF*)cell->getChildByTag(REQUEST_MESSAGE_LABEL_TAG);
        messageLabel->setString(messageToDisplay.c_str());
        
        CCMenu* consumeMenu = (CCMenu*)cell->getChildByTag(FRIEND_CONSUME_MENU_TAG);
        
        CCArray* children = consumeMenu->getChildren();
        
        if (children)
        {
            CCMenuItemImage* consumenButton = (CCMenuItemImage*)children->objectAtIndex(0);
            
            if (consumenButton)
            {
                consumenButton->setTag(index);
            }
            else
            {
                CCLOG("No Consume Button");
            }
            
        }
        
        CCLayerColor* bgLayer = (CCLayerColor*)cell->getChildByTag(BACKGROUND_TAG);
        bgLayer->setColor(ccc3(bgColor.r, bgColor.g, bgColor.b));
    }
    
    return cell;
    
}
Example #13
0
CCTableViewCell* FriendList::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
    EziFacebookFriend* friendDetails = (EziFacebookFriend*)mFriendList->objectAtIndex(idx);
    std::string friendID            = friendDetails->getFBID();
    std::string friendName          = friendDetails->getName();
    std::string installed           = "";
    std::string score               = "";
    CCSprite* profilePic            = NULL;
    
    // Set the score.
    long mylong = friendDetails->getScore();
    std::stringstream mystream;
    mystream << mylong;
    score = mystream.str();
    
    // Set the install status
    if (friendDetails->isInstalled())
    {
        installed = "Installed";
    }
    else
    {
        installed = "Not Installed";
    }
    
    
    CCTableViewCell *cell = table->dequeueCell();
    
    
    if (!cell) // Creation of Cell.
    {
        cell = new CCTableViewCell();
        cell->autorelease();
        
        CCLayerColor* colorLayer = CCLayerColor::create(ccc4(20, 0, 40, 255), SCREEN_WIDTH, CELL_HEIGHT);
        cell->addChild(colorLayer);
        
        CCSprite *sprite = NULL;
        
        if (strcmp(friendDetails->getPhotoPath(), "") != 0)
        {
            const char*  picPath = friendDetails->getPhotoPath();
            sprite = CCSprite::create(picPath);
        }
        else
        {
            sprite = CCSprite::create(FB_DEFAULT_PHOTO);
        }
        
        if (sprite == NULL)
        {
            CCLOG("Sprite is NULL");
        }
        
        sprite->setAnchorPoint(ccp(0, 0.5));
        sprite->setPosition(ccp(20, CELL_HEIGHT/2));
        cell->addChild(sprite);
        //sprite->setScale(0.9);
        sprite->setTag(FRIEND_PHOTO_TAG);
        
        // Friend Facebook ID
        CCLabelTTF *friendIDLabel = CCLabelTTF::create(friendID.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE);
        
        float gapY =  (CELL_HEIGHT - (friendIDLabel->getContentSize().height * 2)) / 3;
        
        if (sprite)
        {
            friendIDLabel->setPosition(ccp(sprite->getPositionX() + sprite->getContentSize().width + 20, CELL_HEIGHT - gapY));
        }
        
		friendIDLabel->setAnchorPoint(ccp(0, 1));
        friendIDLabel->setTag(FRIEND_ID_LABEL_TAG);
        cell->addChild(friendIDLabel);
        
        // Friend Facebook Name
        CCLabelTTF *friendNameLabel = CCLabelTTF::create(friendName.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE);
        friendNameLabel->setPosition(ccp(friendIDLabel->getPositionX(),
                                         friendIDLabel->getPositionY() - friendIDLabel->getContentSize().height - gapY));
        
		friendNameLabel->setAnchorPoint(ccp(0, 1));
        friendNameLabel->setTag(FRIEND_NAME_LABEL_TAG);
        cell->addChild(friendNameLabel);
        
        
        // High Score
        CCLabelTTF *scoreLabel = CCLabelTTF::create(score.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE);
        scoreLabel->setPosition(ccp(SCREEN_WIDTH - 20, friendIDLabel->getPositionY()));
        
        scoreLabel->setAnchorPoint(ccp(1, 1));
        scoreLabel->setTag(FRIEND_SCORE_LABEL_TAG);
        cell->addChild(scoreLabel);
        
        // Installed String
        CCLabelTTF *installedLabel = CCLabelTTF::create(installed.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE);
        installedLabel->setPosition(ccp(SCREEN_WIDTH - 20, friendNameLabel->getPositionY()));
        
        installedLabel->setAnchorPoint(ccp(1, 1));
        installedLabel->setTag(FRIEND_INSTALLED_LABEL_TAG);
        cell->addChild(installedLabel);
        
    }
    else
    {
        
        // Set the Friend ID
        CCLabelTTF *friendIDLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_ID_LABEL_TAG);
        friendIDLabel->setString(friendID.c_str());
        
        // Set the Friend Name
        CCLabelTTF *friendNameLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_NAME_LABEL_TAG);
        friendNameLabel->setString(friendName.c_str());
        
        
        CCLabelTTF *highScoreLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_SCORE_LABEL_TAG);
        if (highScoreLabel != NULL)
        {
            highScoreLabel->setString(score.c_str());
        }
        
        highScoreLabel->setVisible(mEnableHighScoreDisplay);
        
        
        CCLabelTTF *installedLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_INSTALLED_LABEL_TAG);
        if (installedLabel != NULL)
        {
            installedLabel->setString(installed.c_str());
        }
        installedLabel->setVisible(mEnableInstalledDisplay);
        
        
        CCSprite* cellProfilePic = (CCSprite*)cell->getChildByTag(FRIEND_PHOTO_TAG);
        
        if (strcmp("", friendDetails->getPhotoPath()) != 0 )
        {
            const char*  picPath = friendDetails->getPhotoPath();
            profilePic = CCSprite::create(picPath);
            
        }
        else
        {
            profilePic = CCSprite::create(FB_DEFAULT_PHOTO);
        }
        
        
        cellProfilePic->setTexture(profilePic->getTexture());
    }
    
    
    return cell;
}
TableViewCell* FriendListScene::tableCellAtIndex(TableView *table, ssize_t idx)
{
    int index = idx;
    EziFacebookFriend* myFriend = (EziFacebookFriend*)_friendList.at(index);
    std::string friendName = myFriend->getName();
    //const char* photoPath = myFriend->getPhotoPath().c_str();
    bool toRequestForPhoto = false;
    
    if (myFriend->getPhoto() == nullptr)
    {
        toRequestForPhoto = true;
        //EziSocialObject::sharedObject()->getProfilePicForID(this, myFriend->getFBID(), SCALED_VALUE(85.0f), SCALED_VALUE(85.0f), false);
    }
    
    // Build the table cell.
    TableViewCell *cell = table->cellAtIndex(idx);
    
    if (cell == NULL)
    {
        cell = new TableViewCell();
        cell->autorelease();
        
        LayerColor* colorLayer = LayerColor::create(Color4B(100, 100, 100, 200),
                                                        AppDelegate::SCREEN_WIDTH - SCALED_VALUE(20.0f),
                                                        SCALED_VALUE(124.0f));
        //cell->addChild(colorLayer);
        
        LayerColor* photoLayer = LayerColor::create(Color4B(255, 255, 255, 255),
                                                        SCALED_VALUE(100.0f),
                                                        SCALED_VALUE(100.0f));
        photoLayer->setPosition(SCALED_VALUE(40.0f), SCALED_VALUE(12.0f));
        cell->addChild(photoLayer);
        Sprite* userPhotoSprite = NULL;
        
        if (toRequestForPhoto)
        {
            userPhotoSprite = Sprite::create();
            userPhotoSprite->setContentSize(Size(SCALED_VALUE(85.0f), SCALED_VALUE(85.0f)));
        }
        else
        {
            userPhotoSprite = myFriend->getPhoto(CC_CALLBACK_2(FriendListScene::applyPhoto, this),
                                                 false,
                                                 SCALED_VALUE(85.0f),
                                                 SCALED_VALUE(85.0f));
            
            if (userPhotoSprite == nullptr) { userPhotoSprite = Sprite::create(); }
        }
        
        cell->addChild(userPhotoSprite);
        userPhotoSprite->setAnchorPoint(Point(0.0f, 0.0));
        userPhotoSprite->cocos2d::CCNode::setPosition(SCALED_VALUE(47.0f), SCALED_VALUE(18.0f));
        userPhotoSprite->setTag(TAG_PHOTO);
        
        auto message = LabelTTF::create(friendName.c_str(), "Arial", SCALED_VALUE(30.0f));
        message->setAnchorPoint(Point(0, 0.5));
        message->setPosition(Point(photoLayer->getContentSize().width + photoLayer->getPositionX() + SCALED_VALUE(20.0f),
                                 colorLayer->getContentSize().height/2));
        cell->addChild(message);
        message->setTag(TAG_MESSAGE);
        
        
        /*
        Sprite* consumedIcon = Sprite::createWithSpriteFrameName("green_tick");
        consumedIcon->setAnchorPoint(Point(1.0, 0.5));
        cell->addChild(consumedIcon);
        consumedIcon->setPosition(Point(colorLayer->getContentSize().width - SCALED_VALUE(20.0f),
                                      colorLayer->getContentSize().height/2));
        message->setTag(TAG_CONSUMED_ICON);
        
        MenuItemImage* useButton = MenuItemImage::create();
        useButton->setSelectedSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_use_prd"));
        useButton->setNormalSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_use_nrl"));
        useButton->setAnchorPoint(Point(1.0, 0.5));
        useButton->setTarget(this, menu_selector(FriendListScene::useRequest));
        
        Menu* useMenu = Menu::create(useButton, NULL);
        cell->addChild(useMenu);
        useMenu->setPosition(Point(colorLayer->getContentSize().width - SCALED_VALUE(20.0f),
                                 colorLayer->getContentSize().height/2));
        
        useButton->setTag(index);
        useMenu->setTag(TAG_USE_MENU);
        */
        
    }
    else
    {
        Sprite* cellProfilePic = (Sprite*)cell->getChildByTag(TAG_PHOTO);
        
        if (toRequestForPhoto == false)
        {
            //cellProfilePic->setTexture(Sprite::create(myFriend->getPhotoPath())->getTexture());
            Sprite* tempSprite = myFriend->getPhoto();
            
            
            if (myFriend->getPhoto() != nullptr)
            {
                cellProfilePic->setTexture(tempSprite->getTexture());
            }
            else
            {
                myFriend->getPhoto(CC_CALLBACK_2(FriendListScene::applyPhoto, this),
                                   false,
                                   SCALED_VALUE(85.0f),
                                   SCALED_VALUE(85.0f));    
            }
            
            
        }
        
        // Update the message Label.
        auto messageLabel = (LabelTTF*)cell->getChildByTag(TAG_MESSAGE);
        CCLOG("Friend Name = %s", friendName.c_str());
        
        if (messageLabel)
        {
            messageLabel->setString(friendName.c_str());    
        }
        
        
    }
    
    return cell;
}