bookmarks/BookmarkFav.h
changeset 9 1d51612454b5
equal deleted inserted replaced
8:6b5f25f057c2 9:1d51612454b5
       
     1 /*
       
     2  * BookmarkFav1.h
       
     3  *
       
     4  *  Created on: Aug 13, 2010
       
     5  *      Author: mmoretti
       
     6  */
       
     7 
       
     8 #ifndef BOOKMARKFAV_H_
       
     9 #define BOOKMARKFAV_H_
       
    10 
       
    11 #include <QString>
       
    12 #include <QObject>
       
    13 #include "bookmarksapi.h"
       
    14 
       
    15 class BOOKMARKSAPI_EXPORT BookmarkFav : public QObject {
       
    16 
       
    17     Q_OBJECT
       
    18 
       
    19     Q_PROPERTY(int id READ id WRITE setId)
       
    20     Q_PROPERTY(QString url READ url WRITE setUrl)
       
    21     Q_PROPERTY(QString title READ title WRITE setTitle)
       
    22     Q_PROPERTY(int sortIndex READ sortIndex WRITE setSortIndex)
       
    23 
       
    24 public:
       
    25     BookmarkFav(int id, QString title, QString url, int sortIndex/*, QString description*/):
       
    26             m_id(id),
       
    27             m_title(title),
       
    28             m_url(url),
       
    29             m_sortIndex(sortIndex)/*,
       
    30             m_description(description) */{}; 
       
    31             //TODO: Support XBEL description tag  
       
    32     BookmarkFav() : m_id(-1), m_title(""), m_url(""), m_sortIndex(-1) {};
       
    33 
       
    34 public slots:
       
    35     int id() const { return m_id; }
       
    36     QString url() const { return m_url; }
       
    37     QString title() const { return m_title; }
       
    38     int sortIndex() const { return m_sortIndex; }
       
    39     /* QString description() const { return m_description; } */
       
    40 
       
    41     void setId(int id) {m_id = id;}
       
    42     void setUrl(QString url) { m_url = url; }
       
    43     void setTitle(QString title) { m_title = title; }
       
    44     void setSortIndex(int sortIndex) { m_sortIndex = sortIndex; }
       
    45     /*void setDescription(QString description) { m_description = description; } */
       
    46 
       
    47 //    static void registerMetaType();
       
    48 
       
    49 private:
       
    50     int m_id;
       
    51     QString m_url;
       
    52     QString m_title;
       
    53     int m_sortIndex;
       
    54     /* QString m_description; */
       
    55 
       
    56 };
       
    57 
       
    58 // For scripting
       
    59 //Q_DECLARE_METATYPE(BookmarkFav *)
       
    60 
       
    61 
       
    62 #endif /* BOOKMARKFAV_H_ */