bookmarksengine/Bookmarkstestui/BookMarkServerTestui.cpp
changeset 0 fa475d6462b2
child 2 016bf4557e2f
equal deleted inserted replaced
-1:000000000000 0:fa475d6462b2
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include<BookMarkServerTestui.h>
       
    20 #include <bookmarkclient.h>
       
    21 //#include<bookmarks.h>
       
    22 BookMarkServerTestui::BookMarkServerTestui()
       
    23     {
       
    24     int sessionId=0;
       
    25     obj=new BookmarksClientSide();
       
    26     obj->connectToServer();
       
    27     bool res=obj->getSessionId(sessionId);
       
    28     }
       
    29 BookMarkServerTestui::~BookMarkServerTestui()
       
    30     {
       
    31     obj->closeServer();
       
    32     delete(obj);
       
    33     obj=NULL;
       
    34     }
       
    35 void BookMarkServerTestui::buttonclicked()
       
    36 {
       
    37  getop();
       
    38 
       
    39 }
       
    40 void BookMarkServerTestui::getop()
       
    41     {
       
    42     BookmarkLeaf* col=new BookmarkLeaf();
       
    43   /*  col->setTitle("TestT1");
       
    44     col->setUrl("http://www.google.com");
       
    45     QDate x(2010,01,19);
       
    46     col->setDate(x);
       
    47     col->setTag("GOOGLY");*/
       
    48     QDate x(2010,01,19);
       
    49     col->setUrl("http://www.google.com");
       
    50     col->setTitle("TestT1");
       
    51     col->setDate(x);
       
    52     col->setTag("GOOGLY");
       
    53     obj->AddBookmark(col);
       
    54 
       
    55 
       
    56     }
       
    57 void BookMarkServerTestui::delbutton()
       
    58     {
       
    59     
       
    60     obj->DeleteBookmark("TestT1");
       
    61     }
       
    62 void BookMarkServerTestui::fetchbutton()
       
    63     {
       
    64     
       
    65     //BookmarkLeaf* fin=obj->FetchBookmark("first");
       
    66     }
       
    67 void BookMarkServerTestui::closeAll()
       
    68     {
       
    69      //obj->closeServer();
       
    70      
       
    71     }
       
    72 void BookMarkServerTestui::yahooclicked()
       
    73     {
       
    74     /*BookmarkLeaf* BookmarkContent=new BookmarkLeaf();
       
    75     BookmarkContent->setBookmarkTitle("second");
       
    76     BookmarkContent->setBookmarkUrl("www.yahoo.com");
       
    77     BookmarkContent->setLastUpdatedTime("11:10");
       
    78     BookmarkContent->setBookmarkTag("HHHHHHO");*/
       
    79     BookmarkLeaf* col=new BookmarkLeaf();
       
    80     QDate x(2010,01,19);
       
    81     col->setUrl("http://www.yahoo.com");
       
    82     col->setTitle("TestT2");
       
    83     col->setDate(x);
       
    84     col->setTag("YAH");
       
    85     obj->AddBookmark(col);
       
    86     
       
    87     }
       
    88 void BookMarkServerTestui::nokiaclicked()
       
    89     {
       
    90     BookmarkLeaf* col=new BookmarkLeaf();
       
    91        QDate x(2010,01,19);
       
    92        col->setUrl("http://www.NOKIA.com");
       
    93        col->setTitle("TestT3");
       
    94        col->setDate(x);
       
    95        col->setTag("NOK");
       
    96     obj->AddBookmark(col);
       
    97     
       
    98     }
       
    99 void BookMarkServerTestui::delyahoo()
       
   100     {
       
   101     obj->DeleteBookmark("TestT2");
       
   102     }
       
   103 void BookMarkServerTestui::delnokia()
       
   104     {
       
   105     obj->DeleteBookmark("TestT3");
       
   106     }