|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef BOOKMARKCLIENT_H |
|
19 #define BOOKMARKCLIENT_H |
|
20 |
|
21 #include<QObject> |
|
22 #include<QString> |
|
23 #include<bookmarkclientdefs.h> |
|
24 #include<QtGui> |
|
25 //using namespace WRT; |
|
26 |
|
27 class BookmarksClientSidePrivate; |
|
28 |
|
29 class BOOKMARKSENGINECLIENT_EXPORT BookmarkLeaf |
|
30 { |
|
31 public: |
|
32 QString getUrl(){return url;} |
|
33 QString getTitle(){return title;} |
|
34 QDate getDate(){return date;} |
|
35 QTime getLastVisited(){return lastVisited;} |
|
36 QString getDesc(){return desc;} |
|
37 QIcon getFavIcon(){return favicon;} |
|
38 QString getTag(){ return m_tag;} |
|
39 int getIndex(){ return m_index;} |
|
40 |
|
41 void setUrl(QString aurl){url=aurl;} |
|
42 void setTitle(QString atitle){title=atitle;} |
|
43 void setDate(QDate adate){date=adate;} |
|
44 void setLastVisited(QTime atime){lastVisited=atime;} |
|
45 void setDesc(QString adesc){desc=adesc;} |
|
46 void setFavIcon(QIcon afavicon){favicon=afavicon;} |
|
47 void setTag(QString atag){m_tag=atag;} |
|
48 void setIndex(int index){m_index=index;} |
|
49 private: |
|
50 QString url; |
|
51 QString title; |
|
52 |
|
53 /*The last date on which URL is visited*/ |
|
54 QDate date; |
|
55 /*The last time on which URL is visited*/ |
|
56 QTime lastVisited; |
|
57 |
|
58 QString desc; |
|
59 QIcon favicon; |
|
60 bool expanded; |
|
61 QString m_tag; |
|
62 int m_index; |
|
63 |
|
64 |
|
65 }; |
|
66 |
|
67 class BOOKMARKSENGINECLIENT_EXPORT BookmarksClientSide : public QObject |
|
68 { |
|
69 Q_OBJECT |
|
70 BOOKMARKSCLIENT_PRIVATE(BookmarksClientSide) |
|
71 public: |
|
72 |
|
73 BookmarksClientSide(); |
|
74 ~BookmarksClientSide(); |
|
75 int connectToServer(); |
|
76 void closeServer(); |
|
77 int AddBookmark(BookmarkLeaf* BookmarkContent); |
|
78 BookmarkLeaf* FetchBookmark(QString title); |
|
79 int DeleteBookmark(QString title); |
|
80 int getSessionId(int& BookmarkId); |
|
81 QList<BookmarkLeaf*> FetchAllBookmarks(); |
|
82 signals: |
|
83 void BookmarkAdded(QString title); |
|
84 void BookmarkDeleted(QString title); |
|
85 private slots: |
|
86 void handleServerResponse(); |
|
87 }; |
|
88 #endif //BOOKMARKCLIENT_H |