--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/Bookmark.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+#ifndef BOOKMARK_H
+#define BOOKMARK_H
+
+#include "bookmarksapi.h"
+class QString;
+
+class BOOKMARKSAPI_EXPORT Bookmark {
+
+public:
+ QString url() { return m_url; }
+ QString title() { return m_title; }
+ int sortIndex() { return m_sortIndex; }
+ int id() { return m_id; }
+
+ void setUrl(QString url) { m_url = url; }
+ void setTitle(QString title) { m_title = title; }
+ void setSortIndex(int sortIndex) { m_sortIndex = sortIndex; }
+
+private:
+ QString m_url;
+ QString m_title;
+ int m_sortIndex;
+ int m_id;
+
+};
+
+#endif //BOOKMARK_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkFav.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,9 @@
+/*
+ * BookmarkFav1.cpp
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#include "BookmarkFav.h"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkFav.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,62 @@
+/*
+ * BookmarkFav1.h
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#ifndef BOOKMARKFAV_H_
+#define BOOKMARKFAV_H_
+
+#include <QString>
+#include <QObject>
+#include "bookmarksapi.h"
+
+class BOOKMARKSAPI_EXPORT BookmarkFav : public QObject {
+
+ Q_OBJECT
+
+ Q_PROPERTY(int id READ id WRITE setId)
+ Q_PROPERTY(QString url READ url WRITE setUrl)
+ Q_PROPERTY(QString title READ title WRITE setTitle)
+ Q_PROPERTY(int sortIndex READ sortIndex WRITE setSortIndex)
+
+public:
+ BookmarkFav(int id, QString title, QString url, int sortIndex/*, QString description*/):
+ m_id(id),
+ m_title(title),
+ m_url(url),
+ m_sortIndex(sortIndex)/*,
+ m_description(description) */{};
+ //TODO: Support XBEL description tag
+ BookmarkFav() : m_id(-1), m_title(""), m_url(""), m_sortIndex(-1) {};
+
+public slots:
+ int id() const { return m_id; }
+ QString url() const { return m_url; }
+ QString title() const { return m_title; }
+ int sortIndex() const { return m_sortIndex; }
+ /* QString description() const { return m_description; } */
+
+ void setId(int id) {m_id = id;}
+ void setUrl(QString url) { m_url = url; }
+ void setTitle(QString title) { m_title = title; }
+ void setSortIndex(int sortIndex) { m_sortIndex = sortIndex; }
+ /*void setDescription(QString description) { m_description = description; } */
+
+// static void registerMetaType();
+
+private:
+ int m_id;
+ QString m_url;
+ QString m_title;
+ int m_sortIndex;
+ /* QString m_description; */
+
+};
+
+// For scripting
+//Q_DECLARE_METATYPE(BookmarkFav *)
+
+
+#endif /* BOOKMARKFAV_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkResults.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,56 @@
+/*
+ * BookmarkResults.cpp
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#include <QString>
+#include <QObject>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlError>
+#include <QWidget>
+#include <QVariant>
+
+#include "BookmarkResults.h"
+#include "BookmarkFav.h"
+
+BookmarkResults::BookmarkResults(QSqlQuery *query/*, QWidget *parent*/) :
+ /*QObject(parent), */m_query(query)
+{
+// setObjectName("bookmarkResults");
+}
+
+BookmarkFav *BookmarkResults::nextBookmark()
+{
+ if (!m_query->isActive())
+ return NULL;
+ if (!m_query->next()) {
+ m_query->clear();
+ return NULL;
+ }
+ bool dummy;
+ return
+ new BookmarkFav(m_query->value(0).toInt(&dummy),
+ m_query->value(1).toString(),
+ m_query->value(2).toString(),
+ m_query->value(3).toInt(&dummy));
+}
+
+BookmarkResults::~BookmarkResults()
+{
+ delete m_query;
+}
+
+bool BookmarkResults::isMoreBookmarks()
+{
+ //return (m_query->isValid());
+ return (m_query->isActive());
+}
+
+//void BookmarkResults::registerMetaType()
+//{
+// qRegisterMetaType<BookmarkResults>("BookmarkResults");
+//}
+//
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkResults.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,43 @@
+/*
+ * BookmarkResults.h
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#ifndef BOOKMARKRESULTS_H_
+#define BOOKMARKRESULTS_H_
+
+#include <QObject>
+
+#include "bookmarksapi.h"
+class QSqlQuery;
+class BookmarkFav;
+
+class BOOKMARKSAPI_EXPORT BookmarkResults : public QObject {
+
+ Q_OBJECT
+
+ Q_PROPERTY(BookmarkFav* next READ nextBookmark)
+
+public slots:
+ BookmarkFav *nextBookmark();
+ // Javascript hack
+ bool isMoreBookmarks();
+
+public:
+// BookmarkResults(QSqlQuery *query = 0, QWidget *parent = 0);
+ BookmarkResults(QSqlQuery *query/*, QWidget *parent = 0*/);
+ ~BookmarkResults();
+// static void registerMetaType();
+
+protected:
+ QSqlQuery* m_query;
+
+};
+
+// For scripting
+//Q_DECLARE_METATYPE(BookmarkResults*)
+
+
+#endif /* BOOKMARKRESULTS_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkResultsList.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,9 @@
+/*
+ * BookmarkResultsList.cpp
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#include "BookmarkResultsList.h"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarkResultsList.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,27 @@
+/*
+ * BookmarkResultsList.h
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#ifndef BOOKMARKRESULTSLIST_H_
+#define BOOKMARKRESULTSLIST_H_
+
+#include <QList>
+
+template <class T>
+class BookmarkResultsList : public QList<T>
+{
+ /*
+public:
+ inline QQueue() {}
+ inline ~QQueue() {}
+ inline void enqueue(const T &t) { QList<T>::append(t); }
+ inline T dequeue() { return QList<T>::takeFirst(); }
+ inline T &head() { return QList<T>::first(); }
+ inline const T &head() const { return QList<T>::first(); }
+*/
+};
+
+#endif /* BOOKMARKRESULTSLIST_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarksManager.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,711 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description: This implements the bookmarks API's.
+*
+*/
+
+#include<QString>
+#include<QFile>
+#include<QFileInfo>
+#include<QDebug>
+#include<QSqlDatabase>
+#include<QSqlQuery>
+#include<QSqlError>
+#include<QWidget>
+#include<QtGui>
+
+#include "bookmarksapi.h"
+#include "BookmarksManager.h"
+#include "BookmarkFav.h"
+#include "BookmarkResults.h"
+#include "TagResults.h"
+#include "xbelreader.h"
+#include "xbelwriter.h"
+#include "defaultBookmarks.xml.h"
+
+BookmarksManager::BookmarksManager(QWidget *parent) :
+ QObject(parent)
+{
+ setObjectName("bookmarksManager");
+
+ m_db = QSqlDatabase::database(BOOKMARKS_DB_NAME);
+ if (!m_db.isValid()) {
+ m_db = QSqlDatabase::addDatabase("QSQLITE", BOOKMARKS_DB_NAME);
+ m_db.setDatabaseName(BOOKMARKS_DB_FILE);
+ }
+ if (m_db.open()) {
+ // TODO: Do we need a flag so that this gets called only once OR when
+ // creating a database tables "IF NOT EXISTS" is good enough
+ createBookmarksSchema();
+ }
+}
+
+BookmarksManager::~BookmarksManager() {
+ m_db.close();
+ QSqlDatabase::removeDatabase(BOOKMARKS_DB_NAME);
+}
+
+/*
+ * +-------------+ +----------+
+ * |Bookmarks(ID)|* <-> *|Tags(BMID)|
+ * +-------------+ +----------+
+ */
+void BookmarksManager::createBookmarksSchema() {
+ // Bookmarks
+ if (!doQuery("CREATE TABLE IF NOT EXISTS bookmarks("
+ "id INTEGER PRIMARY KEY,"
+ "title text, "
+ "url text,"
+ "sortIndex int DEFAULT 0)")) {
+ // TODO: do some error handling here!
+ return;
+ }
+ // Make sorting faster
+ if (!doQuery("CREATE INDEX IF NOT EXISTS bm_sort_idx ON bookmarks(sortIndex ASC)")) {
+ // TODO: do some error handling here!
+ return;
+ }
+ // We do a lot of lookups by id
+ if (!doQuery("CREATE INDEX IF NOT EXISTS bm_id_idx ON bookmarks(id ASC)")) {
+ // TODO: do some error handling here!
+ return;
+ }
+
+ // Tags
+ // Note: foreign key constraints are not enforced in the current version of sqlite
+ // that we are using.
+ if (!doQuery("CREATE TABLE IF NOT EXISTS tags("
+ "bmid INTEGER,"
+ "tag text,"
+ "FOREIGN KEY(bmid) REFERENCES bookmarks(id))")) {
+ // TODO: do some error handling here!
+ return;
+ }
+ // We do a lot of lookups, both by bookmark id and by tag
+ if (!doQuery("CREATE INDEX IF NOT EXISTS tags_bmid_idx ON tags(bmid ASC)")) {
+ // TODO: do some error handling here!
+ return;
+ }
+ if (!doQuery("CREATE INDEX IF NOT EXISTS tags_tag_idx ON tags(tag ASC)")) {
+ // TODO: do some error handling here!
+ return;
+ }
+}
+
+// TODO refactor this - nothing except the schema creation can use it as is
+bool BookmarksManager::doQuery(QString query) {
+#ifdef ENABLE_PERF_TRACE
+ PERF_DEBUG() << __PRETTY_FUNCTION__ << query << "\n";
+ unsigned int st = WrtPerfTracer::tracer()->startTimer();
+#endif
+ QSqlQuery db_query(m_db);
+ bool ok = db_query.exec(query);
+ if (!ok) {
+ qDebug() << "BookmarksManager::doQuery" << QString("ERR: %1 %2").arg(db_query.lastError().type()).arg(db_query.lastError().text()) << " Query: " << db_query.lastQuery();
+ }
+#ifdef ENABLE_PERF_TRACE
+ PERF_DEBUG() << __PRETTY_FUNCTION__ << WrtPerfTracer::tracer()->elapsedTime(st) << "\n";
+#endif
+ return ok;
+}
+
+
+/**==============================================================
+ * Description: Normalize a given url, if needed.
+ * It adds http:// in front, if the url is relative.
+ ================================================================*/
+QString BookmarksManager::normalizeUrl(const QString& url)
+{
+ // If the URL is relative, add http in front
+ QString updatedUrl = url;
+
+ if (!url.contains("://")) {
+ updatedUrl.prepend("http://");
+ }
+ return updatedUrl;
+}
+
+/**==============================================================
+ * Description: Adds the bookmark to the database, given title and
+ * url.
+ * Returns: Returns bookmarkID ( >0)else Failure (-1 or -2)
+ ================================================================*/
+int BookmarksManager::addBookmark(QString title, QString URL)
+{
+ int bookmarkId = 0;
+
+ if(URL.isEmpty()) {
+ bookmarkId = FAILURE;
+ }
+
+ if(bookmarkId != FAILURE) {
+ // do some checking on parameters
+ QString updatedTitle = title;
+ QString updatedUrl = normalizeUrl(URL);
+ int soIndex = 1;
+ if (title.isEmpty()) {
+ updatedTitle = "Untitled";
+ }
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+ m_db.transaction();
+ if (!query.exec("SELECT count(*) from bookmarks")) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ if(query.next()) {
+ query.prepare("UPDATE bookmarks SET sortIndex=sortIndex+1 WHERE sortIndex >= :sIndex");
+ query.bindValue(":sIndex", soIndex);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ }
+ query.prepare("INSERT INTO bookmarks (title, url, sortIndex) "
+ "VALUES (:title, :url, :sIndex)");
+ query.bindValue(":title", QVariant(updatedTitle));
+ query.bindValue(":url", QVariant(updatedUrl));
+ query.bindValue(":sIndex", QVariant(soIndex));
+ if (!query.exec()) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ // Note: lastInsertId() is not thread-safe
+ bookmarkId = query.lastInsertId().toInt();
+ if (!m_db.commit()) {
+ qDebug() << m_db.lastError().text();
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ } else {
+ bookmarkId = FAILURE;
+ }
+ }
+ return bookmarkId;
+}
+
+/**==============================================================
+ * Import bookmarks from an XBEL file. If no filename is
+ * passed in a set of default bookmarks will be imported.
+ * The default bookmarks used can be changed by updating
+ * the file "defaultBookmarks.xml.cpp".
+ * @param xbelFilePath - String containing the path to the
+ * file to import.
+ * @return SUCCESS or FAILURE depending on whether the
+ * import process was successful.
+ ==============================================================*/
+int BookmarksManager::importBookmarks(QString xbelFilePath)
+{
+ XbelReader *reader = new XbelReader(this);
+ bool retVal = false;
+
+ if(xbelFilePath.isEmpty() || !QFile::exists(xbelFilePath)) {
+ xbelFilePath = "c:\\data\\temp.xml";
+ QFile file(xbelFilePath);
+ if(file.exists())
+ file.remove();
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return false;
+ QTextStream out(&file);
+ out << defaultBookmarksList;
+ out.flush();
+ file.close();
+ }
+ QFile file(xbelFilePath);
+ if(file.exists()) {
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
+ retVal = reader->read(&file);
+ file.close();
+ }
+ if(reader)
+ delete reader;
+ return retVal ? SUCCESS : FAILURE;
+}
+
+/**==============================================================
+ * Exports all bookmarks in the database to an XBEL file. This function
+ * expects a valid file path to be passed in. If the path is not valid
+ * a default file path will be used. If a file with that name already
+ * exists at that location,
+ * @param xbelFilePath String containing the path of the file to
+ * export to.
+ * @return SUCCESS or FAILURE depending on whether the
+ * export process was successful.
+ ==============================================================*/
+int BookmarksManager::exportBookmarks(QString xbelFilePath)
+{
+ XbelWriter *writer = new XbelWriter(this);
+ bool retVal = false;
+
+ if(xbelFilePath.isEmpty()) {
+ xbelFilePath = "c:\\data\\myBookmarks.xml";
+ }
+
+ QFile file(xbelFilePath);
+ if(file.exists()) {
+ file.remove(xbelFilePath);
+ }
+ file.open(QIODevice::WriteOnly | QIODevice::Text);
+ retVal = writer->writeFile(&file);
+ file.flush();
+ file.close();
+
+ if(writer)
+ delete writer;
+ return retVal ? SUCCESS : FAILURE;
+
+}
+
+/**==============================================================
+ * Description: Modify the existing bookmark. Given id of the bookmark
+ * and new title or url, it modifies the existing bookmark.
+ * Returns : Success(0) or Failure(-1 or -2).
+ ================================================================*/
+int BookmarksManager::modifyBookmark(int origBookmarkId, QString newTitle, QString newURL)
+{
+ int retVal = SUCCESS;
+
+ // Client has to at least pass title or url
+ if(newTitle.isEmpty() && newURL.isEmpty())
+ retVal = FAILURE;
+
+ if(retVal == SUCCESS) {
+
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+
+ if(newTitle.isEmpty()) {
+ query.prepare("UPDATE bookmarks SET url=:newurl WHERE id=:bmId");
+ query.bindValue(":newurl", normalizeUrl(newURL));
+ query.bindValue(":bmId", origBookmarkId);
+ } else if(newURL.isEmpty()) {
+ query.prepare("UPDATE bookmarks SET title=:newTitle WHERE id=:bmId");
+ query.bindValue(":newTitle", newTitle);
+ query.bindValue(":bmId", origBookmarkId);
+ } else {
+ query.prepare("UPDATE bookmarks SET url=:newurl, title=:newTitle WHERE id=:bmId");
+ query.bindValue(":newurl", normalizeUrl(newURL));
+ query.bindValue(":newTitle", newTitle);
+ query.bindValue(":bmId", origBookmarkId);
+ }
+ if (!query.exec()) {
+ lastErrMsg(query);
+ return DATABASEERROR;
+ }
+ if (query.numRowsAffected() == 0) {
+ // No update happened - must be an invalid id
+ // TODO: shall we return some other status
+ retVal = FAILURE;
+ }
+ } else
+ retVal = FAILURE;
+ }
+ return retVal;
+}
+
+/**===================================================================================
+ * Description: Delete the bookmark item, also delete all the tags associated with it.
+ * Returns: SUCCESS(0) or Failure(-1 or -2)
+ ======================================================================================*/
+int BookmarksManager::deleteBookmark(int bookmarkId)
+{
+ int retVal = SUCCESS;
+
+ if (m_db.isOpen()) {
+
+ QSqlQuery query(m_db);
+
+ // TODO: Need to think about whether we need to get sortIndex and update all the
+ // rows after the deletion or not
+
+ // TODO: check if transaction() has been supported
+ // by calling hasfeature() function first
+ m_db.transaction();
+
+ query.prepare("DELETE FROM bookmarks WHERE id=:bmId");
+ query.bindValue(":bmId", bookmarkId);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+
+ query.prepare("DELETE FROM tags WHERE bmid=:bmId");
+ query.bindValue(":bmId", bookmarkId);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ if (!m_db.commit()) {
+ qDebug() << m_db.lastError().text();
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ } else
+ retVal = FAILURE;
+
+ return retVal;
+}
+
+/**===================================================================================
+ * Description: Delete all records from the bookmarks table as well as all the tags.
+ * Returns: SUCCESS(0) or FAILURE(-1 or -2)
+ ======================================================================================*/
+int BookmarksManager::clearAll()
+{
+ int retVal = SUCCESS;
+
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+
+ // TODO: check if transaction() has been supported
+ // by calling hasfeature() function first
+ m_db.transaction();
+
+ if(!query.exec("DELETE FROM bookmarks")) {
+ lastErrMsg(query);
+ m_db.rollback();
+ retVal = DATABASEERROR;
+ }
+ if (retVal == SUCCESS && !query.exec("DELETE FROM tags")) {
+ lastErrMsg(query);
+ m_db.rollback();
+ retVal = DATABASEERROR;
+ }
+ if (retVal == SUCCESS && !m_db.commit()) {
+ qDebug() << m_db.lastError().text();
+ m_db.rollback();
+ retVal = DATABASEERROR;
+ }
+ } else
+ retVal = FAILURE;
+
+ return retVal;
+}
+
+/**==============================================================
+ * Description: Deletes a single tag associated with the bookmark
+ * Returns: SUCCESS(0) or FAILURE (-1 or -2)
+ ===============================================================*/
+int BookmarksManager::deleteTag(int bookmarkId, QString tagToDelete)
+{
+ int retVal = SUCCESS;
+
+ if(tagToDelete.isEmpty()|| bookmarkId < 0)
+ retVal = FAILURE;
+
+ if (retVal == SUCCESS) {
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+
+ query.prepare("DELETE FROM tags WHERE bmid=:bmId AND tag=:tag");
+ query.bindValue(":bmId", bookmarkId);
+ query.bindValue(":tag", tagToDelete);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ retVal = DATABASEERROR;
+ }
+ } else
+ retVal = FAILURE;
+ }
+
+ return retVal;
+}
+
+/**================================================================
+ * Description: Adds a single tag associated given the bookmark id
+ * Returns: SUCCESS(0) or FAILURE (-1 or -2)
+ ==================================================================*/
+int BookmarksManager::addTag(int bookmarkId, QString tagToAdd)
+{
+ int retVal = SUCCESS;
+
+ if(tagToAdd.isEmpty()|| bookmarkId < 0)
+ retVal = FAILURE;
+
+ if(retVal == SUCCESS) {
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+
+ query.prepare("INSERT INTO tags (bmid, tag) "
+ "VALUES (:id, :tag)");
+ query.bindValue(":id", QVariant(bookmarkId));
+ query.bindValue(":tag", QVariant(tagToAdd));
+
+ if (!query.exec()) {
+ lastErrMsg(query);
+ retVal = DATABASEERROR;
+ }
+ } else
+ retVal = FAILURE;
+ }
+
+ return retVal;
+}
+
+/**==============================================================
+ * Description: Finds all the bookmarks weather they have tags
+ * or not.
+ * Returns: A pointer to BookmarkResults object or NULL.
+ ===============================================================*/
+BookmarkResults *BookmarksManager::findAllBookmarks()
+{
+ BookmarkResults * results = NULL;
+
+ QString queryStr = QString("SELECT "
+ " id, title, url, sortIndex "
+ " FROM bookmarks ORDER BY sortIndex");
+ if (m_db.isOpen()) {
+ QSqlQuery *query = new QSqlQuery(m_db);
+ if (query->exec(queryStr)) {
+ results = new BookmarkResults(query);
+ } else {
+ qDebug() << query->lastError().text() << " Query: " << query->lastQuery();
+ results = NULL;
+ }
+ }
+ return results;
+}
+
+/**==============================================================
+ * Description: Finds all the distinct tags.
+ * Returns: A pointer to TagResults object or NULL.
+ ===============================================================*/
+TagResults *BookmarksManager::findAllTags()
+{
+ TagResults * results = NULL;
+
+ if (m_db.isOpen()) {
+ QSqlQuery *query = new QSqlQuery(m_db);
+ if (query->exec("SELECT DISTINCT tag FROM tags")) {
+ // TODO: do we need javascript hack here like in findAllBookmarks API.
+ results = new TagResults(query);
+ } else {
+ qDebug() << query->lastError().text() << " Query: " << query->lastQuery();
+ results = NULL;
+ }
+ }
+ return results;
+}
+
+
+/**==============================================================
+ * Description: Finds all the bookmarks associated with a given
+ * tag.
+ * Returns: A pointer to BookmarkResults object or NULL.
+ ===============================================================*/
+BookmarkResults *BookmarksManager::findBookmarksByTag(QString tag)
+{
+ BookmarkResults * results = NULL;
+
+ QString queryStr = QString("SELECT "
+ " id, title, url, sortIndex "
+ " FROM bookmarks b JOIN"
+ " tags t ON b.id=t.bmid WHERE"
+ " t.tag=:tag");
+ if (m_db.isOpen()) {
+ QSqlQuery *query = new QSqlQuery(m_db);
+ query->prepare(queryStr);
+ query->bindValue(":tag", tag);
+ if (query->exec()) {
+ // TODO: do we need javascript hack here like in findAllBookmarks API.
+ results = new BookmarkResults(query);
+ } else {
+ qDebug() << query->lastError().text() << " Query: " << query->lastQuery();
+ results = NULL;
+ }
+ }
+ return results;
+}
+
+
+/**==============================================================
+ * Description: Finds all the Tags associated with a given
+ * bookmarkID.
+ * Returns: A pointer to TagResults object or NULL.
+ ===============================================================*/
+TagResults *BookmarksManager::findTagsByBookmark(int bookmarkID)
+{
+ TagResults * results = NULL;
+
+ QString queryStr = QString("SELECT DISTINCT tag "
+ " FROM tags t JOIN"
+ " bookmarks b ON t.bmid=b.id WHERE"
+ " t.bmid=:id");
+ if (m_db.isOpen()) {
+ QSqlQuery *query = new QSqlQuery(m_db);
+ query->prepare(queryStr);
+ query->bindValue(":id", bookmarkID);
+ if (query->exec()) {
+ // TODO: do we need javascript hack here like in findAllBookmarks API.
+ results = new TagResults(query);
+ } else {
+ qDebug() << query->lastError().text() << " Query: " << query->lastQuery();
+ results = NULL;
+ }
+ }
+ return results;
+}
+
+/**==============================================================
+ * Description: Finds all the Bookmarks that doesn't have any
+ * tags associated with it. It is needed by export API.
+ * Returns: A pointer to BookmarkResults object or NULL.
+ ===============================================================*/
+BookmarkResults *BookmarksManager::findUntaggedBookmarks()
+{
+ BookmarkResults * results = NULL;
+
+ QString queryStr = QString("SELECT "
+ " id, title, url, sortIndex "
+ " FROM bookmarks b LEFT OUTER JOIN"
+ " tags t ON b.id=t.bmid WHERE"
+ " t.bmid IS NULL ORDER BY sortIndex");
+
+ if (m_db.isOpen()) {
+ QSqlQuery *query = new QSqlQuery(m_db);
+ if (query->exec(queryStr)) {
+ // TODO: do we need javascript hack here like in findAllBookmarks API.
+ results = new BookmarkResults(query);
+ } else {
+ qDebug() << query->lastError().text() << " Query: " << query->lastQuery();
+ results = NULL;
+ }
+ }
+ return results;
+}
+
+
+/**==============================================================
+ * Description: Reorder bookmarks. Moves a given bookmark to a
+ * passed new index.
+ * Returns: SUCCESS(0) or FAILURE (-1 or -2)
+ ===============================================================*/
+int BookmarksManager::reorderBookmark(int bookmarkID, int newIndex)
+{
+ if (newIndex <= 0)
+ return FAILURE;
+
+ if (!m_db.isOpen())
+ return DATABASEERROR;
+
+ QSqlQuery query(m_db);
+
+ // Make sure the bookmark exists
+ BookmarkFav *bm = findBookmark(bookmarkID);
+ if (!bm)
+ return FAILURE;
+
+ // Next, help stamp out and abolish redundancy. If the bookmark is already at this sortIndex, do nothing.
+ if (bm->sortIndex() == newIndex)
+ return SUCCESS;
+
+ /*
+ * Ok, the way the sortIndex works is that you can specify any sortIndex you want (it doesn't have to be consecutive).
+ * This means there can be holes in the list of sortIndexes. Whenever someone wants to move a bookmark to a new sort
+ * position, we just bump everything that was in that position and further down the list by 1 and then set the sortIndex
+ * of the bookmark to what they want. This should work whether there is more than one bookmark or not.
+ */
+
+ // Bump all the bookmarks from this sortIndex down by 1 first
+ m_db.transaction();
+ query.prepare("UPDATE bookmarks SET sortIndex=sortIndex+1 WHERE sortIndex >= :newIndex");
+ query.bindValue(":newIndex", newIndex);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ return DATABASEERROR;
+ }
+ // Then just set this bookmark's sortIndex to the new value
+ query.prepare("UPDATE bookmarks SET sortIndex=:newIndex WHERE id=:id");
+ query.bindValue(":id", bookmarkID);
+ query.bindValue(":newIndex", newIndex);
+ if (!query.exec()) {
+ lastErrMsg(query);
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ if (!m_db.commit()){
+ qDebug() << m_db.lastError().text();
+ m_db.rollback();
+ return DATABASEERROR;
+ }
+ return SUCCESS;
+}
+
+/**==============================================================
+ * Description: Finds a bookmark based on a given bookmarkID.
+ * Returns: A pointer to BookmarkFav object or NULL.
+ ===============================================================*/
+BookmarkFav* BookmarksManager::findBookmark(int bookmarkId)
+{
+ BookmarkFav * results = NULL;
+
+
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+ query.prepare("SELECT title, url, sortIndex FROM bookmarks WHERE id=:id");
+ query.bindValue(":id", bookmarkId);
+ if (query.exec()) {
+ if (query.next())
+ results = new BookmarkFav(bookmarkId, query.value(0).toString(),
+ query.value(1).toString(), query.value(2).toInt());
+ } else {
+ lastErrMsg(query);
+ }
+ }
+ return results;
+}
+
+/**==============================================================
+ * Description: Finds a bookmark based on a given bookmarkID.
+ * Returns: A pointer to BookmarkFav object or NULL.
+ ===============================================================*/
+QMap<QString, QString> BookmarksManager::findBookmarks(QString atitle)
+{
+ QMap<QString, QString> map;
+
+ if (m_db.isOpen()) {
+ QSqlQuery query(m_db);
+ QString queryStatement = "SELECT url, title FROM bookmarks WHERE title LIKE '%"+atitle+"%' OR url LIKE '%" + atitle + "%'";
+ query.prepare(queryStatement);
+ if(query.exec()) {
+ while (query.next()){
+ QString bookmarkUrl = query.value(0).toString();
+ QString bookmarkTitle = query.value(1).toString();
+ map.insert( bookmarkUrl, bookmarkTitle );
+ }
+ } else {
+ lastErrMsg(query);
+ }
+ }
+ return map;
+}
+
+/**==============================================================
+ * Description: Prints a last error message from the query.
+ * Returns: Nothing.
+ ===============================================================*/
+void BookmarksManager::lastErrMsg(QSqlQuery& query)
+{
+ qDebug() << "BookmarksManager::lastErrMsg" << QString("ERR: %1 %2").arg(query.lastError().type()).arg(query.lastError().text()) << " Query: " << query.lastQuery();
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/BookmarksManager.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+#ifndef BOOKMARKSMANAGER_H
+#define BOOKMARKSMANAGER_H
+
+#include <QString>
+#include <QObject>
+#include <QSqlDatabase>
+#include <QSqlError>
+#include <QMap>
+
+#include "bookmarksapi.h"
+class QWidget;
+class BookmarkFav;
+class BookmarkResults;
+class TagResults;
+
+#define BOOKMARKS_DB_NAME "Bookmarks"
+#define BOOKMARKS_DB_FILE "bookmarks.db"
+
+class BOOKMARKSAPI_EXPORT BookmarksManager : public QObject {
+
+ Q_OBJECT
+
+public:
+ enum status {
+ SUCCESS = 0,
+ DATABASEERROR = -1,
+ FAILURE = -2
+ };
+
+ BookmarksManager(QWidget *parent = 0);
+ ~BookmarksManager();
+
+public slots:
+ int addBookmark(QString title, QString URL);
+ int modifyBookmark(int origBookmarkId, QString newTitle, QString newURl);
+ int deleteBookmark(int bookmarkId);
+ int clearAll();
+ int deleteTag(int bookmarkId, QString tag);
+ int addTag(int bookmarkId, QString tag);
+ BookmarkResults *findAllBookmarks();
+ TagResults *findAllTags();
+ BookmarkResults *findBookmarksByTag(QString tag);
+ int importBookmarks(QString xbelFilePath);
+ int exportBookmarks(QString xbelFilePath);
+ BookmarkFav* findBookmark(int bookmarkId);
+ BookmarkResults *findUntaggedBookmarks();
+ int reorderBookmark(int bookmarkID, int newIndex);
+ TagResults* findTagsByBookmark(int bookmarkID);
+ QMap<QString, QString> findBookmarks(QString atitle);
+
+ private:
+ bool doQuery(QString query);
+ void createBookmarksSchema();
+ QString normalizeUrl(const QString& url);
+ void lastErrMsg(QSqlQuery& query);
+
+ QSqlDatabase m_db;
+ // Note: One instance of a query was locking the database even after using finish() and clear()
+ //QSqlQuery* m_query;
+};
+#endif //BOOKMARKSMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/TagResults.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,41 @@
+/*
+ * TagResults.cpp
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#include <QString>
+#include <QObject>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlError>
+#include <QWidget>
+#include <QVariant>
+
+#include "TagResults.h"
+
+
+TagResults::TagResults(QSqlQuery *query, QWidget *parent) : QObject(parent), m_query(query)
+{
+}
+
+QString *TagResults::nextTag()
+{
+ if (!hasMoreTags())
+ return NULL;
+ if (!m_query->next()) {
+ m_query->clear();
+ return NULL;
+ }
+ return new QString(m_query->value(0).toString());
+}
+
+bool TagResults::hasMoreTags() {
+ return m_query->isActive();
+}
+
+TagResults::~TagResults()
+{
+ delete m_query;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/TagResults.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * TagResults.h
+ *
+ * Created on: Aug 13, 2010
+ * Author: mmoretti
+ */
+
+#ifndef TAGRESULTS_H_
+#define TAGRESULTS_H_
+
+#include <QString>
+#include <QObject>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlError>
+#include <QWidget>
+
+#include "bookmarksapi.h"
+
+class BOOKMARKSAPI_EXPORT TagResults : public QObject {
+
+ Q_OBJECT
+
+ Q_PROPERTY(QString* next READ nextTag)
+ Q_PROPERTY(bool hasMoreTags READ hasMoreTags)
+
+public slots:
+ QString *nextTag();
+
+public:
+ TagResults(QSqlQuery *query, QWidget *parent = 0);
+ ~TagResults();
+
+public:
+ bool hasMoreTags();
+
+protected:
+ QSqlQuery* m_query;
+};
+
+// For scripting
+//Q_DECLARE_METATYPE(TagResults *)
+
+
+#endif /* TAGRESULTS_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/bookmarks.pro Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,110 @@
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not,
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+# Description:
+TEMPLATE = lib
+TARGET = bookmarksapi
+ROOT_DIR = $$PWD/..
+include($$ROOT_DIR/browser.pri)
+DEFINES += BUILDING_BOOKMARKSAPI_DLL
+QT += core \
+ network \
+ xml \
+ sql \
+ script
+
+# HEADERS += $$PWD/inc/browsercontentdllclientdefs.h \
+# $$PWD/inc/browsercontentdll.h
+# SOURCES += $$PWD/src/browsercontentdll.cpp
+isEmpty(BEDROCK_OUTPUT_DIR): {
+ symbian {
+ CONFIG(release, debug|release):BOOKMARKSAPI_OUTPUT_DIR = $$PWD/../../WrtBuild/Release
+ CONFIG(debug, debug|release):BOOKMARKSAPI_OUTPUT_DIR = $$PWD/../../WrtBuild/Debug
+ }
+ else {
+ CONFIG(release, debug|release):BOOKMARKSAPI_OUTPUT_DIR = $$PWD/../../../../WrtBuild/Release
+ CONFIG(debug, debug|release):BOOKMARKSAPI_OUTPUT_DIR = $$PWD/../../../../WrtBuild/Debug
+ }
+}
+else:BOOKMARKSAPI_OUTPUT_DIR = $$BEDROCK_OUTPUT_DIR
+OBJECTS_DIR = $$BOOKMARKSAPI_OUTPUT_DIR/bookmarksapi/tmp
+DESTDIR = $$BOOKMARKSAPI_OUTPUT_DIR/bin
+MOC_DIR = $$BOOKMARKSAPI_OUTPUT_DIR/bookmarksapi/tmp
+RCC_DIR = $$BOOKMARKSAPI_OUTPUT_DIR/bookmarksapi/tmp
+TEMPDIR = $$BOOKMARKSAPI_OUTPUT_DIR/bookmarksapi/build
+
+# QMAKE_LIBDIR = $$BOOKMARKSCLIENTDLL_DATAMODEL_OUTPUT_DIR/bin
+INCLUDEPATH += $$PWD
+
+# I believe the following line to be useless on all platforms. (carol.szabo@nokia.com)
+# !s40:LIBS += -Llib
+# CONFIG += \
+# building-libs \
+# depend_includepath \
+# dll
+CONFIG += dll
+
+# CONFIG(release, debug|release):!CONFIG(QTDIR_build){
+# !unix : contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
+# unix : contains(QT_CONFIG, reduce_relocations): CONFIG += bsymbolic_functions
+# }
+# CONFIG -= warn_on
+*-g++*:QMAKE_CXXFLAGS += -Wreturn-type \
+ -fno-strict-aliasing
+CONFIG(gcov) {
+ LIBS += -lgcov
+ QMAKE_CXXFLAGS += -fprofile-arcs \
+ -ftest-coverage
+ message( "building for coverage statics" )
+}
+isEmpty(TEMPDIR) {
+ CONFIG(release, debug|release):TEMPDIR = $$DESTDIR/Release/build
+ CONFIG(debug, debug|release):TEMPDIR = $$DESTDIR/Debug/build
+}
+CONFIG (maemo):include(../../../../cwrt-maemo.pri)
+symbian: {
+ TARGET.UID3 = 0x200267E7
+ TARGET.VID = VID_DEFAULT
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.CAPABILITY = All \
+ -TCB \
+ -DRM \
+ -AllFiles
+ LIBS += -lefsrv \
+ -lcaf \
+ -lcafutils
+ INCLUDEPATH += $$MW_LAYER_PUBLIC_EXPORT_PATH(cwrt) \
+ $$MW_LAYER_PUBLIC_EXPORT_PATH()
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ INCLUDEPATH += /epoc32/include
+ bookmarksapi.sources = bookmarksapi.dll
+ bookmarksapi.path = /sys/bin
+ DEPLOYMENT += bookmarksapi
+}
+HEADERS = \
+#BookmarkResultsList.h \
+ TagResults.h \
+ BookmarkResults.h \
+ BookmarkFav.h \
+ xbelreader.h \
+ xbelwriter.h \
+ BookmarksManager.h \
+ bookmarksapi.h \
+ Bookmark.h
+SOURCES = \
+#BookmarkResultsList.cpp \
+ TagResults.cpp \
+ BookmarkResults.cpp \
+ BookmarkFav.cpp \
+ xbelreader.cpp \
+ xbelwriter.cpp \
+ BookmarksManager.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/bookmarksapi.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+#ifndef BOOKMARKSAPI_H
+#define BOOKMARKSAPI_H
+
+#ifdef BUILDING_BOOKMARKSAPI_DLL
+ #define BOOKMARKSAPI_EXPORT Q_DECL_EXPORT
+#else
+ #define BOOKMARKSAPI_EXPORT Q_DECL_IMPORT
+#endif
+
+
+
+#endif // BOOKMARKSAPI_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/conf/BookmarkData.confml Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.s60.com/xml/confml/2"
+ xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2"
+ name="data">
+ <data>
+ <BookmarkItems>
+ <RemoveNokiaBookmarks>false</RemoveNokiaBookmarks>
+ <RemoveNokiaThirdPartyBookmarks>false</RemoveNokiaThirdPartyBookmarks>
+ <TopPriorityBookmarkItem extensionPolicy="replace">
+ <Name>Tre IOP XHTML</Name>
+ <URL>http://rave.cellulardata.com/xhtml/index.xhtml</URL>
+ </TopPriorityBookmarkItem>
+ <CustomerBookmarkItem extensionPolicy="replace">
+ <Name>Geocaching.hu</Name>
+ <URL>http://geocaching.hu/wap</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Test sites</Name>
+ <URL></URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DDT</Name>
+ <URL>http://ammo.factory.cellulardata.com:8000/ddt</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DDT (no cookies)</Name>
+ <URL>http://ammo.factory.cellulardata.com:8000/ddtnc</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Digdown</Name>
+ <URL>http://digdown1.extra.wirelessfuture.com/ddtnc</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DLS 2.0 S60</Name>
+ <URL>http://trsrv42.wirelessfuture.com/content/s60/index.wml</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DLS 2.0 IOP</Name>
+ <URL>http://www.it.cellulardata.com/iop/dls20/index.wml</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Wirelessfuture</Name>
+ <URL>http://trsrv29.extra.wirelessfuture.com/drm/index.wml</URL>
+ </CustomerBookmarkItem>
+ <NokiaBookmarkItem extensionPolicy="append">
+ <Name>User agent</Name>
+ <URL>http://testsuite.nokia-boston.com/content/wml_ua/wmlheader.asp</URL>
+ <Tag1>Tag1</Tag1>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Google</Name>
+ <URL>http://www.google.com</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Eco</Name>
+ <URL>http://wap.eco.hu</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Stop!</Name>
+ <URL>http://wap.stop.hu</URL>
+ <Tag1>Tag1</Tag1>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Report Browser Bugs</Name>
+ <URL>http://waplabdc.nokia-boston.com/browser/users/Kimono/errorEmail/error.asp</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>OSS Browser Report</Name>
+ <URL>http://waplabdc.nokia-boston.com/browser/users/OSSBrowser/errorEmail/error.asp</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Google</Name>
+ <URL>Http://www.google.com</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name/>
+ <URL/>
+ </NokiaBookmarkItem>
+ <ThirdPartyBookmarkItem extensionPolicy="append">
+ <Name>XHTML -IOP</Name>
+ <URL>http://rave.cellulardata.com/xhtml/index.xhtml</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>TCG</Name>
+ <URL>http://testsuite.nokia-boston.com</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>Widgets</Name>
+ <URL>http://widgets.nokia-boston.com</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>S60 Acceptance Test</Name>
+ <URL>http://testsuite.nokia-boston.com/s60accept/qstart.asp</URL>
+ </ThirdPartyBookmarkItem>
+ <CustomerTopPriorityBookmarkItem
+ extensionPolicy="replace">
+ <Name>Tre IOP WML</Name>
+ <URL>http://195.134.227.137/1.wml</URL>
+ </CustomerTopPriorityBookmarkItem>
+ </BookmarkItems>
+ </data>
+</configuration>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/conf/BookmarkItems.gcfml Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,272 @@
+<file xmlns="http://www.s60.com/xml/genconfml/1" name="bookmarks.xml"
+ target="private/10008d39">
+ <setting ref="BookmarkItems/*"/>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0" xmlns:xi="http://www.w3.org/2001/xinclude">
+ <xsl:output encoding="UTF-8" method="xbel" indent="yes"
+ omit-xml-declaration="yes"/>
+ <xsl:template match="configuration/data">
+ <xbel version="1.0">
+
+ <!-- Customer Top Priority Bookmark -->
+ <xsl:comment> ======= Customer Top Priority Bookmark Item ======= </xsl:comment>
+
+ <xsl:for-each
+ select="BookmarkItems/CustomerTopPriorityBookmarkItem[URL and URL!='']">
+ <bookmark>
+ <xsl:attribute name="href"><xsl:value-of
+ select="URL"/></xsl:attribute>
+ <title>
+ <xsl:value-of select="Name"/>
+ </title>
+ <xsl:if test="Tag1!='' or Tag2!='' or Tag3!='' or Tag4!=''">
+ <info>
+ <metadata owner="http://www.nokia.com/bookmarks.xsd">
+ <tags>
+ <xsl:if test="Tag1!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag1"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag2!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag2"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag3!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag3"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag4!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag4"/>
+ </tag>
+ </xsl:if>
+ </tags>
+ </metadata>
+ </info>
+ </xsl:if>
+ </bookmark>
+ </xsl:for-each>
+
+ <!-- Top Priority Bookmark -->
+
+ <xsl:comment> ======= Top Priority Bookmark Item ======= </xsl:comment>
+
+ <xsl:for-each
+ select="BookmarkItems/TopPriorityBookmarkItem[URL and URL!='']">
+ <bookmark>
+ <xsl:attribute name="href"><xsl:value-of
+ select="URL"/></xsl:attribute>
+ <title>
+ <xsl:value-of select="Name"/>
+ </title>
+ <xsl:if test="Tag1!='' or Tag2!='' or Tag3!='' or Tag4!=''">
+ <info>
+ <metadata owner="http://www.nokia.com/bookmarks.xsd">
+ <tags>
+ <xsl:if test="Tag1!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag1"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag2!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag2"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag3!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag3"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag4!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag4"/>
+ </tag>
+ </xsl:if>
+ </tags>
+ </metadata>
+ </info>
+ </xsl:if>
+ </bookmark>
+ </xsl:for-each>
+
+ <!-- Customer Bookmarks -->
+ <xsl:comment> ======= Customer Bookmark Items ======= </xsl:comment>
+
+ <xsl:for-each
+ select="BookmarkItems/CustomerBookmarkItem[URL and URL!='']">
+ <bookmark>
+ <xsl:attribute name="href">
+ <xsl:value-of select="URL"/>
+ </xsl:attribute>
+ <title>
+ <xsl:value-of select="Name"/>
+ </title>
+ <xsl:if test="Tag1!='' or Tag2!='' or Tag3!='' or Tag4!=''">
+ <info>
+ <metadata owner="http://www.nokia.com/bookmarks.xsd">
+ <tags>
+ <xsl:if test="Tag1!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag1"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag2!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag2"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag3!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag3"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag4!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag4"/>
+ </tag>
+ </xsl:if>
+ </tags>
+ </metadata>
+ </info>
+ </xsl:if>
+ </bookmark>
+ </xsl:for-each>
+ <xsl:comment> ======= End Customer Bookmark Items ======= </xsl:comment>
+
+ <!-- Nokia Bookmarks -->
+ <xsl:choose>
+ <xsl:when test="BookmarkItems/RemoveNokiaBookmarks='false'">
+
+ <xsl:comment> ======= Nokia Bookmark Items ======= </xsl:comment>
+
+ <xsl:for-each
+ select="BookmarkItems/NokiaBookmarkItem[URL and URL!='']">
+ <bookmark>
+ <xsl:attribute name="href">
+ <xsl:value-of select="URL"/>
+ </xsl:attribute>
+ <title>
+ <xsl:value-of select="Name"/>
+ </title>
+ <xsl:if
+ test="Tag1!='' or Tag2!='' or Tag3!='' or Tag4!=''">
+ <info>
+ <metadata owner="http://www.nokia.com/bookmarks.xsd">
+ <tags>
+ <xsl:if test="Tag1!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag1"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag2!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag2"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag3!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag3"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag4!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag4"/>
+ </tag>
+ </xsl:if>
+ </tags>
+ </metadata>
+ </info>
+ </xsl:if>
+ </bookmark>
+ </xsl:for-each>
+ <xsl:comment> ======= End Nokia Bookmark Items ======= </xsl:comment>
+ </xsl:when>
+ <xsl:otherwise>
+
+ <xsl:comment> ======= Nokia Bookmarks Removed ======= </xsl:comment>
+
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Third Party Bookmarks -->
+ <xsl:choose>
+ <xsl:when
+ test="BookmarkItems/RemoveNokiaThirdPartyBookmarks='false'">
+
+ <xsl:comment> ======= Third Party Bookmark Items ======= </xsl:comment>
+
+ <xsl:for-each
+ select="BookmarkItems/ThirdPartyBookmarkItem[URL and URL!='']">
+ <bookmark>
+ <xsl:attribute name="href"><xsl:value-of
+ select="URL"/></xsl:attribute>
+ <title>
+ <xsl:value-of select="Name"/>
+ </title>
+ <xsl:if
+ test="Tag1!='' or Tag2!='' or Tag3!='' or Tag4!=''">
+ <info>
+ <metadata owner="http://www.nokia.com/bookmarks.xsd">
+ <tags>
+ <xsl:if test="Tag1!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag1"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag2!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag2"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag3!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag3"/>
+ </tag>
+ </xsl:if>
+ <xsl:if test="Tag4!=''">
+ <tag>
+ <xsl:value-of
+ select="Tag4"/>
+ </tag>
+ </xsl:if>
+ </tags>
+ </metadata>
+ </info>
+ </xsl:if>
+ </bookmark>
+ </xsl:for-each>
+ <xsl:comment> ======= End Third Party Bookmark Items ======= </xsl:comment>
+ </xsl:when>
+ <xsl:otherwise>
+
+ <xsl:comment> ======= Third Party Bookmarks Removed ======= </xsl:comment>
+
+ </xsl:otherwise>
+ </xsl:choose>
+ </xbel>
+ </xsl:template>
+ </xsl:stylesheet>
+</file>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/conf/CI_bookmarks.confml Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://www.s60.com/xml/confml/2" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="BrowserBookmarks">
+ <feature ref="BookmarkItems" name="BookmarkItems">
+ <setting ref="RemoveNokiaBookmarks" name="Remove All Nokia bookmarks" type="boolean">
+ <desc>If selected all Nokia bookmarks are removed.</desc>
+ </setting>
+ <setting ref="RemoveNokiaThirdPartyBookmarks" name="Remove All Third party bookmarks" type="boolean">
+ <desc>If selected all Third party bookmarks are removed.</desc>
+ </setting>
+ <setting ref="NokiaBookmarkItem" mapKey="Name" mapValue="Name" name="BookmarkItem" type="sequence" minOccurs="0" maxOccurs="16">
+ <desc>TBD</desc>
+ <setting ref="Name" name="Name Of The New Entry" type="string">
+ <desc>Text field containing name for the Bookmark. Must be unique.</desc>
+ </setting>
+ <setting ref="URL" name="URL Of The Bookmark" type="string">
+ <xs:pattern value="((ftp|wap|http(|s))://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ <desc>Text of the full URL for a Bookmark.(e.g. http://my.server.com)</desc>
+ </setting>
+ </setting>
+ <setting ref="ThirdPartyBookmarkItem" mapKey="Name" mapValue="Name" name="Third Party BookmarkItem" type="sequence" minOccurs="0" maxOccurs="16">
+ <desc>Add Description.</desc>
+ <setting ref="Name" name="Name Of The New Entry" type="string">
+ <desc>Text field containing name for the Bookmark. Must be unique.</desc>
+ </setting>
+ <setting ref="URL" name="URL Of The Bookmark" type="string">
+ <xs:pattern value="((ftp|wap|http(|s))://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ <desc>Text of the full URL for a Bookmark.(e.g. http://my.server.com)</desc>
+ </setting>
+ </setting>
+ <setting ref="CustomerBookmarkItem" mapKey="Name" mapValue="Name" name="Customer BookmarkItem" type="sequence" minOccurs="0" maxOccurs="99">
+ <desc>Add Description.</desc>
+ <setting ref="Name" name="Name Of The New Entry" type="string">
+ <desc>Text field containing name for the Bookmark. Must be unique.</desc>
+ </setting>
+ <setting ref="URL" name="URL Of The Bookmark" type="string">
+ <xs:pattern value="((ftp|wap|http(|s))://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ <desc>Text of the full URL for a Bookmark. (e.g. http://my.server.com)</desc>
+ </setting>
+ </setting>
+ <setting ref="TopPriorityBookmarkItem" mapKey="Name" mapValue="Name" name="Top Priority BookmarkItem" type="sequence" minOccurs="0" maxOccurs="1">
+ <desc>Add Description.</desc>
+ <setting ref="Name" name="Name Of The New Entry" type="string">
+ <desc>Text field containing name for the Bookmark. Must be unique.</desc>
+ </setting>
+ <setting ref="URL" name="URL Of The Bookmark" type="string">
+ <xs:pattern value="((ftp|wap|http(|s))://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ <desc>Text of the full URL for a Bookmark. (e.g. http://my.server.com)</desc>
+ </setting>
+ </setting>
+ <setting ref="CustomerTopPriorityBookmarkItem" mapKey="Name" mapValue="Name" name="Customer Top Priority BookmarkItem" type="sequence" minOccurs="0" maxOccurs="1">
+ <desc>Add Description.</desc>
+ <setting ref="Name" name="Name Of The New Entry" type="string">
+ <desc>Text field containing name for the Bookmark. Must be unique.</desc>
+ </setting>
+ <setting ref="URL" name="URL Of The Bookmark" type="string">
+ <xs:pattern value="((ftp|wap|http(|s))://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ <desc>Text of the full URL for a Bookmark. (e.g. http://my.server.com)</desc>
+ </setting>
+ </setting>
+ </feature>
+ <!--<xi:include href="./BookmarkData.confml"/>-->
+ <data>
+ <BookmarkItems>
+ <RemoveNokiaBookmarks>false</RemoveNokiaBookmarks>
+ <RemoveNokiaThirdPartyBookmarks>false</RemoveNokiaThirdPartyBookmarks>
+ <TopPriorityBookmarkItem extensionPolicy="replace">
+ <Name>Tre IOP XHTML</Name>
+ <URL>http://rave.cellulardata.com/xhtml/index.xhtml</URL>
+ </TopPriorityBookmarkItem>
+ <CustomerBookmarkItem extensionPolicy="replace">
+ <Name>Geocaching.hu</Name>
+ <URL>http://geocaching.hu/wap</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Test sites</Name>
+ <URL></URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DDT</Name>
+ <URL>http://ammo.factory.cellulardata.com:8000/ddt</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DDT (no cookies)</Name>
+ <URL>http://ammo.factory.cellulardata.com:8000/ddtnc</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Digdown</Name>
+ <URL>http://digdown1.extra.wirelessfuture.com/ddtnc</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DLS 2.0 S60</Name>
+ <URL>http://trsrv42.wirelessfuture.com/content/s60/index.wml</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>DLS 2.0 IOP</Name>
+ <URL>http://www.it.cellulardata.com/iop/dls20/index.wml</URL>
+ </CustomerBookmarkItem>
+ <CustomerBookmarkItem>
+ <Name>Wirelessfuture</Name>
+ <URL>http://trsrv29.extra.wirelessfuture.com/drm/index.wml</URL>
+ </CustomerBookmarkItem>
+ <NokiaBookmarkItem extensionPolicy="append">
+ <Name>User agent</Name>
+ <URL>http://testsuite.nokia-boston.com/content/wml_ua/wmlheader.asp</URL>
+ <Tag1>Tag1</Tag1>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Google</Name>
+ <URL>http://www.google.com</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Eco</Name>
+ <URL>http://wap.eco.hu</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Stop!</Name>
+ <URL>http://wap.stop.hu</URL>
+ <Tag1>Tag1</Tag1>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Report Browser Bugs</Name>
+ <URL>http://waplabdc.nokia-boston.com/browser/users/Kimono/errorEmail/error.asp</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>OSS Browser Report</Name>
+ <URL>http://waplabdc.nokia-boston.com/browser/users/OSSBrowser/errorEmail/error.asp</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name>Google</Name>
+ <URL>Http://www.google.com</URL>
+ </NokiaBookmarkItem>
+ <NokiaBookmarkItem>
+ <Name/>
+ <URL/>
+ </NokiaBookmarkItem>
+ <ThirdPartyBookmarkItem extensionPolicy="append">
+ <Name>XHTML -IOP</Name>
+ <URL>http://rave.cellulardata.com/xhtml/index.xhtml</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>TCG</Name>
+ <URL>http://testsuite.nokia-boston.com</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>Widgets</Name>
+ <URL>http://widgets.nokia-boston.com</URL>
+ </ThirdPartyBookmarkItem>
+ <ThirdPartyBookmarkItem>
+ <Name>S60 Acceptance Test</Name>
+ <URL>http://testsuite.nokia-boston.com/s60accept/qstart.asp</URL>
+ </ThirdPartyBookmarkItem>
+ <CustomerTopPriorityBookmarkItem
+ extensionPolicy="replace">
+ <Name>Tre IOP WML</Name>
+ <URL>http://195.134.227.137/1.wml</URL>
+ </CustomerTopPriorityBookmarkItem>
+ </BookmarkItems>
+ </data>
+</configuration>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/conf/bookmarks.xml Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,38 @@
+<xbel version="1.0">
+ <bookmark href="http://testsuite.nokia-boston.com" >
+ <title>TCG</title>
+ </bookmark>
+ <bookmark href="http://iop1.nokia-boston.com/index.html" >
+ <title>Browser 8.x NFT</title>
+ </bookmark>
+ <bookmark href="http://browser.nokia.com/testing/" >
+ <title>Browser Testing Center</title>
+ </bookmark>
+ <bookmark href="http://testsuite.nokia-boston.com/HTML5/index.html" >
+ <title>HTML 5 test page</title>
+ </bookmark>
+ <bookmark href="http://www.nokia.com" >
+ <title>Nokia</title>
+ </bookmark>
+ <bookmark href="http://www.ovi.com" >
+ <title>OVI</title>
+ </bookmark>
+ <bookmark href="http://www.google.com" >
+ <title>Google</title>
+ </bookmark>
+ <bookmark href="http://www.gmail.com" >
+ <title>GMail</title>
+ </bookmark>
+ <bookmark href="http://www.cnn.com" >
+ <title>CNN</title>
+ </bookmark>
+ <bookmark href="http://www.whatsmayuseragent.com" >
+ <title>What's my user agent?</title>
+ </bookmark>
+ <bookmark href="http://www.youtube.com" >
+ <title>Youtube</title>
+ </bookmark>
+ <bookmark href="http://www.iltasanomat.fi" >
+ <title>Iltasanomat</title>
+ </bookmark>
+</xbel>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/defaultBookmarks.xml.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,84 @@
+/*
+ * defaultBookmarks.xml.h
+ *
+ * Created on: Aug 20, 2010
+ * Author: chriwhit
+ */
+
+#ifndef DEFAULTBOOKMARKS_XML_H_
+#define DEFAULTBOOKMARKS_XML_H_
+
+#include "bookmarksapi.h"
+
+extern const QString defaultBookmarksList = "<!DOCTYPE xbel>\n\
+<xbel version='1.0'>\n\
+ <bookmark href='http://www.nokia.com'>\n\
+ <title>Nokia</title>\n\
+ <info>\n\
+ <metadata owner='http://nokia.com' >\n\
+ <tags>\n\
+ <tag>nokia</tag>\n\
+ <tag>default</tag>\n\
+ </tags>\n\
+ </metadata>\n\
+ </info>\n\
+ <desc></desc>\n\
+ </bookmark>\n\
+ <bookmark href='http://www.google.com'>\n\
+ <title>Google</title>\n\
+ <info>\n\
+ <metadata owner='http://nokia.com' >\n\
+ <tags>\n\
+ <tag>google</tag>\n\
+ <tag>nokia</tag> \n\
+ <tag>search</tag>\n\
+ <tag>default</tag>\n\
+ </tags>\n\
+ </metadata>\n\
+ </info>\n\
+ <desc></desc>\n\
+ </bookmark> \n\
+ <bookmark href='http://www.yahoo.com'>\n\
+ <title>Yahoo</title>\n\
+ <info>\n\
+ <metadata owner='http://nokia.com' >\n\
+ <tags>\n\
+ <tag>yahoo</tag>\n\
+ <tag>nokia</tag>\n\
+ <tag>search</tag>\n\
+ <tag>default</tag>\n\
+ </tags>\n\
+ </metadata>\n\
+ </info>\n\
+ <desc></desc>\n\
+ </bookmark>\n\
+ <bookmark href='http://www.gmail.com'>\n\
+ <title>Google Mail</title>\n\
+ <info>\n\
+ <metadata owner='http://nokia.com' >\n\
+ <tags>\n\
+ <tag>google</tag>\n\
+ <tag>email</tag>\n\
+ <tag>nokia</tag>\n\
+ <tag>default</tag>\n\
+ </tags>\n\
+ </metadata>\n\
+ </info>\n\
+ <desc></desc>\n\
+ </bookmark>\n\
+ <bookmark href='http://www.ovi.com/services/'>\n\
+ <title>Nokia Ovi Services</title>\n\
+ <info>\n\
+ <metadata owner='http://nokia.com' >\n\
+ <tags>\n\
+ <tag>ovi</tag>\n\
+ <tag>nokia</tag>\n\
+ <tag>default</tag>\n\
+ </tags>\n\
+ </metadata>\n\
+ </info>\n\
+ <desc></desc>\n\
+ </bookmark>\n\
+</xbel>";
+
+#endif /* DEFAULTBOOKMARKS_XML_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/xbel-1.0.dtd Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,94 @@
+<!-- This is the XML Bookmarks Exchange Language, version 1.0. It
+ should be used with the formal public identifier:
+
+ +//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML
+
+ One valid system identifier at which this DTD will remain
+ available is:
+
+ http://pyxml.sourceforge.net/topics/dtds/xbel-1.0.dtd
+
+ More information on the DTD, including reference
+ documentation, is available at:
+
+ http://www.python.org/topics/xml/xbel/
+
+ Attributes which take date/time values should encode the value
+ according to the W3C NOTE on date/time formats:
+
+ http://www.w3.org/TR/NOTE-datetime
+ -->
+
+
+<!-- Customization entities. Define these before "including" this DTD
+ to create "subclassed" DTDs.
+ -->
+<!ENTITY % local.node.att "">
+<!ENTITY % local.url.att "">
+<!ENTITY % local.nodes.mix "">
+
+<!ENTITY % node.att "id ID #IMPLIED
+ added CDATA #IMPLIED
+ %local.node.att;">
+
+<!ENTITY % url.att "href CDATA #REQUIRED
+ visited CDATA #IMPLIED
+ modified CDATA #IMPLIED
+ %local.url.att;">
+
+<!ENTITY % nodes.mix "bookmark|folder|alias|separator
+ %local.nodes.mix;">
+
+
+<!ELEMENT xbel (title?, info?, desc?, (%nodes.mix;)*)>
+<!ATTLIST xbel
+ %node.att;
+ version CDATA #FIXED "1.0"
+>
+<!ELEMENT title (#PCDATA)>
+
+<!--=================== Info ======================================-->
+
+<!ELEMENT info (metadata+)>
+
+<!ELEMENT metadata EMPTY>
+<!ATTLIST metadata
+ owner CDATA #REQUIRED
+>
+
+<!--=================== Folder ====================================-->
+
+<!ELEMENT folder (title?, info?, desc?, (%nodes.mix;)*)>
+<!ATTLIST folder
+ %node.att;
+ folded (yes|no) 'yes'
+>
+
+<!--=================== Bookmark ==================================-->
+
+<!ELEMENT bookmark (title?, info?, desc?)>
+<!ATTLIST bookmark
+ %node.att;
+ %url.att;
+>
+
+<!ELEMENT desc (#PCDATA)>
+
+<!--=================== Separator =================================-->
+
+<!ELEMENT separator EMPTY>
+
+<!--=================== Alias =====================================-->
+
+<!-- <alias> elements correspond to Netscape bookmark aliases. The
+ required "ref" attribute must refer to a <bookmark> or <folder>
+ element. Note that MSIE aliases can refer to folders, so that is
+ supported in XBEL. Applications must be careful about traversing
+ aliases to folders to avoid improper recursion through circular
+ data structures.
+ -->
+
+<!ELEMENT alias EMPTY>
+<!ATTLIST alias
+ ref IDREF #REQUIRED
+>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/xbelreader.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+*/
+#include <QXmlStreamReader>
+#include <QIODevice>
+#include <QList>
+
+#include "xbelreader.h"
+#include "BookmarksManager.h"
+
+XbelReader::XbelReader(BookmarksManager *bmgr) :
+ m_bmgr(bmgr), m_xml(new QXmlStreamReader)
+{
+}
+
+XbelReader::~XbelReader() {
+ if(m_xml) delete m_xml;
+}
+
+bool XbelReader::read(QIODevice *device)
+{
+ if(!device) {
+ m_xml->raiseError(QObject::tr("Invalid Device passed into XBEL Reader."));
+ }
+ if(!m_bmgr) {
+ m_xml->raiseError(QObject::tr("Invalid BookmarkManager passed into XBEL Reader."));
+ } else {
+ m_xml->setDevice(device);
+ if(m_xml->readNextStartElement()) {
+ if(m_xml->name() == "xbel" &&
+ m_xml->attributes().value("version") == "1.0")
+ readXBEL();
+ else
+ m_xml->raiseError(QObject::tr("The file is not an XBEL version 1.0 file."));
+ } else
+ m_xml->raiseError(QObject::tr("The file is not an XBEL version 1.0 file."));
+ }
+
+ return !m_xml->error();
+}
+
+/**
+ * This function should be called before reading any xml elements
+ * It attempts to validate that the file being read is actually an
+ * xbel file.
+ * @return whether the file is an XBEL file.
+ */
+bool XbelReader::isValidXbel()
+{
+ // The xbel element must exist and must be version 1.0
+ return true;
+}
+
+QString XbelReader::errorString() const
+{
+ return QObject::tr("%1\nLine %2, column %3")
+ .arg(m_xml->errorString())
+ .arg(m_xml->lineNumber())
+ .arg(m_xml->columnNumber());
+}
+
+void XbelReader::readXBEL()
+{
+ QString folder = "";
+ QList<QString> folders;
+ while (m_xml->readNextStartElement()) {
+ if (m_xml->name() == "folder")
+ readFolder(folders);
+ else if (m_xml->name() == "bookmark")
+ readBookmark(folders);
+ else
+ m_xml->skipCurrentElement();
+ }
+}
+
+QString XbelReader::readFolder(QList<QString>& parentFolders)
+{
+ QString folderName = "";
+
+ while (m_xml->readNextStartElement()) {
+ if (m_xml->name() == "title")
+ folderName = m_xml->readElementText();
+ else if (m_xml->name() == "folder") {
+ QList<QString> folders;
+ folders = folders + parentFolders;
+ if(!folderName.isEmpty())
+ folders.append(folderName);
+ readFolder(folders);
+ } else if (m_xml->name() == "bookmark") {
+ QList<QString> folders;
+ folders = folders + parentFolders;
+ if(!folderName.isEmpty())
+ folders.append(folderName);
+ readBookmark(folders);
+ } else
+ m_xml->skipCurrentElement();
+ }
+ return folderName;
+}
+
+void XbelReader::readBookmark(QList<QString>& parentFolders)
+{
+ QXmlStreamAttributes attrs = m_xml->attributes();
+
+ // if there is no URL attribute skip this bookmark.
+ if(!attrs.hasAttribute("href")) {
+ m_xml->skipCurrentElement();
+ return;
+ }
+
+ QString url = attrs.value("href").toString();
+ QString title = "Untitled";
+ QString desc = "";
+ QList<QString> tags;
+ tags = tags + parentFolders;
+
+ while (m_xml->readNextStartElement()) {
+ if (m_xml->name() == "title")
+ title = m_xml->readElementText();
+ else if(m_xml->name() == "desc")
+ desc = m_xml->readElementText();
+ else if(m_xml->name() == "info")
+ readInfo(tags);
+ else
+ m_xml->skipCurrentElement();
+ }
+
+ int bmID = m_bmgr->addBookmark(title, url);
+ if (bmID > 0) {
+ QList<QString>::iterator iter;
+ for (iter = tags.begin(); iter != tags.end(); ++iter)
+ m_bmgr->addTag(bmID, *iter);
+ }
+}
+
+/**
+ * Reads the info element.
+ * @param tags - A reference to a list of string tags
+ */
+void XbelReader::readInfo(QList<QString>& tags)
+{
+ QString owner = "http://www.nokia.com";
+ while(m_xml->readNextStartElement()) {
+ if(m_xml->name() == "metadata")
+ readMetadata(tags, owner);
+ else
+ m_xml->skipCurrentElement();
+ }
+}
+
+/**
+ * This function reads the metadata XBEL tag.
+ * @param tags - A reference to a list of strings. This is passed into
+ * readTags.
+ * @param owner - A reference to the owner string. This is to allow for
+ * future support for this attribute.
+ */
+void XbelReader::readMetadata(QList<QString>& tags, QString &owner)
+{
+ if(m_xml->attributes().hasAttribute("owner"))
+ owner = m_xml->attributes().value("owner").toString();
+ while(m_xml->readNextStartElement()) {
+ if(m_xml->name() == "tags")
+ readTags(tags);
+ else
+ m_xml->skipCurrentElement();
+ }
+
+}
+
+/**
+ * Reads the tags and tag attributes, adding all tags found to
+ * the list of string tags passed into the function.
+ * @param tags - Reference to a list of string tags.
+ */
+void XbelReader::readTags(QList<QString>& tags)
+{
+ while(m_xml->readNextStartElement()) {
+ if(m_xml->name() == "tag")
+ tags.append(m_xml->readElementText());
+ else
+ m_xml->skipCurrentElement();
+ }
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/xbelreader.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+*/
+#ifndef XBELREADER_H
+#define XBELREADER_H
+
+#include <QString>
+
+class BookmarksManager;
+class QXmlStreamReader;
+class QIODevice;
+
+/*
+ * Reads an XBEL file and imports bookmarks
+ * Folders are treated as "tags"
+ * i.e. bookmarks inside folders are imported one at a time and the folder name is added as a tag for that bookmark
+ */
+class XbelReader
+{
+public: // ctor/dtor
+ XbelReader(BookmarksManager *bmgr);
+ virtual ~XbelReader();
+
+public: // members
+ bool read(QIODevice *device);
+ QString errorString() const;
+
+private:
+ bool isValidXbel();
+ void readXBEL();
+ QString readFolder(QList<QString>& parentFolders);
+ void readBookmark(QList<QString>& parentFolders);
+ void readInfo(QList<QString>& tags);
+ void readMetadata(QList<QString>& tags, QString &owner);
+ void readTags(QList<QString>& tags);
+
+ BookmarksManager *m_bmgr;
+ QXmlStreamReader *m_xml;
+};
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/xbelwriter.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+*/
+
+#include <QString>
+#include <QXmlStreamWriter>
+#include <QIODevice>
+#include <QDebug>
+
+#include "xbelwriter.h"
+#include "BookmarksManager.h"
+#include "BookmarkFav.h"
+#include "BookmarkResults.h"
+#include "TagResults.h"
+
+
+XbelWriter::XbelWriter(BookmarksManager *bmgr)
+ : m_bmgr(bmgr), m_xml(new QXmlStreamWriter())
+{
+}
+
+XbelWriter::~XbelWriter() {
+ if(m_xml) delete m_xml;
+}
+
+bool XbelWriter::writeFile(QIODevice *device)
+{
+ bool retVal = false;
+ if(device && m_bmgr) {
+ m_xml->setDevice(device);
+ m_xml->setAutoFormatting(true);
+
+ m_xml->writeStartDocument();
+ m_xml->writeDTD("<!DOCTYPE xbel>");
+ m_xml->writeStartElement("xbel");
+ m_xml->writeAttribute("version", "1.0");
+
+ BookmarkResults *bookmarks = m_bmgr->findAllBookmarks();
+ if(bookmarks) {
+ while (BookmarkFav *bm = bookmarks->nextBookmark()) {
+ if(!bm->url().isEmpty())
+ writeBookmark(bm);
+ delete bm;
+ bm = NULL;
+ }
+ delete bookmarks;
+ }
+ m_xml->writeEndElement(); // xbel
+ m_xml->writeEndDocument();
+ retVal = true;
+ }
+ return retVal;
+}
+
+void XbelWriter::writeBookmark(BookmarkFav *bm)
+{
+ m_xml->writeStartElement("bookmark");
+ m_xml->writeAttribute("href", bm->url());
+ m_xml->writeTextElement("title", bm->title());
+ writeTags(bm->id());
+ m_xml->writeEndElement(); // bookmark
+}
+
+void XbelWriter::writeTags(int bmId)
+{
+ if(bmId > 0) {
+
+ TagResults * tr = m_bmgr->findTagsByBookmark(bmId);
+
+ if(tr) {
+ m_xml->writeStartElement("info");
+ m_xml->writeStartElement("metadata");
+ m_xml->writeAttribute("owner", "http://www.nokia.com");
+ m_xml->writeStartElement("tags");
+ try {
+ while(QString * tag = tr->nextTag()) {
+ m_xml->writeTextElement("tag", *tag);
+ delete tag;
+ tag = NULL;
+ }
+ } catch(...) {
+ qDebug() << "Exception Thrown while writing tags.";
+ }
+
+ m_xml->writeEndElement(); // tags
+ m_xml->writeEndElement(); // metadata
+ m_xml->writeEndElement(); // info
+ delete tr;
+ }
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmarks/xbelwriter.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+*/
+#ifndef XBELWRITER_H
+#define XBELWRITER_H
+
+class BookmarksManager;
+class BookmarkFav;
+class QXmlStreamWriter;
+class QIODevice;
+
+/*
+ * This will export all bookmarks
+ * Each tag will be treated as a folder, so the bookmarks will be output by tag
+ * (there will be duplicates if a bookmark has more than one tag)
+ * Then any bookmarks that don't have tags will be written out into the top level
+ */
+class XbelWriter
+{
+public: // ctor/dtor
+ XbelWriter(BookmarksManager *bmgr);
+ virtual ~XbelWriter();
+
+public: // members
+ bool writeFile(QIODevice *device);
+
+private:
+ void writeBookmark(BookmarkFav * bm);
+ void writeTags(int bmId);
+
+ QXmlStreamWriter *m_xml;
+ BookmarksManager *m_bmgr;
+};
+
+#endif
--- a/bookmarksengine/Bookmarkstestui/Bookmarkstestui.pro Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/Bookmarkstestui/Bookmarkstestui.pro Mon Oct 04 00:29:21 2010 +0300
@@ -96,3 +96,6 @@
symbian: {
INCLUDEPATH += $$PWD $$MW_LAYER_SYSTEMINCLUDE $$APP_LAYER_SYSTEMINCLUDE
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/bookmarksengine/bookmarksclient/bookmarksclient.pro Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/bookmarksclient/bookmarksclient.pro Mon Oct 04 00:29:21 2010 +0300
@@ -106,3 +106,6 @@
DEPLOYMENT += BookMarksClientlibs
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/bookmarksengine/bookmarksserver/BookmarksServer.pro Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/bookmarksserver/BookmarksServer.pro Mon Oct 04 00:29:21 2010 +0300
@@ -90,3 +90,6 @@
symbian: {
INCLUDEPATH += $$PWD $$MW_LAYER_SYSTEMINCLUDE $$APP_LAYER_SYSTEMINCLUDE
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/bookmarksengine/browsercontentdll/browsercontentdll.pro Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/browsercontentdll/browsercontentdll.pro Mon Oct 04 00:29:21 2010 +0300
@@ -102,3 +102,6 @@
DEPLOYMENT += browsercontentdlllibs
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/bookmarksengine/browsercontentdll/inc/browsercontentdll.h Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/browsercontentdll/inc/browsercontentdll.h Mon Oct 04 00:29:21 2010 +0300
@@ -27,6 +27,8 @@
#include<QtGui>
+static const char KDOUBLEQUOTE[] = """;
+static const char KBACKSLASH[] = "\";
class BrowserContentPrivate;
class BOOKMARKSCONTENTDLL_EXPORT BookmarkLeaf {
@@ -137,6 +139,7 @@
QString fetchSerializedBookmarks();
void fetchSerializedHistory(QVector<QString> &folderVector,QMap<QString,QString> &mymap);
void fetchAllBookmarkTitles(QVector<QString> &title);
+ QMap<QString, QString> findSimilarHistoryItems(QString atitle);
private:
int createDatabase();
--- a/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp Fri Sep 17 08:30:56 2010 +0300
+++ b/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -400,7 +400,13 @@
QString title = query.value(0).toString();
if(title.contains("\"", Qt::CaseInsensitive))
title.replace(QString("\""), QString("""));
+ //--Encoding backslash used in title--
+ if(title.contains("\\", Qt::CaseInsensitive))
+ title.replace(QString("\\"), QString(KBACKSLASH));
QString url = query.value(1).toString();
+ //--Encoding doublequote used in title--
+ if(url.contains("\"", Qt::CaseInsensitive))
+ url.replace(QString("\""), QString(KDOUBLEQUOTE));
int aIndex=query.value(2).toInt(&ok);
uint timest = query.value(3).toUInt();
QDateTime dtime=QDateTime::fromTime_t ( timest );
@@ -650,8 +656,13 @@
if(title.contains("\"", Qt::CaseInsensitive))
title.replace(QString("\""), QString("""));
+ if(title.contains("\\", Qt::CaseInsensitive))
+ title.replace(QString("\\"), QString(KBACKSLASH));
QString url = query.value(1).toString();
+ //--Encoding URL--
+ QUrl url1(url);
+ url = QString::fromUtf8(url1.toEncoded());
uint timest = query.value(3).toUInt();
QDateTime dtime=QDateTime::fromTime_t ( timest );
QDate adate=dtime.date();
@@ -773,3 +784,28 @@
return false;
}
+
+QMap<QString, QString> BrowserContent::findSimilarHistoryItems(QString atitle)
+{
+ BOOKMARKSCLIENT_PRIVATEPTR(BrowserContent);
+ QSqlDatabase db = QSqlDatabase::database(priv->m_connectionName);
+
+ QMap<QString, QString> map;
+
+ if (db.isOpen()){
+ QSqlQuery query(db);
+
+ QString queryStatement = "SELECT url, pageTitle FROM HistoryTable WHERE pageTitle LIKE '%"+atitle+"%' OR url LIKE '%" + atitle + "%'";
+ query.prepare(queryStatement);
+ if(query.exec()) {
+ while (query.next()){
+ QString HistoryUrl = query.value(0).toString();
+ QString HistoryTitle = query.value(1).toString();
+ map.insert( HistoryUrl, HistoryTitle );
+ }
+ } else {
+ QSqlError error = query.lastError();
+ }
+ }
+ return map;
+}
--- a/browser.pro Fri Sep 17 08:30:56 2010 +0300
+++ b/browser.pro Mon Oct 04 00:29:21 2010 +0300
@@ -21,4 +21,8 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += bookmarksengine
+SUBDIRS += bookmarks bookmarksengine
+
+symbian: {
+ SUBDIRS += browserrfsplugin
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/200169e9.rss Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description: rss file for browser rfs plugin
+*
+*
+*/
+
+
+
+#include "ecom/registryinfo.rh"
+
+
+
+// Declares info for two implementations
+
+RESOURCE REGISTRY_INFO theInfo
+
+ {
+
+ // UID for the DLL
+
+ dll_uid = 0x200169E9;
+
+ // Declare array of interface info
+
+ interfaces =
+
+ {
+
+ INTERFACE_INFO
+
+ {
+
+ // UID of interface that is implemented
+
+ interface_uid = 0x102073BB;
+
+ implementations =
+
+ {
+
+ IMPLEMENTATION_INFO
+
+ {
+
+ implementation_uid = 0x200169EA;
+
+ version_no = 1;
+
+ display_name = "BrowserRfsPlugin";
+
+ default_data = "ND"; // N = Normal RFS, D = Deep RFS, I = Init RFS (FirstBoot RFS)
+
+ opaque_data = "";
+
+ }
+
+ };
+
+ }
+
+ };
+
+ }
+
+
+
Binary file browserrfsplugin/browserrfs.txt has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/browserrfsplugin.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+
+
+
+
+#include "BrowserRfsPlugin.h"
+
+_LIT(KScriptPath, "z:\\resource\\browserrfs.txt");
+
+CBrowserRfsPlugin::CBrowserRfsPlugin()
+ {
+ }
+
+CBrowserRfsPlugin::CBrowserRfsPlugin(TAny* /*aInitParams*/): CRFSPlugin()
+ {
+ }
+
+
+CBrowserRfsPlugin::~CBrowserRfsPlugin()
+ {
+ }
+
+
+// ---------------------------------------------------------
+// NewL
+// ---------------------------------------------------------
+//
+CBrowserRfsPlugin* CBrowserRfsPlugin::NewL(TAny* aInitParams)
+ {
+ CBrowserRfsPlugin* self = new (ELeave) CBrowserRfsPlugin(aInitParams);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+// ---------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------
+//
+
+void CBrowserRfsPlugin::ConstructL()
+ {
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::ConstructL()"));
+// #endif
+ }
+
+// ---------------------------------------------------------
+// RestoreFactorySettingsL
+// ---------------------------------------------------------
+//
+
+//#ifdef _DEBUG
+void CBrowserRfsPlugin::RestoreFactorySettingsL( const TRfsReason aType )
+{
+// TODO:
+// We can expand the functionalities here further
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::RestoreFactorySettings"));
+// #endif
+}
+
+
+
+
+void CBrowserRfsPlugin::GetScriptL( const TRfsReason aType, TDes& aPath )
+ {
+ aPath.Copy( KScriptPath);
+/* if(aType == EDeepRfs)
+ {
+ aPath.Copy(KScriptPath);
+ }
+*/
+ }
+
+
+
+void CBrowserRfsPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/,
+ TDesC& /*aCommand*/ )
+ {
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::RestoreFactorySettings"));
+// #endif
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/browserrfsplugin.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*
+*/
+
+
+
+
+
+
+#ifndef BROWSERRFSPLUGIN_H
+
+#define BROWSERRFSPLUGIN_H
+
+
+
+
+
+#include <e32base.h>
+
+// #include <f32file.h>
+
+#include <rfsPlugin.h>
+
+
+
+
+
+
+
+class CBrowserRfsPlugin: public CRFSPlugin
+
+ {
+
+public:
+
+
+
+
+
+ static CBrowserRfsPlugin* NewL(TAny* aInitParams);
+
+ virtual ~CBrowserRfsPlugin();
+
+ void RestoreFactorySettingsL( const TRfsReason aType );
+
+ void GetScriptL( const TRfsReason aType, TDes& aPath );
+
+ void ExecuteCustomCommandL( const TRfsReason aType, TDesC& aCommand );
+
+private:
+
+
+
+ CBrowserRfsPlugin();
+
+
+ CBrowserRfsPlugin(TAny* aInitParams);
+
+
+ void ConstructL();
+
+
+
+ };
+
+
+
+
+
+
+
+#endif // BrowserRfsPLUGIN_H
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/browserrfsplugin.pro Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not,
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+
+TEMPLATE = subdirs
+
+symbian {
+
+BLD_INF_RULES.prj_exports += "./browserrfs.txt /epoc32/data/z/resource/browserrfs.txt"
+
+BLD_INF_RULES.prj_mmpfiles = "./group/browserrfsplugin.mmp"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/group/bld.inf Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description: bld.inf for browser rfs plugin.
+*
+*/
+
+
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+
+
+PRJ_MMPFILES
+
+/* ../src/browserrfs.txt /epoc32/data/z/resource/browserrfs.txt */
+
+../group/browserrfsplugin.mmp
+
+
+
+
+
+PRJ_EXPORTS
+
+
+
+
+
+PRJ_TESTMMPFILES
+
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/group/browserrfsplugin.mmp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description: mmp file for browser rfs plugin.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET browserrfsplugin.dll
+
+TARGETTYPE PLUGIN
+
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+
+UID 0x10009D8D 0x200169E9
+
+SOURCEPATH ../src
+SOURCE BrowserRfsPlugin.cpp
+SOURCE Proxy.cpp
+
+START RESOURCE 200169E9.rss
+TARGET browserrfsplugin.rsc
+END
+
+
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/ecom
+
+LIBRARY euser.lib // Base library
+LIBRARY ECom.lib // ECom library
+LIBRARY efsrv.lib // File library
+DEBUGLIBRARY flogger.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/inc/browserrfsplugin.h Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*
+*/
+
+
+
+
+
+
+#ifndef BROWSERRFSPLUGIN_H
+
+#define BROWSERRFSPLUGIN_H
+
+
+
+
+
+#include <e32base.h>
+
+// #include <f32file.h>
+
+#include <rfsPlugin.h>
+
+
+
+
+
+
+
+class CBrowserRfsPlugin: public CRFSPlugin
+
+ {
+
+public:
+
+
+
+
+
+ static CBrowserRfsPlugin* NewL(TAny* aInitParams);
+
+ virtual ~CBrowserRfsPlugin();
+
+ void RestoreFactorySettingsL( const TRfsReason aType );
+
+ void GetScriptL( const TRfsReason aType, TDes& aPath );
+
+ void ExecuteCustomCommandL( const TRfsReason aType, TDesC& aCommand );
+
+private:
+
+
+
+ CBrowserRfsPlugin();
+
+
+ CBrowserRfsPlugin(TAny* aInitParams);
+
+
+ void ConstructL();
+
+
+
+ };
+
+
+
+
+
+
+
+#endif // BrowserRfsPLUGIN_H
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/proxy.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* This class export ECom interface implementations.
+*
+*/
+
+
+
+
+#include <e32std.h>
+
+#include <ecom/implementationproxy.h>
+
+
+
+#include "BrowserRfsPlugin.h"
+
+
+
+// Map the interface UIDs to implementation factory functions
+
+const TImplementationProxy ImplementationTable[] =
+
+ {
+
+ IMPLEMENTATION_PROXY_ENTRY(0x200169EA, CBrowserRfsPlugin::NewL )
+
+ };
+
+
+
+// Exported proxy for instantiation method resolution
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+
+ {
+
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+
+
+ return ImplementationTable;
+
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/src/200169e9.rss Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description: rss file for browser rfs plugin
+*
+*
+*/
+
+
+
+#include "ecom/registryinfo.rh"
+
+
+
+// Declares info for two implementations
+
+RESOURCE REGISTRY_INFO theInfo
+
+ {
+
+ // UID for the DLL
+
+ dll_uid = 0x200169E9;
+
+ // Declare array of interface info
+
+ interfaces =
+
+ {
+
+ INTERFACE_INFO
+
+ {
+
+ // UID of interface that is implemented
+
+ interface_uid = 0x102073BB;
+
+ implementations =
+
+ {
+
+ IMPLEMENTATION_INFO
+
+ {
+
+ implementation_uid = 0x200169EA;
+
+ version_no = 1;
+
+ display_name = "BrowserRfsPlugin";
+
+ default_data = "ND"; // N = Normal RFS, D = Deep RFS, I = Init RFS (FirstBoot RFS)
+
+ opaque_data = "";
+
+ }
+
+ };
+
+ }
+
+ };
+
+ }
+
+
+
Binary file browserrfsplugin/src/browserrfs.txt has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/src/browserrfsplugin.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+
+
+
+
+#include "BrowserRfsPlugin.h"
+
+_LIT(KScriptPath, "z:\\resource\\browserrfs.txt");
+
+CBrowserRfsPlugin::CBrowserRfsPlugin()
+ {
+ }
+
+CBrowserRfsPlugin::CBrowserRfsPlugin(TAny* /*aInitParams*/): CRFSPlugin()
+ {
+ }
+
+
+CBrowserRfsPlugin::~CBrowserRfsPlugin()
+ {
+ }
+
+
+// ---------------------------------------------------------
+// NewL
+// ---------------------------------------------------------
+//
+CBrowserRfsPlugin* CBrowserRfsPlugin::NewL(TAny* aInitParams)
+ {
+ CBrowserRfsPlugin* self = new (ELeave) CBrowserRfsPlugin(aInitParams);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+// ---------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------
+//
+
+void CBrowserRfsPlugin::ConstructL()
+ {
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::ConstructL()"));
+// #endif
+ }
+
+// ---------------------------------------------------------
+// RestoreFactorySettingsL
+// ---------------------------------------------------------
+//
+
+//#ifdef _DEBUG
+void CBrowserRfsPlugin::RestoreFactorySettingsL( const TRfsReason aType )
+{
+// TODO:
+// We can expand the functionalities here further
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::RestoreFactorySettings"));
+// #endif
+}
+
+
+
+
+void CBrowserRfsPlugin::GetScriptL( const TRfsReason aType, TDes& aPath )
+ {
+ aPath.Copy( KScriptPath);
+/* if(aType == EDeepRfs)
+ {
+ aPath.Copy(KScriptPath);
+ }
+*/
+ }
+
+
+
+void CBrowserRfsPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/,
+ TDesC& /*aCommand*/ )
+ {
+// #ifdef _DEBUG
+// RDebug::Print(_L("CBrowserRfsPlugin::RestoreFactorySettings"));
+// #endif
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browserrfsplugin/src/proxy.cpp Mon Oct 04 00:29:21 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not,
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* This class export ECom interface implementations.
+*
+*/
+
+
+
+
+#include <e32std.h>
+
+#include <ecom/implementationproxy.h>
+
+
+
+#include "BrowserRfsPlugin.h"
+
+
+
+// Map the interface UIDs to implementation factory functions
+
+const TImplementationProxy ImplementationTable[] =
+
+ {
+
+ IMPLEMENTATION_PROXY_ENTRY(0x200169EA, CBrowserRfsPlugin::NewL )
+
+ };
+
+
+
+// Exported proxy for instantiation method resolution
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+
+ {
+
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+
+
+ return ImplementationTable;
+
+ }
+
+
+
--- a/package_definition.xml Fri Sep 17 08:30:56 2010 +0300
+++ b/package_definition.xml Mon Oct 04 00:29:21 2010 +0300
@@ -5,6 +5,9 @@
<component id="bookmarksengine_build" name="Bookmarks Engine Build" introduced="^4" filter="s60">
<unit bldFile="bookmarksengine" qt:proFile="bookmarksengine.pro"/>
</component>
+ <component id="bookmarks_build" name="Bookmarks Build" introduced="^4" filter="s60">
+ <unit bldFile="bookmarks" qt:proFile="bookmarks.pro"/>
+ </component>
</collection>
</package>
</SystemDefinition>