Task TT-75 Implement "Main page loading UI" view
[profile/tv/apps/web/browser.git] / core / Tools / BookmarkItem.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  *
19  * Created on: Apr, 2014
20  *     Author: k.dobkowski
21  */
22
23 #ifndef BOOKMARKITEM_H
24 #define BOOKMARKITEM_H
25
26 #include "BrowserLogger.h"
27 #include "Config.h"
28 #include "BrowserImage.h"
29
30 namespace tizen_browser{
31 namespace services{
32
33 class BookmarkItem
34 {
35 public:
36     BookmarkItem();
37     BookmarkItem(
38         const std::string& url,
39         const std::string& tittle,
40         const std::string& note,
41         unsigned int dir = 0,
42         unsigned int id = 0
43         );
44     virtual ~BookmarkItem();
45
46     void setAddress(const std::string & url) { m_url = url; };
47     std::string getAddress() const { return m_url; };
48
49     void setTittle(const std::string & tittle) { m_tittle = tittle; };
50     std::string getTittle() const { return m_tittle; };
51
52     void setNote(const std::string& note){m_note = note;};
53     std::string getNote() const { return m_note;};
54
55     void setId(int id) { m_saved_id = id; };
56     int getId() const { return m_saved_id; };
57
58     void setThumbnail(std::shared_ptr<tizen_browser::tools::BrowserImage> thumbnail);
59     std::shared_ptr<tizen_browser::tools::BrowserImage> getThumbnail() const ;
60
61     void setFavicon(std::shared_ptr<tizen_browser::tools::BrowserImage> favicon);
62     std::shared_ptr<tizen_browser::tools::BrowserImage> getFavicon() const;
63
64     void setDir(unsigned int dir){m_directory = dir;};
65     unsigned int getDir() const {return m_directory;};
66
67     void setTags(const std::vector<unsigned int>& tags) { m_tags = tags; };
68     std::vector<unsigned int> getTags() const { return m_tags; };
69
70     bool is_folder(void) const { return m_is_folder; }
71     bool is_editable(void) const { return m_is_editable; }
72
73     void set_folder_flag(bool flag) { m_is_folder = flag; }
74     void set_editable_flag(bool flag) { m_is_editable = flag; }
75
76 private:
77     unsigned int m_saved_id;
78     std::string m_url;
79     std::string m_tittle;
80     std::string m_note;
81     std::shared_ptr<tizen_browser::tools::BrowserImage> m_thumbnail;
82     std::shared_ptr<tizen_browser::tools::BrowserImage> m_favicon;
83     unsigned int m_directory;
84     std::vector<unsigned int> m_tags;
85     bool m_is_folder;
86     bool m_is_editable;
87 };
88
89 typedef std::shared_ptr<BookmarkItem> SharedBookmarkItem;
90 typedef std::vector<SharedBookmarkItem> SharedBookmarkItemList;
91
92 }
93 }
94
95 #endif // BOOKMARKITEM_H
96