1 /*
2  * Copyright 2018 Matthieu Gautier <mgautier@kymeria.fr>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU  General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301, USA.
18  */
19 
20 #ifndef KIWIX_BOOKMARK_H
21 #define KIWIX_BOOKMARK_H
22 
23 #include <string>
24 
25 namespace pugi {
26 class xml_node;
27 }
28 
29 namespace kiwix
30 {
31 
32 /**
33  * A class to store information about a bookmark (an article in a book)
34  */
35 class Bookmark
36 {
37  public:
38   Bookmark();
39   ~Bookmark();
40 
41   void updateFromXml(const pugi::xml_node& node);
42 
getBookId()43   const std::string& getBookId() const { return m_bookId; }
getBookTitle()44   const std::string& getBookTitle()  const { return m_bookTitle; }
getUrl()45   const std::string& getUrl() const { return m_url; }
getTitle()46   const std::string& getTitle() const { return m_title; }
getLanguage()47   const std::string& getLanguage() const { return m_language; }
getDate()48   const std::string& getDate() const { return m_date; }
49 
setBookId(const std::string & bookId)50   void setBookId(const std::string& bookId) { m_bookId = bookId; }
setBookTitle(const std::string & bookTitle)51   void setBookTitle(const std::string& bookTitle) { m_bookTitle = bookTitle; }
setUrl(const std::string & url)52   void setUrl(const std::string& url) { m_url = url; }
setTitle(const std::string & title)53   void setTitle(const std::string& title) { m_title = title; }
setLanguage(const std::string & language)54   void setLanguage(const std::string& language) { m_language = language; }
setDate(const std::string & date)55   void setDate(const std::string& date) { m_date = date; }
56 
57  protected:
58   std::string m_bookId;
59   std::string m_bookTitle;
60   std::string m_url;
61   std::string m_title;
62   std::string m_language;
63   std::string m_date;
64 };
65 
66 }
67 
68 #endif
69