bookmarksengine/Bookmarkstestui/BookMarkServerTestui.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:48:52 +0300
changeset 2 016bf4557e2f
parent 0 fa475d6462b2
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 2.1 of the License.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, 
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
*
* Description:
*
*/

#include<BookMarkServerTestui.h>
#include <bookmarkclient.h>
//#include<bookmarks.h>
BookMarkServerTestui::BookMarkServerTestui()
    {
    int sessionId=0;
    obj=new BookmarksClientSide();
    obj->connectToServer();
    bool res=obj->getSessionId(sessionId);
    }
BookMarkServerTestui::~BookMarkServerTestui()
    {
    obj->closeServer();
    delete(obj);
    obj=NULL;
    }
void BookMarkServerTestui::buttonclicked()
{
 getop();

}
void BookMarkServerTestui::getop()
    {
    BookmarkLeaf* col=new BookmarkLeaf();
  /*  col->setTitle("TestT1");
    col->setUrl("http://www.google.com");
    QDate x(2010,01,19);
    col->setDate(x);
    col->setTag("GOOGLY");*/
    QDate x(2010,01,19);
    col->setUrl("http://www.google.com");
    col->setTitle("TestT1");
    col->setDate(x);
    col->setTag("GOOGLY");
    obj->AddBookmark(col);


    }
void BookMarkServerTestui::delbutton()
    {
    
    obj->DeleteBookmark("TestT1");
    }
void BookMarkServerTestui::fetchbutton()
    {
    
    //BookmarkLeaf* fin=obj->FetchBookmark("first");
    }
void BookMarkServerTestui::closeAll()
    {
     //obj->closeServer();
     
    }
void BookMarkServerTestui::yahooclicked()
    {
    /*BookmarkLeaf* BookmarkContent=new BookmarkLeaf();
    BookmarkContent->setBookmarkTitle("second");
    BookmarkContent->setBookmarkUrl("www.yahoo.com");
    BookmarkContent->setLastUpdatedTime("11:10");
    BookmarkContent->setBookmarkTag("HHHHHHO");*/
    BookmarkLeaf* col=new BookmarkLeaf();
    QDate x(2010,01,19);
    col->setUrl("http://www.yahoo.com");
    col->setTitle("TestT2");
    col->setDate(x);
    col->setTag("YAH");
    obj->AddBookmark(col);
    
    }
void BookMarkServerTestui::nokiaclicked()
    {
    BookmarkLeaf* col=new BookmarkLeaf();
       QDate x(2010,01,19);
       col->setUrl("http://www.NOKIA.com");
       col->setTitle("TestT3");
       col->setDate(x);
       col->setTag("NOK");
    obj->AddBookmark(col);
    
    }
void BookMarkServerTestui::delyahoo()
    {
    obj->DeleteBookmark("TestT2");
    }
void BookMarkServerTestui::delnokia()
    {
    obj->DeleteBookmark("TestT3");
    }