--- a/bedrockProvisioning/bedrockProvisioning.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/bedrockProvisioning/bedrockProvisioning.pro Mon Oct 04 00:04:54 2010 +0300
@@ -60,8 +60,8 @@
}
}
-contains(browser_addon, no ) {
- DEFINES += PLAT_101
+contains(br_layout, tenone ) {
+ DEFINES += BROWSER_LAYOUT_TENONE
}
OBJECTS_DIR = $$BEDROCKPROVISIONING_OUTPUT_DIR/BedrockProvisioning/tmp
@@ -86,3 +86,6 @@
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
message( "building for coverage statics" )
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/bedrockProvisioning/bedrockprovisioning.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/bedrockProvisioning/bedrockprovisioning.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -119,7 +119,11 @@
}
if (!QSettings::contains("StartUpChrome")) {
+#ifdef BROWSER_LAYOUT_TENONE
+ QSettings::setValue("StartUpChrome", "bedrockchrome/chrome_tenone.html");
+#else
QSettings::setValue("StartUpChrome", "bedrockchrome/chrome.html");
+#endif
}
if (!QSettings::contains("SplashImage")) {
@@ -174,11 +178,7 @@
if (!QSettings::contains("StartPage"))
{
-#ifdef PLAT_101
- QSettings::setValue("StartPage", "startpage_101.html");
-#else
QSettings::setValue("StartPage", "startpage.html");
-#endif
}
if (!QSettings::contains("SaveSession"))
@@ -231,11 +231,7 @@
}
if (!QSettings::contains("Bookmark0Url")) {
-#ifdef PLAT_101
- QSettings::setValue("Bookmark0Url", "startpage_101.html");
-#else
QSettings::setValue("Bookmark0Url", "startpage.html");
-#endif
}
if (!QSettings::contains("Bookmark1Title")) {
--- a/browsercore/appfw/Api/Bookmarks/bookmarks.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Bookmarks/bookmarks.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -30,7 +30,7 @@
#include <QDebug>
#include "bookmarks.h"
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
#include "xbel.h"
namespace WRT {
--- a/browsercore/appfw/Api/Bookmarks/bookmarks.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Bookmarks/bookmarks.h Mon Oct 04 00:04:54 2010 +0300
@@ -36,7 +36,7 @@
class AutoSaver;
class BookmarksModel;
//class WrtSettings;
-class BookmarksManager;
+class HistoryManager;
class BWF_EXPORT BookmarkNode
{
--- a/browsercore/appfw/Api/Common/UiUtil.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Common/UiUtil.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -26,6 +26,21 @@
namespace WRT {
+
+QString UiUtil::removeScheme(const QString & str )
+{
+
+ QUrl url(str);
+ QString scheme=url.scheme();
+ QString urlStr = str;
+
+ if (scheme == "http" || scheme == "https") {
+ urlStr.remove(0, scheme.length() + 3); //remove "scheme://"
+ }
+ return urlStr;
+
+}
+
QString UiUtil::loadFiletoString(const QString &name)
{
QFile file(name);
@@ -75,19 +90,27 @@
}
}
// Might be a file.
- if (QFile::exists(urlStr))
- return QUrl::fromLocalFile(urlStr);
-
+ if (hasSchema) {
+ if (QFile::exists(urlStr))
+ return QUrl::fromLocalFile(urlStr);
+ }
// Might be a shorturl - try to detect the schema.
if (!hasSchema) {
int dotIndex = urlStr.indexOf(QLatin1Char('.'));
if (dotIndex != -1 && !hasSpaces) {
QUrl url;
urlStr.endsWith(".") ? ( url.setUrl(QLatin1String("http://") + urlStr + QLatin1String("com"), QUrl::TolerantMode) ) : ( url.setUrl(QLatin1String("http://") + urlStr, QUrl::TolerantMode) );
- if (url.isValid())
+ if (url.isValid()){
return url;
+ }
+ //--Condition for Character DOT(.)--
+ else {
+ QUrl url(QLatin1String(GOOGLE_SEARCH_ENGINE) + urlStr, QUrl::TolerantMode);
+ if(url.isValid())
+ return url;
+ }
}
- //The string parameter is simple text and a search should be performed.
+ //--The string parameter is simple text and a search should be performed. Like for Special Character :\ etc.--
else {
QUrl url(QLatin1String(GOOGLE_SEARCH_ENGINE) + urlStr, QUrl::TolerantMode);
if(url.isValid())
--- a/browsercore/appfw/Api/Common/UiUtil.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Common/UiUtil.h Mon Oct 04 00:04:54 2010 +0300
@@ -30,6 +30,7 @@
public:
static QString loadFiletoString(const QString &name);
static QUrl guessUrlFromString(const QString &string);
- static QUrl searchUrl(const QString &string);
+ static QUrl searchUrl(const QString &string);
+ static QString removeScheme(const QString & str);
};
}
--- a/browsercore/appfw/Api/Managers/BookmarksManager.cpp Fri Sep 17 08:27:10 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,471 +0,0 @@
-/*
-* 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 <QtCore/QDir>
-#include <QtCore/QFile>
-#include <QtGui/QIcon>
-#include <QtGui>
-#include <QtCore/QDebug>
-#include <QtCore/QUrl>
-#include <QString>
-#include "actionjsobject.h"
-#include "BookmarksManager_p.h"
-#include "BookmarksManager.h"
-
-//#include "wrtsettings.h"
-#include "bedrockprovisioning.h"
-#include "bookmarks.h"
-#include <browsercontentdll.h>
-#include "xbel.h"
-#include "webpagecontroller.h"
-#include "wrtbrowsercontainer.h"
-
-
-namespace WRT {
-
-BookmarksManagerPrivate::BookmarksManagerPrivate(BookmarksManager * mgr) :
- q(mgr),
- m_connectedToBookmarks(false),
- m_maxUrls(10) // TODO: read from settings
-{
- QFileInfo dbFile("browserContent.db");
-
-#ifdef Q_WS_MAEMO_5
- m_import = false;
- if (dbFile.exists()){
- m_import = false;
- }
- else {
- m_import = true;
- }
-#endif
-
- m_bookmarkSession=new BrowserContent("Bedrock");
- if (m_bookmarkSession) {
- m_connectedToBookmarks = true;
- } else {
- qDebug() << "BookmarksManagerPrivate: Failed to connect to bookmarks";
- }
-
- m_actionsParent = new QObject(mgr);
- m_actionsParent->setObjectName("actions");
-
- m_actionClearHistory = new QAction("clearHistory", m_actionsParent);
-
- m_actionClearJSO = new ActionJSObject(m_actionsParent, m_actionClearHistory);
-
- m_actionClearHistory->setObjectName("clearHistory");
-
-}
-
-BookmarksManagerPrivate::~BookmarksManagerPrivate()
-{
- delete m_bookmarkSession;
- delete m_actionClearHistory;
- delete m_actionClearJSO;
-}
-
-/*!
- * \class BookmarksManager
- *
- * This class is responsible for managing bookmarks, This class could be used
- * mainly for Creating, adding bookmarks, adding recent history items, deleting
- * and editing bookmarks.
- *
- */
-
-/*!
- * Basic constructor
- * @param parent : parent widget (Defaulted to NULL ) if not specified
- */
-BookmarksManager::BookmarksManager(QWidget *parent) :
- QObject(parent),
- d(new BookmarksManagerPrivate(this))
-{
-
-#ifdef Q_WS_MAEMO_5
- if (d->m_import)
- importNativeBookmarks();
-#endif
-
- m_isBookmarkDbreadRequired=true;
- //connect(d->m_actionClearHistory, SIGNAL(triggered()), this, SIGNAL(historyCleared()));
- connect(d->m_actionClearHistory, SIGNAL(triggered()), this, SIGNAL(confirmHistoryClear()));
-
-}
-/*
-void BookmarksManager::actionClearHistory()
-{
- emit confirmClearHistory();
-}
-*/
-
-BookmarksManager::~BookmarksManager()
-{
- disconnect(d->m_actionClearHistory, SIGNAL(triggered()), this, SIGNAL(historyCleared()));
- delete d;
-}
-
-BookmarksManager* BookmarksManager::getSingleton()
- {
- static BookmarksManager* singleton = 0;
-
- if(!singleton){
- singleton = new BookmarksManager;
- singleton->setObjectName("bookmarksManager");
- }
-
- //assert(singleton);
- return singleton;
- }
-}
-
-
-#ifdef Q_WS_MAEMO_5
-/*!
- * Import the bookmarks grom Native Browser
- * Ignores errors (just exists)
- */
-void BookmarksManager::importNativeBookmarks()
-{
-
- int error = ::MainImport();
-
- if(error)
- return;
-
- startNativeBookmarksParsing();
- QString fileName = "c:/data/bookmarks.txt.xml";
-
- XbelReader reader;
- BookmarkNode *importRootNode = reader.read(fileName);
- if (reader.error() != QXmlStreamReader::NoError){
- QMessageBox::warning(0, QLatin1String("Loading Bookmark"),
- tr("Error when loading bookmarks on line %1, column %2:\n"
- "%3").arg(reader.lineNumber()).arg(reader.columnNumber()).arg(reader.errorString()));
- }
-
- int bookmarkCount = importRootNode->children().count() - 1;
- for (int i = bookmarkCount; i >= 0; --i) {
- BookmarkNode *node = importRootNode->children()[i];
-
- if (node->type() == BookmarkNode::Bookmark)
- addBookmark(node->title,node->url,0);
-
- }
-
- // add local bookmarks
- QString localPagesBaseDir(BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsString("LocalPagesBaseDirectory"));
- QString indexStr;
- for (int index = 2; index >= 0; index--) {
- indexStr.setNum(index);
- QString bookmarkTitle = BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsString(tr("Bookmark")+indexStr+tr("Title"));
- if (bookmarkTitle == "")
- continue;
- QString bookmarkUrl = BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsString(tr("Bookmark")+indexStr+tr("Url"));
- if (bookmarkUrl == "")
- continue;
- if (bookmarkUrl.contains("://") || bookmarkUrl.contains("www."))
- addBookmark(bookmarkTitle, bookmarkUrl, 0);
- else {
- QString localBookmarkUrl = QFileInfo(localPagesBaseDir + bookmarkUrl).absoluteFilePath();
- addBookmark(bookmarkTitle, tr("file:///") + localBookmarkUrl, 0);
- }
- }
-}
-#endif
-
-QString BookmarksManager::getBookmarksJSON()
- {
- if(m_isBookmarkDbreadRequired==true)
- {
- m_bookmakrData=d->m_bookmarkSession->fetchSerializedBookmarks();
- m_isBookmarkDbreadRequired=false;
- }
- return m_bookmakrData;
-
- }
-
-QString BookmarksManager::normalizeUrl(const QString& url)
- {
- // If the URL is relative, add http in front
- // so that qt doesn't make it absolute using the
- // local file path
- QString updatedUrl = url;
-
- if (!url.contains("://")) {
- if (!url.startsWith("www", Qt::CaseInsensitive)) {
- updatedUrl.prepend("http://www.");
- } else {
- updatedUrl.prepend("http://");
- }
- }
- return updatedUrl;
-
- }
-
-int BookmarksManager::addBookmark(const QString &title, const QString &url,int index)
-{
- QString updatedTitle = title;
- updatedTitle = updatedTitle.trimmed();
- //Setting title as url string if title is not available
- if(url.isEmpty())
- return ErrBookmarkUrlEmpty;
-
- QVector<QString> nodes;
- d->m_bookmarkSession->fetchAllBookmarkTitles(nodes);
- for (int iter = 0 ; iter < nodes.size() ; ++iter) {
- if(0==updatedTitle.compare(nodes.at(iter),Qt::CaseInsensitive)){
- //Node already exists delete existing
- deleteBookmark(updatedTitle);
- }
- }
-
-
- nodes.clear();
-
- QString updatedUrl = normalizeUrl(url);
-
- //Setting title as url string if title is not available
- if(title.isEmpty())
- updatedTitle = updatedUrl;
-
- BookmarkLeaf* leaf=new BookmarkLeaf();
- leaf->setTitle(updatedTitle);
- leaf->setUrl(updatedUrl);
- //leaf->setDate(bookmark->date);
- leaf->setTag("unknown");
- leaf->setIndex(index);
-
- if(ErrNone == d->m_bookmarkSession->addBookmark(leaf)) {
- emit bookmarkEntryAdded(updatedTitle,updatedUrl);
- delete leaf;
- m_isBookmarkDbreadRequired=true;
- return ErrNone;
- }
- delete leaf;
- return ErrGeneral;
-}
-
-void BookmarksManager::deleteBookmark(QString title)
-{
- d->m_bookmarkSession->deleteBookmark(title);
- m_isBookmarkDbreadRequired=true;
-}
-
-void BookmarksManager::clearBookmarks()
-{
- d->m_bookmarkSession->clearBookmarks();
- m_isBookmarkDbreadRequired=true;
- emit bookmarksCleared();
-}
-
-int BookmarksManager::reorderBokmarks(QString title,int new_index)
-{
- d->m_bookmarkSession->reorderBokmarks(title,new_index);
- m_isBookmarkDbreadRequired=true;
- return ErrNone;
-}
-
-int BookmarksManager::modifyBookmark(QString orgTitle, QString newTitle, QString newUrl)
-{
- QString updatedTitle = newTitle;
- updatedTitle = updatedTitle.trimmed();
- //Setting title as url string if title is not available
- if(newUrl.isEmpty())
- return ErrBookmarkUrlEmpty;
-
- QList<BookmarkLeaf*> nodes;
- nodes = d->m_bookmarkSession->fetchAllBookmarks();
- for (int iter = 0 ; iter < nodes.count() ; ++iter) {
- if((0==updatedTitle.compare(nodes.at(iter)->getTitle(),Qt::CaseInsensitive))
- && (0 != orgTitle.compare(nodes.at(iter)->getTitle(),Qt::CaseInsensitive))){
- //Node already exists delete existing
- deleteBookmark(updatedTitle);
- }
- }
-
- qDeleteAll(nodes);
- nodes.clear();
-
- QString updatedUrl = normalizeUrl(newUrl);
-
- //Setting title as url string if title is not available
- if(newTitle.isEmpty())
- updatedTitle = updatedUrl;
-
-
- if(ErrNone == d->m_bookmarkSession->modifyBookmark(orgTitle, updatedTitle, updatedUrl)) {
- emit bookmarkEntryModified(updatedTitle, updatedUrl);
- m_isBookmarkDbreadRequired=true;
- return ErrNone;
- }
- return ErrGeneral;
-}
-
-void BookmarksManager::launchEditBookmark(QString title,QString url)
-{
- emit launchBookmarkEditDailog(title,url);
-}
-
-QString BookmarksManager::getHistoryFoldersJSON(QString folderName)
- {
-
- bool flag = true;
-
- QString historyFolders = "[";
- if (folderName == "")
- {
- m_historyMap.clear();
- m_folderVector.clear();
- d->m_bookmarkSession->fetchSerializedHistory(m_folderVector, m_historyMap);
-
- for (int i = m_folderVector.size() - 1; i >= 0; i--)
- {
- //check for folder nodes
- historyFolders.append("\"");
- historyFolders.append(m_folderVector[i]);
- historyFolders.append("\"");
-
-
- if (i != 0)
- historyFolders.append(",");
- if (flag)
- {
- if (m_folderVector[i].count() > 0)
- {
- d->m_actionClearHistory->setEnabled(true);
- flag=false;
- }
-
- }
- }
- if (flag)
- {
- d->m_actionClearHistory->setEnabled(false);
- }
- historyFolders.append("]");
- m_folderVector.clear();
- }
- if (folderName == "")
- {
- return historyFolders;
-
- }
- else
- {
- return m_historyMap[folderName];
- }
- }
-
-/*!
- * Add the node to the folder in proxy model. If the folder doesnt exist in proxy, create
- * the folder and add the node to it
- */
-
-/*!
- * Add to recent urls
- * @param url: url to be added to recent url list
- * @param title: title for this item in recent url list
- * @param icon: icon to be added for this item in recent url list
- */
-Q_DECL_EXPORT void BookmarksManager::addHistory(const QString &url, const QString &title)
-{
-
- //Check for a valid history entry
- if (url.isEmpty() || title.isEmpty())
- return;
-
- bool enabled = (bool) BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsInt("SaveHistory");
- if(!enabled)
- return;
-
- QDateTime currentDateTime = QDateTime::currentDateTime();
-
- HistoryLeaf* leaf=new HistoryLeaf();
- leaf->setTitle(title);
- leaf->setUrl(url);
- leaf->setDate(currentDateTime.date());
- leaf->setLastVisited(currentDateTime.time());
-
- if (d->m_connectedToBookmarks){
- if(ErrNone == d->m_bookmarkSession->addHistory(leaf)){
- d->m_actionClearHistory->setEnabled(true);
- }
- }
- delete leaf;
-}
-
-/*!
- * Add to recent urls
- * @param url: url to be added to recent url list
- * @param title: title for this item in recent url list
- * @param icon: icon to be added for this item in recent url list
- */
-
-void BookmarksManager::addHistory(const QUrl &url, const QString &title)
-{
- addHistory(url.toString(), title);
-}
-
-
-/*!
- * delete recent urls
- * clears all the recent url list.
- */
-void BookmarksManager::clearHistory()
-{
-
- if (d->m_connectedToBookmarks) {
- d->m_bookmarkSession->clearHistory();
- }
-
- d->m_actionClearHistory->setEnabled(false);
-
- emit historyCleared();
-}
-
-QAction * BookmarksManager::getActionClearHistory()
-{
- return d->m_actionClearHistory;
-}
-
-int BookmarksManager::getPageRank(const QString &url)
-{
- //Check for a valid entry
- if (url.isNull())
- return 0;
-
- int rank = 0;
- QList<HistoryLeaf*> historyNodes = d->m_bookmarkSession->fetchHistory();
-
- for (int i=0; i < historyNodes.count(); i++) {
- //Update rank if there is a history for this URL.
- if (!historyNodes[i]->getUrl().compare(url))
- rank++;
- }
-
- while (!historyNodes.isEmpty())
- delete historyNodes.takeFirst();
-
- return rank;
-}
--- a/browsercore/appfw/Api/Managers/BookmarksManager.h Fri Sep 17 08:27:10 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 BOOKMARKS_MANAGER_H
-#define BOOKMARKS_MANAGER_H
-
-#include <QtGui/QIcon>
-#include <QObject>
-#include <QAction>
-#include "BWFGlobal.h"
-#include "bedrockprovisioning.h"
-
-int MainImport();
-
-namespace WRT {
-int startNativeBookmarksParsing();
-
-class BookmarksManagerPrivate;
-class BookmarkNode;
-class HistoryModel;
-
-class BWF_EXPORT BookmarksManager : public QObject {
-
- Q_OBJECT
-
- enum EBookmarkManagerErrorTypes
- {
- ErrNone,
- //Add bookmark failure
- ErrGeneral = -1,
- ErrBookmarkAllReadyPresent =-2,
- ErrBookmarkUrlEmpty = -3,
-
- };
-
- public:
- BookmarksManager(QWidget *parent = 0);
- ~BookmarksManager();
-
- void setSettings(BEDROCK_PROVISIONING::BedrockProvisioning *settings);
- //Gets ref count of the page from history
- int getPageRank(const QString &url);
- static BookmarksManager* getSingleton();
-
- signals:
- void bookmarkEntryAdded(QString,QString);
- void launchBookmarkEditDailog(QString,QString);
- void bookmarkEntryModified(QString, QString);
- void historyCleared();
- void confirmHistoryClear();
- void bookmarksCleared();
-
- public slots:
-
-#ifdef Q_WS_MAEMO_5
- void importNativeBookmarks();
-#endif
-
- //javascript APIS
- QString getBookmarksJSON();
- int addBookmark(const QString &title,const QString &url,int index=0);
- void deleteBookmark(QString title);
- int reorderBokmarks(QString title,int new_index);
- int modifyBookmark(QString orgTitle, QString newTitle, QString newUrl);
- void clearBookmarks();
- void launchEditBookmark(QString title,QString url);
-
- QString getHistoryFoldersJSON(QString folder="");
- void addHistory(const QString &url, const QString &title);
- void addHistory(const QUrl &url, const QString &title);
- void clearHistory();
-
- QAction * getActionClearHistory();
-
- private:
- //For loading the history from data base
- QString normalizeUrl(const QString &url);
-
- private:
- BookmarksManagerPrivate * const d;
- bool m_isBookmarkDbreadRequired;
- QString m_bookmakrData;
- QVector<QString> m_folderVector;
- QMap<QString, QString> m_historyMap;
-
-};
-}
-#endif //BOOKMARKS_MANAGER
--- a/browsercore/appfw/Api/Managers/BookmarksManager_p.h Fri Sep 17 08:27:10 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* 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 BOOKMARKS_MANAGER_P_H
-#define BOOKMARKS_MANAGER_P_H
-
-#include <QtGui/QUndoStack>
-#include <browsercontentdll.h>
-#include <QAction>
-
-class ActionJSObject;
-
-namespace WRT {
- class BookmarksManager;
- class BookmarkNode;
- class BookmarksManagerPrivate
- {
- public:
- BookmarksManagerPrivate(BookmarksManager * qq);
- ~BookmarksManagerPrivate();
-
- public: // public actions available for this manager
-
- public:
- BookmarksManager * const q;
- //! flag to indicate was able to connect to book marks
- bool m_connectedToBookmarks;
- //! flag to indicate bookmarks are loaded from data base
- int m_maxUrls;
- BrowserContent* m_bookmarkSession;
-
-#ifdef Q_WS_MAEMO_5
- //flag to indicate importing bookmarks
- bool m_import;
-#endif
-
- QAction * m_actionClearHistory;
- QObject* m_actionsParent;
- ActionJSObject *m_actionClearJSO;
- };
-}
-#endif //BOOKMARKS_MANAGER_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/HistoryManager.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,281 @@
+/*
+* 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 <QtCore/QDir>
+#include <QtCore/QFile>
+#include <QtGui/QIcon>
+#include <QtGui>
+#include <QtCore/QDebug>
+#include <QtCore/QUrl>
+#include <QString>
+#include "actionjsobject.h"
+#include "HistoryManager_p.h"
+#include "HistoryManager.h"
+
+//#include "wrtsettings.h"
+#include "bedrockprovisioning.h"
+#include <browsercontentdll.h>
+#include "webpagecontroller.h"
+#include "wrtbrowsercontainer.h"
+
+
+namespace WRT {
+
+HistoryManagerPrivate::HistoryManagerPrivate(HistoryManager * mgr) :
+ q(mgr),
+ m_connectedToHistory(false),
+ m_maxUrls(10) // TODO: read from settings
+{
+ QFileInfo dbFile("browserContent.db");
+
+#ifdef Q_WS_MAEMO_5
+ m_import = false;
+ if (dbFile.exists()){
+ m_import = false;
+ }
+ else {
+ m_import = true;
+ }
+#endif
+
+ m_historySession=new BrowserContent("Bedrock");
+ if (m_historySession) {
+ m_connectedToHistory = true;
+ } else {
+ qDebug() << "HistoryManagerPrivate: Failed to connect to history database";
+ }
+
+ m_actionsParent = new QObject(mgr);
+ m_actionsParent->setObjectName("actions");
+
+ m_actionClearHistory = new QAction("clearHistory", m_actionsParent);
+
+ m_actionClearJSO = new ActionJSObject(m_actionsParent, m_actionClearHistory);
+
+ m_actionClearHistory->setObjectName("clearHistory");
+
+}
+
+HistoryManagerPrivate::~HistoryManagerPrivate()
+{
+ delete m_historySession;
+ delete m_actionClearHistory;
+ delete m_actionClearJSO;
+}
+
+/*!
+ * \class HistoryManager
+ *
+ * This class is responsible for managing history, This class could be used
+ * mainly for Creating, adding history, adding recent history items, deleting
+ * and editing history.
+ *
+ */
+
+/*!
+ * Basic constructor
+ * @param parent : parent widget (Defaulted to NULL ) if not specified
+ */
+HistoryManager::HistoryManager(QWidget *parent) :
+ QObject(parent),
+ d(new HistoryManagerPrivate(this))
+{
+
+ m_isHistoryDbreadRequired=true;
+ connect(d->m_actionClearHistory, SIGNAL(triggered()), this, SIGNAL(confirmHistoryClear()));
+
+}
+/*
+void HistoryManager::actionClearHistory()
+{
+ emit confirmClearHistory();
+}
+*/
+
+HistoryManager::~HistoryManager()
+{
+ disconnect(d->m_actionClearHistory, SIGNAL(triggered()), this, SIGNAL(historyCleared()));
+ delete d;
+}
+
+HistoryManager* HistoryManager::getSingleton()
+ {
+ static HistoryManager* singleton = 0;
+
+ if(!singleton){
+ singleton = new HistoryManager;
+ singleton->setObjectName("historyManager");
+ }
+
+ //assert(singleton);
+ return singleton;
+ }
+}
+
+QString HistoryManager::getHistoryFoldersJSON(QString folderName)
+ {
+
+ bool flag = true;
+
+ QString historyFolders = "[";
+ if (folderName == "")
+ {
+ m_historyMap.clear();
+ m_folderVector.clear();
+ d->m_historySession->fetchSerializedHistory(m_folderVector, m_historyMap);
+
+ for (int i = m_folderVector.size() - 1; i >= 0; i--)
+ {
+ //check for folder nodes
+ historyFolders.append("\"");
+ historyFolders.append(m_folderVector[i]);
+ historyFolders.append("\"");
+
+
+ if (i != 0)
+ historyFolders.append(",");
+ if (flag)
+ {
+ if (m_folderVector[i].count() > 0)
+ {
+ d->m_actionClearHistory->setEnabled(true);
+ flag=false;
+ }
+
+ }
+ }
+ if (flag)
+ {
+ d->m_actionClearHistory->setEnabled(false);
+ }
+ historyFolders.append("]");
+ m_folderVector.clear();
+ }
+ if (folderName == "")
+ {
+ return historyFolders;
+
+ }
+ else
+ {
+ return m_historyMap[folderName];
+ }
+ }
+
+/*!
+ * Add the node to the folder in proxy model. If the folder doesnt exist in proxy, create
+ * the folder and add the node to it
+ */
+
+/*!
+ * Add to recent urls
+ * @param url: url to be added to recent url list
+ * @param title: title for this item in recent url list
+ * @param icon: icon to be added for this item in recent url list
+ */
+Q_DECL_EXPORT void HistoryManager::addHistory(const QString &url, const QString &title)
+{
+
+ //Check for a valid history entry
+ if (url.isEmpty() || title.isEmpty())
+ return;
+
+ bool enabled = (bool) BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsInt("SaveHistory");
+ if(!enabled)
+ return;
+
+ QDateTime currentDateTime = QDateTime::currentDateTime();
+
+ HistoryLeaf* leaf=new HistoryLeaf();
+ leaf->setTitle(title);
+ leaf->setUrl(url);
+ leaf->setDate(currentDateTime.date());
+ leaf->setLastVisited(currentDateTime.time());
+
+ if (d->m_connectedToHistory){
+ if(ErrNone == d->m_historySession->addHistory(leaf)){
+ d->m_actionClearHistory->setEnabled(true);
+ }
+ }
+ delete leaf;
+}
+
+/*!
+ * Add to recent urls
+ * @param url: url to be added to recent url list
+ * @param title: title for this item in recent url list
+ * @param icon: icon to be added for this item in recent url list
+ */
+
+void HistoryManager::addHistory(const QUrl &url, const QString &title)
+{
+ addHistory(url.toString(), title);
+}
+
+
+/*!
+ * delete recent urls
+ * clears all the recent url list.
+ */
+void HistoryManager::clearHistory()
+{
+
+ if (d->m_connectedToHistory) {
+ d->m_historySession->clearHistory();
+ }
+
+ d->m_actionClearHistory->setEnabled(false);
+
+ emit historyCleared();
+}
+
+QAction * HistoryManager::getActionClearHistory()
+{
+ return d->m_actionClearHistory;
+}
+
+int HistoryManager::getPageRank(const QString &url)
+{
+ //Check for a valid entry
+ if (url.isNull())
+ return 0;
+
+ int rank = 0;
+ QList<HistoryLeaf*> historyNodes = d->m_historySession->fetchHistory();
+
+ for (int i=0; i < historyNodes.count(); i++) {
+ //Update rank if there is a history for this URL.
+ if (!historyNodes[i]->getUrl().compare(url))
+ rank++;
+ }
+
+ while (!historyNodes.isEmpty())
+ delete historyNodes.takeFirst();
+
+ return rank;
+}
+
+QMap<QString, QString> HistoryManager::findHistory(QString title)
+{
+ return d->m_historySession->findSimilarHistoryItems(title);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/HistoryManager.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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 HISTORY_MANAGER_H
+#define HISTORY_MANAGER_H
+
+#include <QtGui/QIcon>
+#include <QObject>
+#include <QAction>
+#include "BWFGlobal.h"
+#include "bedrockprovisioning.h"
+
+namespace WRT {
+
+class HistoryManagerPrivate;
+class HistoryModel;
+
+class BWF_EXPORT HistoryManager : public QObject {
+
+ Q_OBJECT
+
+ enum EHistoryManagerErrorTypes
+ {
+ ErrNone,
+ ErrGeneral = -1,
+
+ };
+
+ public:
+ HistoryManager(QWidget *parent = 0);
+ ~HistoryManager();
+
+ void setSettings(BEDROCK_PROVISIONING::BedrockProvisioning *settings);
+ //Gets ref count of the page from history
+ int getPageRank(const QString &url);
+ static HistoryManager* getSingleton();
+
+ signals:
+ void historyCleared();
+ void confirmHistoryClear();
+
+ public slots:
+
+ //javascript APIS
+ QString getHistoryFoldersJSON(QString folder="");
+ void addHistory(const QString &url, const QString &title);
+ void addHistory(const QUrl &url, const QString &title);
+ void clearHistory();
+ QMap<QString, QString> findHistory(const QString title);
+
+ QAction * getActionClearHistory();
+
+ private:
+ HistoryManagerPrivate * const d;
+ bool m_isHistoryDbreadRequired;
+ QVector<QString> m_folderVector;
+ QMap<QString, QString> m_historyMap;
+
+};
+}
+#endif //HISTORY_MANAGER
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/HistoryManager_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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 HISTORY_MANAGER_P_H
+#define HISTORY_MANAGER_P_H
+
+#include <QtGui/QUndoStack>
+#include <browsercontentdll.h>
+#include <QAction>
+
+class ActionJSObject;
+
+namespace WRT {
+ class HistoryManager;
+ class HistoryManagerPrivate
+ {
+ public:
+ HistoryManagerPrivate(HistoryManager * qq);
+ ~HistoryManagerPrivate();
+
+ public: // public actions available for this manager
+
+ public:
+ HistoryManager * const q;
+ //! flag to indicate was able to connect to book marks
+ bool m_connectedToHistory;
+ //! flag to indicate bookmarks are loaded from data base
+ int m_maxUrls;
+ BrowserContent* m_historySession;
+
+ QAction * m_actionClearHistory;
+ QObject* m_actionsParent;
+ ActionJSObject *m_actionClearJSO;
+ };
+}
+#endif //HISTORY_MANAGER_P_H
--- a/browsercore/appfw/Api/Managers/LoadController.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/LoadController.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -25,13 +25,16 @@
#include "wrtbrowsercontainer.h"
#include <QDebug>
+#define ENOUGHCONTENT 60
+
namespace WRT {
LoadController::LoadController ( ) :
m_gotoMode(GotoModeEditing),
m_isPageLoading(false),
m_canceled(false),
- m_progress(0)
+ m_progress(0),
+ m_initialLayoutIsComplete(false)
{
}
@@ -41,9 +44,39 @@
}
-void LoadController::setMode(GotoBrowserMode mode)
+void LoadController::setEditMode(bool editing)
{
- m_gotoMode = mode;
+
+ //qDebug() << " LoadController::setEditMode" << editing << m_gotoMode;
+ if (editing) {
+ if (m_gotoMode == GotoModeLoading ) {
+ m_gotoMode = GotoModeEditinLoading;
+ }
+ else if ( m_gotoMode == GotoModeReloadable ){
+ m_gotoMode = GotoModeEditing;
+ }
+
+ }
+ else {
+ if (m_gotoMode == GotoModeEditinLoading ) {
+ m_gotoMode = GotoModeLoading;
+ }
+ else if (m_gotoMode == GotoModeEditing){
+ m_gotoMode = GotoModeReloadable;
+ }
+
+ }
+ qDebug() << "Leave LoadController::setEditMode " << m_gotoMode;
+}
+
+
+bool LoadController::editMode()
+{
+ bool editing=false;
+ if (m_gotoMode == GotoModeEditinLoading || m_gotoMode == GotoModeEditing) {
+ editing = true;
+ }
+ return editing;
}
LoadController::GotoBrowserMode LoadController::mode()
@@ -56,6 +89,7 @@
m_progress = 0;
m_canceled = 0;
m_isPageLoading = true;
+ m_initialLayoutIsComplete = false;
m_gotoMode = GotoModeLoading;
@@ -69,13 +103,20 @@
m_isPageLoading = false;
m_progress = 100;
+
+ if (m_gotoMode == GotoModeEditinLoading ) {
+ m_gotoMode = GotoModeEditing;
+ }
+ else {
+ m_gotoMode = GotoModeReloadable;
- m_gotoMode = GotoModeReloadable;
+ }
// FIXME it is a temp fix for the url change issued with cached pages
if (ok) {
WebPageController * pageController = WebPageController::getSingleton();
if (pageController->currentPage()->loadController() == this)
+ m_previousTextBoxValue = m_textBoxValue;
m_textBoxValue = pageController->currentDocUrl();
}
// TODO: Change to editing mode if load failed
@@ -112,11 +153,28 @@
m_textBoxValue = url.toString();
emit pageUrlChanged(m_textBoxValue);
}
-
+
void LoadController::setUrlText(QString str)
{
// qDebug() << __PRETTY_FUNCTION__ << str;
m_textBoxValue = str;
}
+void LoadController:: initialLayoutCompleted()
+{
+ m_initialLayoutIsComplete = true;
+}
+
+bool LoadController:: pointOfNoReturn()
+{
+ bool noreturn(false);
+ if( m_initialLayoutIsComplete ) {
+ noreturn = true;
+ }
+ else {
+ m_textBoxValue = m_previousTextBoxValue;
+ }
+ return noreturn;
+}
+
} // namespace WRT
--- a/browsercore/appfw/Api/Managers/LoadController.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/LoadController.h Mon Oct 04 00:04:54 2010 +0300
@@ -36,6 +36,7 @@
public:
enum GotoBrowserMode {
GotoModeLoading, /**< Loading Mode (i.e. page is loading) */
+ GotoModeEditinLoading, /**< Editing while in Loading Mode (i.e. editing while page is loading) */
GotoModeEditing, /**< Editing Mode (i.e. user can or is editing the url) */
GotoModeReloadable, /**< Reloadable Mode (i.e. the url has not changed, and can be reloaded) */
GotoModeInvalid
@@ -54,10 +55,12 @@
public:
GotoBrowserMode mode();
- void setMode(GotoBrowserMode mode);
+ void setEditMode(bool);
+ bool editMode();
+
-
+
bool loadCanceled() { return m_canceled ;}
void setCanceled(bool val) {m_canceled = val;}
@@ -66,13 +69,15 @@
int progressValue() {return m_progress; }
bool inline isPageLoading(){ return m_isPageLoading;}
-
+ bool pointOfNoReturn();
public slots:
void loadStarted();
void loadProgress( const int progress );
void loadFinished( const bool ok );
void urlChanged(QUrl);
+ void initialLayoutCompleted();
+
Q_SIGNALS:
@@ -85,10 +90,11 @@
private:
GotoBrowserMode m_gotoMode;
bool m_isPageLoading;
- bool m_initialLayoutIsComplete;
bool m_canceled;
int m_progress;
+ bool m_initialLayoutIsComplete;
QString m_textBoxValue;
+ QString m_previousTextBoxValue;
};
--- a/browsercore/appfw/Api/Managers/Managers.pri Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/Managers.pri Mon Oct 04 00:04:54 2010 +0300
@@ -1,32 +1,24 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# 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,
+# along with this program. If not,
# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
-#
# Description:
-#
-
-HEADERS += \
- $$PWD/BookmarksManager_p.h \
- $$PWD/BookmarksManager.h \
+HEADERS += $$PWD/HistoryManager.h \
+ $$PWD/HistoryManager_p.h \
$$PWD/secureuicontroller_p.h \
$$PWD/secureuicontroller.h \
$$PWD/LoadController.h \
$$PWD/viewcontroller.h \
$$PWD/webpagecontroller.h \
- $$PWD/webpagecontroller_p.h \
+ $$PWD/webpagecontroller_p.h \
$$PWD/downloadcontroller_p.h \
$$PWD/downloadcontroller.h \
$$PWD/downloadproxy_p.h \
@@ -35,9 +27,7 @@
$$PWD/contentagent.h \
$$PWD/lowmemoryhandler.h \
$$PWD/lowmemoryhandler_p.h
-
-SOURCES += \
- $$PWD/BookmarksManager.cpp \
+SOURCES += $$PWD/HistoryManager.cpp \
$$PWD/secureuicontroller.cpp \
$$PWD/LoadController.cpp \
$$PWD/viewcontroller.cpp \
@@ -47,12 +37,13 @@
$$PWD/downloadproxydata.cpp \
$$PWD/contentagent.cpp \
$$PWD/lowmemoryhandler.cpp
-
-symbian: {
-SOURCES += \
- $$PWD/lowmemoryhandler_p_s60.cpp
+HEADERS += $$PWD/bookmarkscontroller.h
+SOURCES += $$PWD/bookmarkscontroller.cpp
+contains(br_mobility_serviceframework, yes) {
+ HEADERS += $$PWD/hsbookmarkpublishclient.h
+ SOURCES += $$PWD/hsbookmarkpublishclient.cpp
}
-!symbian: {
-SOURCES += \
- $$PWD/lowmemoryhandler_p.cpp
-}
+symbian::SOURCES += $$PWD/lowmemoryhandler_p_s60.cpp
+!symbian::SOURCES += $$PWD/lowmemoryhandler_p.cpp
+INCLUDEPATH += $$PWD/../../../../../../mw/browser/bookmarks
+QT += sql
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/bookmarkscontroller.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,141 @@
+/*
+ * bookmarkscontroller.cpp
+ *
+ * Created on: Aug 25, 2010
+ * Author: mmoretti
+ */
+
+
+#include <QObject>
+#include <QWidget>
+#include <QDebug>
+
+#include "bookmarkscontroller.h"
+#include "BookmarksManager.h"
+#include "BookmarkFav.h"
+#include "BookmarkResults.h"
+#include "HistoryManager.h"
+
+BookmarksController::BookmarksController(QWidget *parent) :
+ QObject(parent)
+{
+ setObjectName("bookmarksController");
+ m_bm = new BookmarksManager(parent);
+}
+
+BookmarksController::~BookmarksController() {
+ // TODO Auto-generated destructor stub
+}
+
+BookmarksController* BookmarksController::getSingleton()
+{
+ static BookmarksController* singleton = 0;
+
+ if(!singleton){
+ singleton = new BookmarksController;
+ }
+
+ //assert(singleton);
+ return singleton;
+}
+
+
+int BookmarksController::addBookmark(QString title, QString URL)
+{
+ int bmid = m_bm->addBookmark(title, URL);
+// qDebug() << __PRETTY_FUNCTION__ << "added bookmark" << title << URL << bmid << "emitting bookmarkAdded";
+ emit bookmarkAdded(title, URL, bmid);
+ return(bmid);
+}
+
+int BookmarksController::modifyBookmark(int origBookmarkId, QString newTitle, QString newURL)
+{
+ int retstat = m_bm->modifyBookmark(origBookmarkId, newTitle, newURL);
+ emit bookmarkModified(newTitle, newURL, origBookmarkId);
+ return retstat;
+}
+
+int BookmarksController::deleteBookmark(int bookmarkId)
+{
+ return m_bm->deleteBookmark(bookmarkId);
+}
+
+int BookmarksController::clearAll()
+{
+ int retstat = m_bm->clearAll();
+ emit bookmarksCleared();
+ return retstat;
+}
+
+int BookmarksController::findAllBookmarks()
+{
+ m_bmr = m_bm->findAllBookmarks();
+ if (!m_bmr)
+ return -1;
+ return(0);
+}
+
+// This is only necessary because JS can't handle null objects being returned by nextBookmark
+bool BookmarksController::hasMoreBookmarks()
+{
+ if (!m_bmr)
+ return false;
+
+ m_bmf = m_bmr->nextBookmark();
+ if (!m_bmf) {
+ delete m_bmr;
+ m_bmr = 0;
+ return false;
+ }
+
+ return true;
+}
+
+
+QObject *BookmarksController::nextBookmark()
+{
+ return m_bmf;
+}
+
+int BookmarksController::reorderBookmark(int bookmarkID, int newIndex)
+{
+ return m_bm->reorderBookmark(bookmarkID, newIndex);
+}
+
+QObject *BookmarksController::findBookmark(int bookmarkID)
+{
+ return m_bm->findBookmark(bookmarkID);
+}
+
+void BookmarksController::showBookmarkEditDialog(QString title, QString url, int bookmarkID)
+{
+ // This is SOOOO convoluted; in our js, in order to call a function in another scope, we have to call a function here that emits a signal that is connected to that function, wtf?
+ emit launchBookmarkEditDailog(title, url, bookmarkID);
+}
+
+QObjectList BookmarksController::suggestSimilar(QString suggest)
+{
+ QMap<QString, QString> bookmarksMap = m_bm->findBookmarks(suggest);
+ QMap<QString, QString> historyMap = WRT::HistoryManager::getSingleton()->findHistory(suggest);
+ // Now combine the result
+ QObjectList suggestions;
+
+ QMapIterator<QString,QString> bhi(historyMap);
+ while (bhi.hasNext()) {
+ bhi.next();
+ suggestions.append(new Suggestion(bhi.key(), bhi.value()));
+ }
+
+ QMapIterator<QString,QString> bmi(bookmarksMap);
+ while (bmi.hasNext()) {
+ bmi.next();
+ if (historyMap.contains(bmi.key()))
+ continue;
+ suggestions.append(new Suggestion(bmi.key(), bmi.value()));
+ }
+
+ return suggestions;
+
+}
+
+// TODO add tag stuff when we get a ui for it
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/bookmarkscontroller.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,75 @@
+/*
+ * bookmarkscontroller.h
+ *
+ * Created on: Aug 25, 2010
+ * Author: mmoretti
+ */
+
+#ifndef BOOKMARKSCONTROLLER_H_
+#define BOOKMARKSCONTROLLER_H_
+
+#include <QObject>
+#include "BWFGlobal.h"
+class QWidget;
+
+class BookmarksManager;
+class BookmarkResults;
+class BookmarkFav;
+//#include "BookmarksManager.h"
+
+class BWF_EXPORT Suggestion : public QObject
+{
+ Q_OBJECT
+
+ public:
+ Suggestion(QString url, QString title) : m_url(url), m_title(title){};
+ // Hack: Changing the name to url1 from url as some namespace clash
+ // is happening on Linux
+ Q_PROPERTY(QString title1 READ suggestTitle)
+ Q_PROPERTY(QString url1 READ suggestUrl)
+
+ private:
+ QString m_url;
+ QString m_title;
+ QString suggestTitle() {return m_title;}
+ QString suggestUrl() {return m_url;}
+};
+
+
+class BWF_EXPORT BookmarksController : public QObject {
+
+ Q_OBJECT
+
+public:
+ virtual ~BookmarksController();
+ static BookmarksController* getSingleton();
+
+public slots:
+ int addBookmark(QString title, QString URL);
+ int modifyBookmark(int origBookmarkId, QString newTitle, QString newURl);
+ int deleteBookmark(int bookmarkId);
+ int clearAll();
+ int findAllBookmarks();
+ QObject *findBookmark(int bookmarkID);
+ int reorderBookmark(int bookmarkID, int newIndex);
+ QObject *nextBookmark();
+ bool hasMoreBookmarks();
+ void showBookmarkEditDialog(QString title, QString url, int bookmarkID);
+ QObjectList suggestSimilar(QString suggest);
+ // TODO add tag stuff when we get a ui for it
+
+signals:
+ void bookmarkAdded(QString,QString,int);
+ void bookmarksCleared();
+ void launchBookmarkEditDailog(QString,QString,int);
+ void bookmarkModified(QString, QString, int);
+
+private:
+ BookmarksController(QWidget *parent = 0);
+
+ BookmarksManager *m_bm;
+ BookmarkResults *m_bmr;
+ BookmarkFav *m_bmf;
+};
+
+#endif /* BOOKMARKSCONTROLLER_H_ */
--- a/browsercore/appfw/Api/Managers/downloadcontroller.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/downloadcontroller.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -33,106 +33,161 @@
#include <QWebPage>
#ifdef USE_DOWNLOAD_MANAGER
-#include "download.h"
-#include "downloadmanager.h"
+using namespace WRT;
-static const char * downloadErrorToString(QNetworkReply::NetworkError error)
+static const char * downloadErrorToString(WRT::Error error)
{
switch (error) {
- case QNetworkReply::NoError:
- return "QNetworkReply::NoError";
- case QNetworkReply::ConnectionRefusedError:
- return "QNetworkReply::ConnectionRefusedError";
- case QNetworkReply::RemoteHostClosedError:
- return "QNetworkReply::RemoteHostClosedError";
- case QNetworkReply::HostNotFoundError:
- return "QNetworkReply::HostNotFoundError";
- case QNetworkReply::TimeoutError:
- return "QNetworkReply::TimeoutError";
- case QNetworkReply::OperationCanceledError:
- return "QNetworkReply::OperationCanceledError";
- case QNetworkReply::SslHandshakeFailedError:
- return "QNetworkReply::SslHandshakeFailedError";
- case QNetworkReply::ProxyConnectionRefusedError:
- return "QNetworkReply::ProxyConnectionRefusedError";
- case QNetworkReply::ProxyConnectionClosedError:
- return "QNetworkReply::ProxyConnectionClosedError";
- case QNetworkReply::ProxyNotFoundError:
- return "QNetworkReply::ProxyNotFoundError";
- case QNetworkReply::ProxyTimeoutError:
- return "QNetworkReply::ProxyTimeoutError";
- case QNetworkReply::ProxyAuthenticationRequiredError:
- return "QNetworkReply::ProxyAuthenticationRequiredError";
- case QNetworkReply::ContentAccessDenied:
- return "QNetworkReply::ContentAccessDenied";
- case QNetworkReply::ContentOperationNotPermittedError:
- return "QNetworkReply::ContentOperationNotPermittedError";
- case QNetworkReply::ContentNotFoundError:
- return "QNetworkReply::ContentNotFoundError";
- case QNetworkReply::AuthenticationRequiredError:
- return "QNetworkReply::AuthenticationRequiredError";
- case QNetworkReply::ContentReSendError:
- return "QNetworkReply::ContentReSendError";
- case QNetworkReply::ProtocolUnknownError:
- return "QNetworkReply::ProtocolUnknownError";
- case QNetworkReply::ProtocolInvalidOperationError:
- return "QNetworkReply::ProtocolInvalidOperationError";
- case QNetworkReply::UnknownNetworkError:
- return "QNetworkReply::UnknownNetworkError";
- case QNetworkReply::UnknownProxyError:
- return "QNetworkReply::UnknownProxyError";
- case QNetworkReply::UnknownContentError:
- return "QNetworkReply::UnknownContentError";
- case QNetworkReply::ProtocolFailure:
- return "QNetworkReply::ProtocolFailure";
+ case WRT::NoError:
+ return "WRT::NoError";
+ case WRT::ConnectionRefusedError:
+ return "WRT::ConnectionRefusedError";
+ case WRT::RemoteHostClosedError:
+ return "WRT::RemoteHostClosedError";
+ case WRT::HostNotFoundError:
+ return "WRT::HostNotFoundError";
+ case WRT::TimeoutError:
+ return "WRT::TimeoutError";
+ case WRT::OperationCanceledError:
+ return "WRT::OperationCanceledError";
+ case WRT::SslHandshakeFailedError:
+ return "WRT::SslHandshakeFailedError";
+ case WRT::TemporaryNetworkFailureError:
+ return "WRT::TemporaryNetworkFailureError";
+ case WRT::UnknownNetworkError:
+ return "WRT::UnknownNetworkError";
+ case WRT::ProxyConnectionRefusedError:
+ return "WRT::ProxyConnectionRefusedError";
+ case WRT::ProxyConnectionClosedError:
+ return "WRT::ProxyConnectionClosedError";
+ case WRT::ProxyNotFoundError:
+ return "WRT::ProxyNotFoundError";
+ case WRT::ProxyTimeoutError:
+ return "WRT::ProxyTimeoutError";
+ case WRT::ProxyAuthenticationRequiredError:
+ return "WRT::ProxyAuthenticationRequiredError";
+ case WRT::UnknownProxyError:
+ return "WRT::UnknownProxyError";
+ case WRT::ContentAccessDenied:
+ return "WRT::ContentAccessDenied";
+ case WRT::ContentOperationNotPermittedError:
+ return "WRT::ContentOperationNotPermittedError";
+ case WRT::ContentNotFoundError:
+ return "WRT::ContentNotFoundError";
+ case WRT::AuthenticationRequiredError:
+ return "WRT::AuthenticationRequiredError";
+ case WRT::ContentReSendError:
+ return "WRT::ContentReSendError";
+ case WRT::UnknownContentError:
+ return "WRT::UnknownContentError";
+ case WRT::ProtocolUnknownError:
+ return "WRT::ProtocolUnknownError";
+ case WRT::ProtocolInvalidOperationError:
+ return "WRT::ProtocolInvalidOperationError";
+ case WRT::ProtocolFailure:
+ return "WRT::ProtocolFailure";
+ case WRT::ConnectionFailed:
+ return "WRT::ConnectionFailed";
+ case WRT::HttpRestartFailed:
+ return "WRT::HttpRestartFailed";
+ case WRT::ContentExpired:
+ return "WRT::ContentExpired";
+ case WRT::PartialContentModified:
+ return "WRT::PartialContentModified";
+ case WRT::ObjectNotFound:
+ return "WRT::ObjectNotFound";
+ case WRT::HttpUnhandled:
+ return "WRT::HttpUnhandled";
+ case WRT::DestinationFileInUse:
+ return "WRT::DestinationFileInUse";
+ case WRT::WrongDestinationFilename:
+ return "WRT::WrongDestinationFilename";
+ case WRT::BadUrl:
+ return "WRT::BadUrl";
+ case WRT::MediaRemoved:
+ return "WRT::MediaRemoved";
+ case WRT::FileWriteFailed:
+ return "WRT::FileWriteFailed";
+ case WRT::FileNotFound:
+ return "WRT::FileNotFound";
+ case WRT::InvalidDrive:
+ return "WRT::InvalidDrive";
+ case WRT::MoveFailed:
+ return "WRT::MoveFailed";
+ case WRT::DiskFull:
+ return "WRT::DiskFull";
+ case WRT::DiskError:
+ return "WRT::DiskError";
+ case WRT::TransactionFailed:
+ return "WRT::TransactionFailed";
+ case WRT::Internal:
+ return "WRT::Internal";
+ case WRT::General:
+ return "WRT::General";
+ case WRT::MaxRedirectionsReached:
+ return "WRT::MaxRedirectionsReached";
+ case WRT::InvalidDownloadDescriptor:
+ return "WRT::InvalidDownloadDescriptor";
default:
return "???";
}
}
-static const char * downloadEventToString(DEventType type)
+static const char * downloadEventToString(WRT::DownloadEvent::Event type)
{
switch (type) {
- case DownloadCreated:
- return "DownloadManager:DownloadCreated";
- case DownloadsCleared:
- return "DownloadManager:DownloadsCleared";
- case ConnectedToServer:
- return "DownloadManager:ConnectedToServer";
- case DisconnectedFromServer:
- return "DownloadManager:DisconnectedFromServer";
- case ServerError:
- return "DownloadManager:ServerError";
- case Started:
- return "Download:Started";
- case HeaderReceived:
- return "Download:HeaderReceived";
- case Progress:
- return "Download:Progress";
- case Completed:
- return "Download:Completed";
- case Paused:
- return "Download:Paused";
- case Cancelled:
- return "Download:Cancelled";
- case Failed:
- return "Download:Failed";
- case DescriptorUpdated:
- return "Download:DescriptorUpdated";
- case NetworkLoss:
- return "Download:NetworkLoss";
- case Error:
- return "Download:Error";
- case OMADownloadDescriptorReady:
- return "Download:OMADownloadDescriptorReady";
- case WMDRMLicenseAcquiring:
- return "Download:WMDRMLicenseAcquiring";
+ case WRT::DownloadEvent::Created:
+ return "DownloadEvent:Created";
+ case WRT::DownloadEvent::Started:
+ return "DownloadEvent::Started";
+ case WRT::DownloadEvent::HeadersReceived:
+ return "DownloadEvent::HeadersReceived";
+ case WRT::DownloadEvent::InProgress:
+ return "DownloadEvent::InProgress";
+ case WRT::DownloadEvent::Paused:
+ return "DownloadEvent::Paused";
+ case WRT::DownloadEvent::Completed:
+ return "DownloadEvent::Completed";
+ case WRT::DownloadEvent::Failed:
+ return "DownloadEvent::Failed";
+ case WRT::DownloadEvent::Cancelled:
+ return "DownloadEvent::Cancelled";
+ case WRT::DownloadEvent::DescriptorUpdated:
+ return "DownloadEvent::DescriptorUpdated";
+ case WRT::DownloadEvent::NetworkLoss:
+ return "DownloadEvent::NetworkLoss";
+ case WRT::DownloadEvent::Error:
+ return "DownloadEvent::Error";
+ case WRT::DownloadEvent::DescriptorReady:
+ return "DownloadEvent::DescriptorReady";
+ case WRT::DownloadEvent::LicenseAcquiring:
+ return "DownloadEvent::LicenseAcquiring";
+ case WRT::DownloadEvent::MediaRemoved:
+ return "DownloadEvent::MediaRemoved";
+ case WRT::DownloadEvent::MediaInserted:
+ return "DownloadEvent::MediaInserted";
+ case WRT::DownloadEvent::RedirectedPermanently:
+ return "DownloadEvent::RedirectedPermanently";
+ case WRT::DownloadEvent::RedirectedTemporarily:
+ return "DownloadEvent::RedirectedTemporarily";
+ case WRT::DownloadEvent::NameChanged:
+ return "DownloadEvent::NameChanged";
+ case WRT::DownloadEvent::ContentTypeChanged:
+ return "DownloadEvent::ContentTypeChanged";
+ case WRT::DownloadEvent::CreatingConnection:
+ return "DownloadEvent::CreatingConnection";
+ case WRT::DownloadEvent::ConnectionNeeded:
+ return "DownloadEvent::ConnectionNeeded";
+ case WRT::DownloadEvent::ConnectionDisconnected:
+ return "DownloadEvent::ConnectionDisconnected";
+ case WRT::DownloadEvent::RightObjectsAcquired:
+ return "DownloadEvent::RightObjectsAcquired";
default:
return 0;
}
}
-static void debugDownloadEvent(DEventType type)
+static void debugDownloadEvent(WRT::DownloadEvent::Event type)
{
const char * name = downloadEventToString(type);
if (name == 0) {
@@ -151,8 +206,20 @@
{
m_downloadController = downloadController;
- m_downloadManager = new DownloadManager(client);
- m_downloadManager->registerEventReceiver(this);
+ m_downloadManager = new WRT::DownloadManager(client);
+
+ if (m_downloadManager->initialize() != 0) {
+ return;
+ }
+
+ if (!connect(
+ m_downloadManager,
+ SIGNAL(downloadManagerEvent(DownloadManagerEvent *)),
+ this,
+ SLOT(handleDownloadManagerEvent(DownloadManagerEvent *)))) {
+ //;;; how to handle error?
+ }
+
if (proxy.type() != QNetworkProxy::NoProxy)
m_downloadManager->setProxy(proxy.hostName(), proxy.port());
}
@@ -196,10 +263,10 @@
void DownloadControllerPrivate::startDownload(const QUrl & url, const QFileInfo & info)
{
- Download * download = m_downloadManager->createDownload(url.toString());
+ WRT::Download * download = m_downloadManager->createDownload(url.toString());
- download->setAttribute(DlDestPath, info.absolutePath());
- download->setAttribute(DlFileName, info.fileName());
+ download->setAttribute(WRT::DestinationPath, info.absolutePath());
+ download->setAttribute(WRT::FileName, info.fileName());
startDownload(download, url);
}
@@ -208,7 +275,7 @@
{
QUrl url = reply->url();
- Download * download = m_downloadManager->createDownload(reply);
+ WRT::Download * download = m_downloadManager->createDownload(reply);
startDownload(download, url);
}
@@ -217,12 +284,12 @@
{
QUrl url = request.url();
- Download * download = m_downloadManager->createDownload(url.toString());
+ WRT::Download * download = m_downloadManager->createDownload(url.toString());
startDownload(download, url);
}
-void DownloadControllerPrivate::startDownload(Download * download, const QUrl & url)
+void DownloadControllerPrivate::startDownload(WRT::Download * download, const QUrl & url)
{
// If necessary suggest an alternate file name.
// The download manager will adjust the file name for us to handle
@@ -232,7 +299,7 @@
if (file.length() > 0) {
QVariant value(file);
- download->setAttribute(DlFileName, value);
+ download->setAttribute(WRT::FileName, value);
}
// Start download.
@@ -241,59 +308,66 @@
emit m_downloadController->downloadCreated(downloadProxy);
- download->registerEventReceiver(this);
+ if (!connect(
+ download,
+ SIGNAL(downloadEvent(DownloadEvent *)),
+ this,
+ SLOT(handleDownloadEvent(DownloadEvent *)))) {
+ //;;; how to handle error?
+ }
+
+ if (!connect(
+ download,
+ SIGNAL(downloadError(Error)),
+ this,
+ SLOT(handleDownloadError(Error)))) {
+ //;;; how to handle error?
+ }
download->start();
+
}
-bool DownloadControllerPrivate::handleDownloadManagerEvent(DownloadEvent * event)
+void DownloadControllerPrivate::handleDownloadManagerEvent(
+ DownloadManagerEvent * event)
{
- DEventType type = static_cast<DEventType>(event->type());
+ int type = event->type();
switch (type) {
- case DownloadCreated:
- // Instead of waiting for the DownloadManager DownloadCreated event
- // we emit downloadCreated in startDownload above so that we can add
- // a pointer to the download created as a parameter.
- return true;
+ case WRT::DownloadManagerEvent::Created:
+ // Instead of waiting for the DownloadManager Created event
+ // we emit downloadCreated in startDownload above so that we
+ // can add a pointer to the download created as a parameter.
+ return;
- case DownloadsCleared:
- // ;;; In new DL mgr will have DownloadManager 'Removed' event instead.
- // ;;; Looks like this will only be generated when all downloads are removed.
- // ;;; In that case we can emit the same signal.
- emit m_downloadController->downloadsCleared();
- return true;
-
- case ConnectedToServer:
- case DisconnectedFromServer:
- case ServerError:
- return true;
+ case WRT::DownloadManagerEvent::Removed:
+ if (m_downloadManager->currentDownloads().empty()) {
+ emit m_downloadController->downloadsCleared();
+ }
+ return;
default:
qDebug() << "Unexpected download manager event:" << type;
- return false;
+ return;
}
}
-bool DownloadControllerPrivate::handleDownloadEvent(DownloadEvent * event)
+void DownloadControllerPrivate::handleDownloadEvent(
+ DownloadEvent * event)
{
- DEventType type = static_cast<DEventType>(event->type());
+ int id = event->id();
- DownloadEvent * dlEvent = static_cast<DownloadEvent*>(event);
-
- int dlId = dlEvent->getId();
-
- Download * download = m_downloadManager->findDownload(dlId);
+ WRT::Download * download = m_downloadManager->findDownload(id);
if (!download) {
- qDebug() << "Cannot found download with id" << dlId;
- return false;
+ qDebug() << "Cannot find download with id" << id << " for error " << event;
+ return;
}
- int errorNum = download->getAttribute(DlLastError).toInt();
+ int errorNum = download->attribute(WRT::LastError).toInt();
const char * errorStr = downloadErrorToString(
- static_cast<QNetworkReply::NetworkError>(errorNum));
+ static_cast<WRT::Error>(errorNum));
QString error;
if (errorStr != 0)
@@ -301,97 +375,139 @@
DownloadProxy downloadProxy(new DownloadProxyData(download));
- switch (type)
+ switch (event->type())
{
- case Started:
- emit m_downloadController->downloadStarted(downloadProxy);
- return true;
+
+ case WRT::DownloadEvent::Created:
+ // Nothing to do, we already emitted a signal to report
+ // creation of a new Download object from startDownload().
+ return;
- case HeaderReceived:
+ case WRT::DownloadEvent::Started:
+ emit m_downloadController->downloadStarted(downloadProxy);
+ return;
+
+ case WRT::DownloadEvent::HeadersReceived:
emit m_downloadController->downloadHeaderReceived(downloadProxy);
- return true;
+ return;
- case Progress:
+ case WRT::DownloadEvent::InProgress:
emit m_downloadController->downloadProgress(downloadProxy);
- return true;
+ return;
- case Completed:
+ case WRT::DownloadEvent::Completed:
emit m_downloadController->downloadFinished(downloadProxy);
- return true;
+ return;
- case Paused:
+ case WRT::DownloadEvent::Paused:
emit m_downloadController->downloadPaused(downloadProxy, error);
- return true;
+ return;
- case Cancelled:
+ case WRT::DownloadEvent::Cancelled:
emit m_downloadController->downloadCancelled(downloadProxy, error);
- return true;
+ return;
- case Failed:
+ case WRT::DownloadEvent::Failed:
emit m_downloadController->downloadFailed(downloadProxy, error);
- return true;
+ return;
- case DescriptorUpdated:
- // FIXME ;;; Update to support OMA and DRM.
- return true;
+ case WRT::DownloadEvent::DescriptorUpdated:
+ // FIXME - Update to support OMA and DRM.
+ return;
- case NetworkLoss:
+ case WRT::DownloadEvent::NetworkLoss:
emit m_downloadController->downloadNetworkLoss(downloadProxy, error);
- return true;
+ return;
+
+ case WRT::DownloadEvent::Error:
+ emit m_downloadController->downloadError(downloadProxy, error);
+ return;
+
+ case WRT::DownloadEvent::DescriptorReady:
+ // FIXME - Update to support OMA and DRM.
+ return;
+
+ case WRT::DownloadEvent::LicenseAcquiring:
+ // FIXME - Update to support OMA and DRM.
+ return;
- case Error:
- emit m_downloadController->downloadError(downloadProxy, error);
- return true;
+ case WRT::DownloadEvent::MediaRemoved:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Media Removed");
+ return;
+
+ case WRT::DownloadEvent::MediaInserted:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Media Inserted");
+ return;
+
+ case WRT::DownloadEvent::RedirectedPermanently:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Redirected Permanently");
+ return;
- case OMADownloadDescriptorReady:
- // FIXME ;;; Update to support OMA and DRM.
- return true;
+ case WRT::DownloadEvent::RedirectedTemporarily:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Redirected Temporarily");
+ return;
+
+ case WRT::DownloadEvent::NameChanged:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Name Changed");
+ return;
+
+ case WRT::DownloadEvent::ContentTypeChanged:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Type Changed");
+ return;
- case WMDRMLicenseAcquiring:
- // FIXME ;;; Update to support OMA and DRM.
- return true;
+ case WRT::DownloadEvent::CreatingConnection:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Creating Connection");
+ return;
+
+ case WRT::DownloadEvent::ConnectionNeeded:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Connection Needed");
+ return;
+
+ case WRT::DownloadEvent::ConnectionDisconnected:
+ // FIXME ;;; what to do?
+ emit m_downloadController->downloadMessage(
+ downloadProxy,
+ "Connection Disconnected");
+ return;
+
+ case WRT::DownloadEvent::RightObjectsAcquired:
+ // FIXME - Update to support OMA and DRM.
+ return;
default:
- qDebug() << "Unexpected download event:" << type;
+ qDebug() << "Unexpected download event:" << event->type();
break;
}
-
- return false;
}
-bool DownloadControllerPrivate::event(QEvent * e)
+void DownloadControllerPrivate::handleDownloadError(Error error)
{
- DownloadEvent * event = static_cast<DownloadEvent *>(e);
-
- DEventType type = static_cast<DEventType>(event->type());
-
- debugDownloadEvent(type);
-
- switch (type) {
- case DownloadCreated:
- case DownloadsCleared:
- case ConnectedToServer:
- case DisconnectedFromServer:
- case ServerError:
- return handleDownloadManagerEvent(event);
-
- case Started:
- case HeaderReceived:
- case Progress:
- case Completed:
- case Paused:
- case Cancelled:
- case Failed:
- case DescriptorUpdated:
- case NetworkLoss:
- case Error:
- case OMADownloadDescriptorReady:
- case WMDRMLicenseAcquiring:
- return handleDownloadEvent(event);
-
- default:
- return false;
- }
+ // Expect the WRT::DownloadEvent::Error case in handleDownloadEvent()
+ // above should handle anything likely to go through here.
}
// DownloadController implementation
@@ -438,8 +554,8 @@
// Empty implementation for when DownloadManager is unsupported.
DownloadController::DownloadController(
- const QString & client,
- const QNetworkProxy & proxy)
+ const QString & /*client*/,
+ const QNetworkProxy & /*proxy*/)
{}
DownloadController::~DownloadController()
@@ -466,6 +582,19 @@
emit unsupportedDownload(url);
}
+void DownloadControllerPrivate::handleDownloadManagerEvent(
+ DownloadManagerEvent * event)
+{
+}
+
+void DownloadControllerPrivate::handleDownloadEvent(
+ DownloadEvent * event)
+{
+}
+
+DownloadControllerPrivate::~DownloadControllerPrivate()
+{}
+
#endif // USE_DOWNLOAD_MANAGER
bool DownloadController::handlePage(QWebPage * page)
@@ -487,4 +616,3 @@
return succeeded;
}
-
--- a/browsercore/appfw/Api/Managers/downloadcontroller.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/downloadcontroller.h Mon Oct 04 00:04:54 2010 +0300
@@ -75,6 +75,8 @@
void downloadError(DownloadProxy downloadProxy, const QString & error);
+ void downloadMessage(DownloadProxy downloadProxy, const QString & message);
+
void downloadsCleared();
void unsupportedDownload(const QUrl & url);
--- a/browsercore/appfw/Api/Managers/downloadcontroller_p.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/downloadcontroller_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -25,18 +25,37 @@
#include <QObject>
#include "BWFGlobal.h"
-class QNetworkProxy;
-class QString;
-class QUrl;
+#ifdef USE_DOWNLOAD_MANAGER
+#include "download.h"
+#include "downloadmanager.h"
+
+// This seems to be necessary to use unqualified download manager
+// class names in the slots declarations below. We need to use
+// unqualified names because the signals they get connected to
+// use unqualified names and moc doesn't realize that DownloadXXX
+// and WRT::DownloadXXX are equivalent for some values of XXX.
+using namespace WRT;
+#else
class Download;
class DownloadEvent;
class DownloadManager;
+class DownloadManagerEvent;
+class Error;
+class QNetworkReply;
+#endif
+class QFileInfo;
+class QNetworkProxy;
+class QNetworkRequest;
+class QString;
+class QUrl;
class DownloadController;
class BWF_EXPORT DownloadControllerPrivate : public QObject
{
+ Q_OBJECT
+
public:
DownloadControllerPrivate(
DownloadController * controller,
@@ -50,17 +69,30 @@
void startDownload(const QNetworkRequest & request);
private:
- void startDownload(Download * download, const QUrl & url);
+#ifdef USE_DOWNLOAD_MANAGER
+ void startDownload(
+ WRT::Download * download,
+ const QUrl & url);
+#else
+ void startDownload(
+ Download * download,
+ const QUrl & url);
+#endif
- bool handleDownloadManagerEvent(DownloadEvent * event);
- bool handleDownloadEvent(DownloadEvent * event);
-
-protected:
- bool event(QEvent * event);
+public slots:
+ void handleDownloadManagerEvent(DownloadManagerEvent * event);
+ void handleDownloadEvent(DownloadEvent * event);
+#ifdef USE_DOWNLOAD_MANAGER
+ void handleDownloadError(Error error);
+#endif
private:
DownloadController * m_downloadController;
+#ifdef USE_DOWNLOAD_MANAGER
+ WRT::DownloadManager * m_downloadManager; // owned
+#else
DownloadManager * m_downloadManager; // owned
+#endif
};
#endif // __DOWNLOAD_CONTROLLER_PRIVATE_H__
--- a/browsercore/appfw/Api/Managers/downloadproxy_p.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/downloadproxy_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -24,12 +24,14 @@
#include <QString>
-class Download;
+namespace WRT {
+ class Download;
+}
class DownloadProxyData
{
public:
- DownloadProxyData(Download * download);
+ DownloadProxyData(WRT::Download * download);
~DownloadProxyData();
@@ -40,7 +42,7 @@
QString fileName();
private:
- Download * m_download;
+ WRT::Download * m_download;
};
#endif // __DOWNLOAD_PROXY_P_H__
--- a/browsercore/appfw/Api/Managers/downloadproxydata.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/downloadproxydata.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -27,9 +27,9 @@
#ifdef USE_DOWNLOAD_MANAGER
#include "download.h"
#include "downloadmanager.h"
-#endif // USE_DOWNLOAD_MANAGER
+#endif
-DownloadProxyData::DownloadProxyData(Download * download)
+DownloadProxyData::DownloadProxyData(WRT::Download * download)
: m_download(download)
{}
@@ -38,31 +38,24 @@
// Nothing to do, Download * is owned by DownloadManager.
}
-#ifdef USE_DOWNLOAD_MANAGER
// Helper functions for translating various download attribute enum values.
-
+#ifdef USE_DOWNLOAD_MANAGER
static const char * downloadState(int state)
{
switch (state) {
- case DlNone:
- return "None";
- case DlCreated:
+ case WRT::Download::Created:
return "Created";
- case DlStarted:
+ case WRT::Download::Started:
return "Started";
- case DlInprogress:
+ case WRT::Download::InProgress:
return "InProgress";
- case DlPaused:
+ case WRT::Download::Paused:
return "Paused";
- case DlCompleted:
+ case WRT::Download::Completed:
return "Completed";
- case DlFailed:
+ case WRT::Download::Failed:
return "Failed";
- case DlCancelled:
- return "Cancelled";
- case DlDescriptorUpdated:
- return "DescriptorUpdated";
default:
return "???";
}
@@ -124,26 +117,26 @@
// Helper functions to get download attribute of a particular type.
-static int intAttribute(Download * download, DownloadAttribute which)
+static int intAttribute(WRT::Download * download, WRT::DownloadAttribute which)
{
- return download->getAttribute(which).toInt();
+ return download->attribute(which).toInt();
}
-static uint uintAttribute(Download * download, DownloadAttribute which)
+static uint uintAttribute(WRT::Download * download, WRT::DownloadAttribute which)
{
- return download->getAttribute(which).toUInt();
+ return download->attribute(which).toUInt();
}
-static QString stringAttribute(Download * download, DownloadAttribute which)
+static QString stringAttribute(WRT::Download * download, WRT::DownloadAttribute which)
{
- return download->getAttribute(which).toString();
+ return download->attribute(which).toString();
}
// Helper functions for reporting download attributes.
template<typename T>
void debugDownloadAttribute(
- Download * download,
+ WRT::Download * download,
char const * name,
const T & value)
{
@@ -151,8 +144,8 @@
}
static void debugDownloadInt(
- Download * download,
- DownloadAttribute which,
+ WRT::Download * download,
+ WRT::DownloadAttribute which,
const char * name)
{
int value = intAttribute(download, which);
@@ -161,8 +154,8 @@
}
static void debugDownloadUInt(
- Download * download,
- DownloadAttribute which,
+ WRT::Download * download,
+ WRT::DownloadAttribute which,
const char * name)
{
uint value = uintAttribute(download, which);
@@ -171,8 +164,8 @@
}
static void debugDownloadStr(
- Download * download,
- DownloadAttribute which,
+ WRT::Download * download,
+ WRT::DownloadAttribute which,
const char * name)
{
QString value = stringAttribute(download, which);
@@ -180,9 +173,9 @@
debugDownloadAttribute(download, name, value);
}
-static void debugDownloadState(Download * download)
+static void debugDownloadState(WRT::Download * download)
{
- int num = intAttribute(download, DlDownloadState);
+ int num = intAttribute(download, WRT::State);
const char * state = downloadState(num);
@@ -190,9 +183,9 @@
}
-static void debugDownloadError(Download * download)
+static void debugDownloadError(WRT::Download * download)
{
- int num = intAttribute(download, DlLastError);
+ int num = intAttribute(download, WRT::LastError);
const char * error = downloadError(static_cast<QNetworkReply::NetworkError>(num));
@@ -201,74 +194,73 @@
// Helper function for implementing DownloadProxyData::debug().
-static void debugDownload(Download * download)
+static void debugDownload(WRT::Download * download)
{
debugDownloadState(download);
debugDownloadError(download);
debugDownloadStr(download,
- DlLastErrorString,
+ WRT::LastErrorString,
"LastErrorString");
debugDownloadStr(download,
- DlSourceUrl,
+ WRT::SourceUrl,
"SourceUrl");
debugDownloadStr(download,
- DlContentType,
+ WRT::ContentType,
"ContentType");
debugDownloadStr(download,
- DlDestPath,
- "DestPath");
+ WRT::DestinationPath,
+ "DestinationPath");
debugDownloadStr(download,
- DlFileName,
+ WRT::FileName,
"FileName");
debugDownloadInt(download,
- DlDownloadedSize,
+ WRT::DownloadedSize,
"DownloadedSize");
debugDownloadInt(download,
- DlTotalSize,
+ WRT::TotalSize,
"TotalSize");
debugDownloadInt(download,
- DlLastPausedSize,
+ WRT::LastPausedSize,
"LastPausedSize");
debugDownloadInt(download,
- DlPercentage,
+ WRT::Percentage,
"Percentage");
debugDownloadStr(download,
- DlStartTime,
+ WRT::StartTime,
"StartTime");
debugDownloadStr(download,
- DlEndTime,
+ WRT::EndTime,
"EndTime");
debugDownloadUInt(download,
- DlElapsedTime,
+ WRT::ElapsedTime,
"ElapsedTime");
debugDownloadStr(download,
- DlRemainingTime,
+ WRT::RemainingTime,
"RemainingTime");
debugDownloadStr(download,
- DlSpeed,
+ WRT::Speed,
"Speed");
debugDownloadInt(download,
- DlProgressInterval,
+ WRT::ProgressInterval,
"ProgressInterval");
}
-
-#endif // USE_DOWNLOAD_MANAGER
+#endif
void DownloadProxyData::debug()
{
@@ -279,14 +271,14 @@
int id = m_download->id();
- DownloadManager * manager = m_download->downloadManager();
+ WRT::DownloadManager * manager = m_download->downloadManager();
- Download * download = manager->findDownload(id);
+ WRT::Download * download = manager->findDownload(id);
if (download != 0) {
debugDownload(download);
}
-#endif // USE_DOWNLOAD_MANAGER
+#endif
}
void DownloadProxyData::remove()
@@ -296,14 +288,14 @@
return;
}
- DownloadManager * manager = m_download->downloadManager();
+ WRT::DownloadManager * manager = m_download->downloadManager();
manager->removeOne(m_download);
// Download is no longer valid.
m_download = 0;
-#endif // USE_DOWNLOAD_MANAGER
+#endif
}
QString DownloadProxyData::fileName()
@@ -313,8 +305,8 @@
return QString();
}
- return stringAttribute(m_download, DlFileName);
-#else // USE_DOWNLOAD_MANAGER
+ return stringAttribute(m_download, WRT::FileName);
+#else
return QString();
-#endif // USE_DOWNLOAD_MANAGER
+#endif
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/hsbookmarkpublishclient.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark publishing client
+*
+*/
+
+#include <qservicefilter.h>
+#include <qserviceinterfacedescriptor.h>
+
+#include <QMetaObject>
+#include <QMetaMethod>
+#include <QDir>
+#include <QUrl>
+#include <QIcon>
+#include <QWebSettings>
+#include <QCryptographicHash>
+#include <QTime>
+
+#include "bedrockprovisioning.h"
+#include "hsbookmarkpublishclient.h"
+
+namespace WRT {
+
+/*!
+ \ingroup group_bookmark_publish_client
+ \class HsBookmarkPublishClient
+ \brief Implementation for homescreen bookmark publish client.
+
+ HsBookmarkClient is derived from QObject and implements
+ needed functions for the homescreen bookmark publish client.
+*/
+
+/*!
+ Constructor.
+*/
+HsBookmarkPublishClient::HsBookmarkPublishClient(QObject *parent)
+ : QObject(parent),
+ mWidgetUri("hsbookmarkwidgetplugin")
+{
+ setObjectName("hsBookmarkPublishClient");
+}
+
+/*!
+ Destructor
+*/
+HsBookmarkPublishClient::~HsBookmarkPublishClient()
+{
+}
+
+/*!
+ Adds widget \a widgetUri utilizing service interface and invokeMethod call
+*/
+int HsBookmarkPublishClient::addWidget(QString Title, QString Url)
+{
+ // find interface IHomeScreenClient from service hshomescreenclientplugin
+ QServiceManager manager;
+ QServiceFilter filter("com.nokia.symbian.IHomeScreenClient");
+ filter.setServiceName("hshomescreenclientplugin");
+ QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);
+ QVariantHash params;
+ QString iconFileName;
+ params["bookmarkTitle"] = Title;
+ params["bookmarkUrl"] = Url;
+ params["faviconPath"] = BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsString("DataBaseDirectory");
+
+ if(interfaces.isEmpty()) {
+ QServiceManager::Error error = manager.error();
+ return FAILURE;
+ }
+
+ // Retrieve the favicon and check its exsistance
+ QIcon icon = QWebSettings::iconForUrl(Url);
+ if (!icon.isNull())
+ iconFileName = getIconFileName(Url);
+
+ params["faviconFileName"] = iconFileName;
+
+ saveFavicon(Url, iconFileName);
+
+ QObject* service = manager.loadInterface(interfaces.first());
+
+ // access service's addWidget function
+ bool retVal = false;
+ bool ret = QMetaObject::invokeMethod(
+ service,
+ "addWidget",
+ Qt::DirectConnection,
+ Q_RETURN_ARG(bool, retVal),
+ Q_ARG(QString,mWidgetUri),
+ Q_ARG(QVariantHash,params));
+
+ if(!ret){
+ // invokeMethod returned error
+ return FAILURE;
+ }
+ if(!retVal){
+ // addWidget returned error
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
+
+bool HsBookmarkPublishClient::saveFavicon(const QString Url, const QString iconFileName)
+{
+ QIcon icon;
+ QDir iconDir(BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->valueAsString("DataBaseDirectory"));
+ QUrl url(Url);
+
+ // Retrieve the favicon and check its exsistance
+ icon = QWebSettings::iconForUrl(url);
+ if (icon.isNull())
+ return false;
+
+ QString iconPath = iconDir.filePath(iconFileName);
+ QFile iconFile(iconPath);
+ iconFile.open(QIODevice::WriteOnly);
+
+ QPixmap pixmap = icon.pixmap(30, 30);
+ pixmap.save(&iconFile, "PNG");
+
+ iconFile.close();
+
+ return true;
+}
+
+/*!
+ \internal
+*/
+QString HsBookmarkPublishClient::getIconFileName(QString url) const
+{
+ QByteArray hash = QCryptographicHash::hash(url.toAscii(), QCryptographicHash::Md5);
+ QString iconFile = hash.left(16).toHex();
+ return iconFile + ".png";
+}
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/appfw/Api/Managers/hsbookmarkpublishclient.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark publishing client
+*
+*/
+#ifndef HSBOOKMARKPUBLISHCLIENT_H
+#define HSBOOKMARKPUBLISHCLIENT_H
+#include "brtglobal.h"
+#include <QObject>
+
+#include <qservicemanager.h>
+
+#include "singleton.h"
+
+QTM_USE_NAMESPACE
+
+namespace WRT {
+
+class WRT_BROWSER_EXPORT HsBookmarkPublishClient: public QObject
+{
+ Q_OBJECT
+
+public:
+
+ enum status {
+ SUCCESS = 0,
+ FAILURE = -1
+ };
+
+ HsBookmarkPublishClient(QObject *parent=0 );
+ ~HsBookmarkPublishClient();
+
+public slots:
+ int addWidget(QString Title, QString Url);
+
+private:
+ bool saveFavicon(const QString Url, const QString iconFileName);
+ QString getIconFileName(QString url) const;
+
+ QString mWidgetUri;
+};
+
+// Define the Meyer's singleton for HsBookmarkPublishClient
+typedef Singleton<HsBookmarkPublishClient> HsBookmarkPublishClientSingleton;
+
+}
+
+#endif HSBOOKMARKPUBLISHCLIENT_H
--- a/browsercore/appfw/Api/Managers/webpagecontroller.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/webpagecontroller.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -21,7 +21,7 @@
#include <assert.h>
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
#include "actionjsobject.h"
#include "webpagedata.h"
#include "wrtbrowsercontainer.h"
@@ -47,6 +47,15 @@
#include <QtCore/QSettings>
using namespace WRT;
+#ifdef ORBIT_UI
+#include <shareui.h>
+#include <qcontactemailaddress.h>
+#include <xqaiwdeclplat.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#endif // ORBIT_UI
+
+
#if defined(Q_OS_SYMBIAN) // for shareToMail
#include <miutset.h>
#include <sendui.h>
@@ -56,11 +65,16 @@
const TUid KShareOnline = { 0x200009D5 };
const TUid KShareOnOvi = { 0x2001AA43 };
#endif
+#ifdef ORBIT_UI
+static const QString EMAIL_SEND_TO_KEY = "to";
+#endif // ORBIT_UI
#define MAX_NUM_WINDOWS_TO_RESTORE 5
#define MAX_NUM_WINDOWS 5
static const char KHISTORYEXTENSION[] = ".history";
+static const char KCOOKIESEXTENSION[] = ".ini";
+
WebPageControllerPrivate::WebPageControllerPrivate(WebPageController* qq) :
q(qq),
@@ -111,13 +125,13 @@
{
q->deleteDataFiles();
}
-/* #if defined(Q_OS_SYMBIAN)
+
// clean up all pages
while ( !m_allPages.isEmpty() )
- q->closePage(m_allPages.at(0));
+ q->closePage(m_allPages.at(0));
Q_ASSERT ( m_allPages.isEmpty() );
- #endif*/
+
// delete(m_widgetParent);
}
@@ -283,7 +297,6 @@
*/
void WebPageController::closePage ( WRT::WrtBrowserContainer *page )
{
- if(pageCount() > 1) {
WRT::WrtBrowserContainer * theCurrentPage = currentPage();
bool updateCurrentPageIndex = false;
@@ -297,7 +310,7 @@
// select the previous page unless at the beginning, then select next
if(page == theCurrentPage) {
int newCurrIndex = closeIndex - 1;
- if(closeIndex == 0 ) {
+ if(closeIndex == 0 && pageCount() > 1) {
newCurrIndex = closeIndex + 1;
}
@@ -309,7 +322,6 @@
}
else {
d->m_currentPage = -1;
- emit pageChanged(page, NULL);
}
}
else {
@@ -335,7 +347,6 @@
emit pageDeleted(page);
delete page;
- }
}
/*!
@@ -381,7 +392,7 @@
connect( page, SIGNAL( databaseQuotaExceeded (QWebFrame *,QString) ), SLOT( onDatabaseQuotaExceeded (QWebFrame *,QString)) );
- connect( page->mainFrame(), SIGNAL( iconChanged() ), SIGNAL( pageIconChanged() ) );
+ connect( page->mainFrame(), SIGNAL( iconChanged() ), this, SIGNAL( pageIconChanged() ) );
connect( page->loadController(), SIGNAL( pageLoadStarted() ), SIGNAL( pageLoadStarted() ) );
connect( page->loadController(), SIGNAL( pageLoadFailed() ), SIGNAL( pageLoadFailed() ) );
connect( page->loadController(), SIGNAL( pageLoadProgress(int) ), SIGNAL( pageLoadProgress(int) ) );
@@ -433,7 +444,7 @@
void WebPageController::onDatabaseQuotaExceeded (QWebFrame *frame, QString database)
{
- QString dbdir = QWebSettings::offlineStoragePath ();
+ QString dbdir = QWebSettings::offlineStoragePath ();
QDir dir(dbdir);
if(!dir.exists()||(dir.count() <= 1)) // empty DB
@@ -446,7 +457,8 @@
qint64 quota = qwso.databaseQuota() ;
qint64 usage = qwso.databaseUsage() ;
}
- m_promptMsg = "Database Quota Error";
+ //m_promptMsg = "Database Quota Error";
+ m_promptMsg = qtTrId("txt_browser_error_database_quota");
emit databaseQuotaExceeded (frame, database);
return;
@@ -461,7 +473,7 @@
page->setUpdateThumbnail(true);
// Current page is handled in onLoadFinished() so skip this case here
if(page != currentPage()){
- BookmarksManager::getSingleton()->addHistory(page->mainFrame()->url().toString(), page->pageTitle());
+ HistoryManager::getSingleton()->addHistory(page->mainFrame()->url().toString(), page->pageTitle());
emit (loadFinishedForBackgroundWindow(true,page));
}
}
@@ -469,7 +481,7 @@
void WebPageController::updateHistory()
{
- BookmarksManager::getSingleton()->addHistory(currentDocUrl(), currentDocTitle());
+ HistoryManager::getSingleton()->addHistory(currentDocUrl(), currentDocTitle());
emit(loadFinished(true));
}
@@ -710,6 +722,14 @@
#if defined(Q_OS_SYMBIAN)
void WebPageController::share(const QString &url)
{
+#ifdef ORBIT_UI
+ ShareUi *shareUi = new ShareUi();
+ QStringList stringList;
+ stringList << QString(url);
+ shareUi->send(stringList,true);
+ if(shareUi)
+ delete shareUi;
+#else
QString body = url;
CSendUi* sendUi = CSendUi::NewLC();
CMessageData* messageData = CMessageData::NewLC();
@@ -749,6 +769,7 @@
messageData->SetBodyTextL( bodyRichText );
sendUi->ShowQueryAndSendL(messageData, sendingCapabilities, array);
CleanupStack::PopAndDestroy( 6 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi
+#endif // ORBIT_UI
}
#else
void WebPageController::share(const QString &url)
@@ -763,6 +784,30 @@
#if defined(Q_OS_SYMBIAN)
void WebPageController::feedbackMail(const QString &mailAddress, const QString &mailBody)
{
+#ifdef ORBIT_UI
+
+ XQAiwRequest *sendRequest;
+ XQApplicationManager appManager;
+ QVariant retValue;
+
+ sendRequest = appManager.create(XQI_EMAIL_MESSAGE_SEND, "send(QVariant)",true);
+
+ if(sendRequest) {
+ QMap<QString, QVariant> map;
+ QStringList recipients;
+ QList<QVariant> data;
+ recipients.append(mailAddress);
+ map.insert(EMAIL_SEND_TO_KEY, recipients);
+ data.append(map);
+ data << mailBody;
+ sendRequest->setArguments(data);
+ sendRequest->send(retValue);
+ }
+
+ if(sendRequest) {
+ delete sendRequest;
+ }
+#else
QString to = mailAddress;
QString body = mailBody;
CSendUi* sendUi = CSendUi::NewLC();
@@ -788,6 +833,7 @@
TRAP_IGNORE(sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ));
// TRAP_IGNORE(sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, messageData ));
CleanupStack::PopAndDestroy( 5 );
+#endif //// ORBIT_UI
}
#else
void WebPageController::feedbackMail(const QString &mailAddress, const QString &mailBody)
@@ -931,8 +977,14 @@
return WebPageController::getSingleton()->openPage();
}
+
+QString WebPageController::removeScheme(const QString & s) {
+
+ return (WRT::UiUtil::removeScheme(s));
+}
+
QString WebPageController::guessUrlFromString(const QString &s){
- QUrl u = WRT::UiUtil::guessUrlFromString(s);
+ QUrl u = WRT::UiUtil::guessUrlFromString(s);
return u.toString();
}
@@ -1393,13 +1445,14 @@
void WebPageController::deleteCookies()
{
- QDir dir(d->m_historyDir);
+ QDir dir(d->m_historyDir);
QFileInfoList fileList(dir.entryInfoList(QDir::Files));
QString indexStr;
int index = 0;
foreach (const QFileInfo fileInfo, fileList) {
const QString filePath(fileInfo.absoluteFilePath());
- if (filePath.endsWith(QString(KHISTORYEXTENSION), Qt::CaseInsensitive)) {
+ //if (filePath.endsWith(QString(KHISTORYEXTENSION), Qt::CaseInsensitive)) {
+ if (filePath.endsWith(QString(KCOOKIESEXTENSION), Qt::CaseInsensitive)) {
indexStr.setNum(index);
QString cookiesFile = d->m_historyDir + QLatin1String("/cookies.ini");
QFile file(cookiesFile);
@@ -1447,7 +1500,7 @@
return;
//QDir dir1(d->m_historyDir +"/cwrtCache/http");
- QDir dir1(diskCacheDir + "/brCache/http");
+ QDir dir1(diskCacheDir + "/http");
QFileInfoList fileList1(dir1.entryInfoList(QDir::Files));
@@ -1461,7 +1514,7 @@
}
//QDir dir2(d->m_historyDir +"/cwrtCache/https");
- QDir dir2(diskCacheDir +"/brCache/https");
+ QDir dir2(diskCacheDir +"/https");
QFileInfoList fileList2(dir2.entryInfoList(QDir::Files));
@@ -1566,10 +1619,12 @@
{
// update current page's thumbnail forcely since the scrolling position may change
WRT::WrtBrowserContainer *page = currentPage();
- QWebHistoryItem item = page->history()->currentItem();
- page->savePageDataToHistoryItem(page->mainFrame(), &item);
- page->setUpdateThumbnail(false);
- checkAndUpdatePageThumbnails();
+ if(page) {
+ QWebHistoryItem item = page->history()->currentItem();
+ page->savePageDataToHistoryItem(page->mainFrame(), &item);
+ page->setUpdateThumbnail(false);
+ checkAndUpdatePageThumbnails();
+ }
}
void WebPageController::resizeAndUpdatePageThumbnails(QSize& s)
@@ -1591,13 +1646,18 @@
return currentPage()->loadController()->mode();
}
-void WebPageController::setLoadState(int mode) {
+void WebPageController::setEditMode(bool editing) {
//qDebug() << __func__;
- currentPage()->loadController()->setMode((WRT::LoadController::GotoBrowserMode)mode);
+ currentPage()->loadController()->setEditMode(editing);
//qDebug() << __func__ << currentPage()->loadController()->mode();
}
+bool WebPageController::editMode() {
+
+ return (currentPage()->loadController()->editMode());
+}
+
int WebPageController::loadProgressValue() {
//qDebug() << __func__ << currentPage()->loadController()->progressValue();
--- a/browsercore/appfw/Api/Managers/webpagecontroller.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Managers/webpagecontroller.h Mon Oct 04 00:04:54 2010 +0300
@@ -163,6 +163,9 @@
QString partialUrl(const QUrl &url);
bool removeDirectory(QDir &aDir);
+ void setEditMode(bool);
+ bool editMode();
+ Q_PROPERTY(bool editMode READ editMode)
private:
void checkAndUpdatePageThumbnails();
@@ -174,8 +177,8 @@
QAction * getActionStop();
QAction * getActionBack();
QAction * getActionForward();
+
public slots:
- void setLoadState(int);
int pageCount();
QString getLastUrl();
void deleteCookies();
@@ -210,6 +213,7 @@
void loadFromHistory();
void loadLocalFile();
QString guessUrlFromString(const QString &s);
+ QString removeScheme(const QString &s);
QString searchUrl(const QString &s);
QObjectList fetchSuggestions(const QString &s);
@@ -293,5 +297,8 @@
LowMemoryHandler *m_memoryHandler;
WebPageControllerPrivate * const d;
int m_settingsLoaded;
+#ifdef ENABLE_TESTS
+ friend class WebPageControllerTest;
+#endif
};
#endif // __WEBPAGECONTROLLER_H__
--- a/browsercore/appfw/Api/Views/WindowView.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Views/WindowView.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -446,8 +446,11 @@
size.scale(imgSize, Qt::KeepAspectRatio);
img = img.copy(0, 0, size.width(), size.height());
}
-
+#ifdef BROWSER_LAYOUT_TENONE
+ d->m_flowInterface->addSlide(img);
+#else
d->m_flowInterface->addSlide(img, title);
+#endif
}
setCenterIndex(d->m_pageManager->currentPage());
}
--- a/browsercore/appfw/Api/Views/mostvisitedpagestore.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Api/Views/mostvisitedpagestore.h Mon Oct 04 00:04:54 2010 +0300
@@ -47,6 +47,9 @@
QString m_url;
QImage *m_pageThumbnail;
uint m_pageRank;
+#ifdef ENABLE_TESTS
+ friend class MostVistedPageTest;
+#endif
};
@@ -81,4 +84,7 @@
MostVisitedPageList m_pageList;
QString m_mvpFile;
bool m_needPersistWrite;
+#ifdef ENABLE_TESTS
+ friend class MostVistedPageTest;
+#endif
};
--- a/browsercore/appfw/Common/FilmstripFlow.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/appfw/Common/FilmstripFlow.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -226,8 +226,10 @@
QRectF target = m_movie->movieClip(0);
int w = target.width();
int h = target.height();
+#ifndef BROWSER_LAYOUT_TENONE
if (m_name.isEmpty())
m_name = qtTrId("txt_browser_windows_new_window");
+#endif
m_img = QImage(w, h, QImage::Format_RGB32);
QPainter painter(&m_img);
--- a/browsercore/core/ZoomMetaData.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/ZoomMetaData.h Mon Oct 04 00:04:54 2010 +0300
@@ -43,6 +43,7 @@
*/
qreal minScale;
qreal maxScale;
+ qreal zoomValue;
bool userScalable;
#ifdef BEDROCK_TILED_BACKING_STORE
qreal initialScale;
--- a/browsercore/core/core.pri Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/core.pri Mon Oct 04 00:04:54 2010 +0300
@@ -23,6 +23,7 @@
$$PWD/network/webcookiejar.h \
$$PWD/network/webnetworkaccessmanager.h \
$$PWD/network/SchemeHandlerBr.h \
+ $$PWD/network/SchemeHandlerBr_p.h \
$$PWD/actionjsobject.h \
$$PWD/browserpagefactory.h \
$$PWD/brtglobal.h \
@@ -49,10 +50,25 @@
$$PWD/network/WebNetworkSession.cpp \
}
+# QtHighway is used in TB10.1 for Application Interworking (AIW) support.
+contains(br_qthighway, yes) {
+HEADERS += \
+ $$PWD/network/SchemeHandlerBrQtHighway_p.h
+SOURCES += \
+ $$PWD/network/SchemeHandlerBrQtHighway_p.cpp
+}
+
+# Use default scheme handler if not using QtHighway.
+contains(br_qthighway, no) {
+HEADERS += \
+ $$PWD/network/SchemeHandlerBrDefault_p.h
+SOURCES += \
+ $$PWD/network/SchemeHandlerBrDefault_p.cpp
+
symbian: {
SOURCES += $$PWD/network/WrtTelServiceBr.cpp
HEADERS += \
$$PWD/network/WrtTelServiceBr.h \
$$PWD/network/WrtTelServiceBr_p.h
-
-}
\ No newline at end of file
+}
+}
--- a/browsercore/core/core.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/core.pro Mon Oct 04 00:04:54 2010 +0300
@@ -54,7 +54,17 @@
}
}
-LIBS += -lBedrockProvisioning -lbrowsercontentdll
+LIBS += -lBedrockProvisioning -lbrowsercontentdll
+LIBS += -lbookmarksapi
+
+contains(br_orbit_ui, yes) {
+ LIBS += -lshareui -lxqservice
+ DEFINES += ORBIT_UI
+}
+
+contains(br_layout, tenone) {
+ DEFINES +=BROWSER_LAYOUT_TENONE
+}
RESOURCES += $$PWD/../browsercore.qrc
@@ -113,6 +123,17 @@
DEFINES += QT_MOBILITY_BEARER_MANAGEMENT
}
+contains(br_mobility_serviceframework, yes) {
+ CONFIG += mobility
+ MOBILITY = serviceframework
+}
+
+# QtHighway is used in TB10.1 for Application Interworking (AIW) support.
+contains(br_qthighway, yes) {
+ DEFINES += QTHIGHWAY
+ LIBS += -lxqservice -lxqserviceutil
+}
+
contains(QT_CONFIG, embedded): CONFIG += embedded
!CONFIG(QTDIR_build) {
@@ -165,11 +186,12 @@
# Import pre-built binary components.
symbian: {
- contains (br_download_mgr, yes) {
+ contains(browser_addon, no) {
DEFINES += USE_DOWNLOAD_MANAGER=1
INCLUDEPATH += /epoc32/include/applications
- LIBS += -lBrServiceIPCClient
- LIBS += -lBrDownloadMgr
+ INCLUDEPATH += /epoc32/include/platform/mw/cwrt
+ LIBS += -lWrtDownloadMgrIpc
+ LIBS += -lWrtDownloadMgr
}
} else {
include($$PWD/../../../../../import/import.pri)
@@ -203,3 +225,6 @@
INCLUDEPATH += $$PWD $$MW_LAYER_SYSTEMINCLUDE $$APP_LAYER_SYSTEMINCLUDE
# INCLUDEPATH += /epoc32/include/oem/tgfw
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/browsercore/core/network/SchemeHandlerBr.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/network/SchemeHandlerBr.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -21,36 +21,26 @@
// INCLUDE FILES
#include <QUrl>
-#include <QDesktopServices>
-#include <QStringList>
+#ifndef QTHIGHWAY
+#include "SchemeHandlerBrDefault_p.h"
+#else // QTHIGHWAY defined
+#include "SchemeHandlerBrQtHighway_p.h"
+#endif
-#if defined(Q_OS_SYMBIAN)
-#include "WrtTelServiceBr.h"
-#include <miutset.h> // KUidMsgTypeSMTP
-#include <sendui.h> // CSendUi
-#include <cmessagedata.h> // CMessageData
-//For Rtsp Scheme
-#include <aiwgenericparam.h>
-#include <DocumentHandler.h>
-#include <apparc.h>
-#endif
#include "SchemeHandlerBr.h"
+#include "SchemeHandlerBr_p.h"
#include "bedrockprovisioning.h"
-#define MAILTO_SCHEME "mailto"
-#define TEL_SCHEME "tel"
-#define SIP_SCHEME "sip"
-#define WTAI_SCHEME "wtai"
-#define WTAI_MC "/mc;"
-#define WTAI_AP "/ap;"
-#define RTSP_SCHEME "rtsp"
-#if defined(Q_OS_SYMBIAN)
-_LIT( KRtspFileName, "c:\\system\\temp\\RtspTemp.ram" );
-#endif
+#define HTTP_SCHEME "http"
+#define HTTPS_SCHEME "https"
+#define FILE_SCHEME "file"
+
namespace WRT {
-
+
+// ================= METHODS =======================
+
/*!
* \class SchemeHandler
* \brief Schemehandler class
@@ -59,266 +49,69 @@
// SchemeHandler::SchemeHandler()
// ---------------------------------------------------------
//
-SchemeHandler::SchemeHandler()
-#if defined(Q_OS_SYMBIAN)
- :
- m_telService(NULL)
-#endif
+SchemeHandler::SchemeHandler() : QObject(), d(new SCHEME_HNDLR_PRIVATE())
{
}
SchemeHandler::~SchemeHandler()
{
-#if defined(Q_OS_SYMBIAN)
- delete m_telService;
-#endif
+ delete d;
}
/*!
- * @param url :
- * @return
- */
-bool SchemeHandler::HandleSpecialScheme(const QUrl &url)
+ Handles specified URL if it is one of the known schemes. If supported, the
+ url is sent to an external application to be handled.
+*/
+SchemeHandler::SchemeHandlerError SchemeHandler::HandleSpecialScheme(const QUrl &url)
{
- return HandleUrlEmbedded( url, ReadSdConfirmDtmfValue() );
+ return d->HandleUrl(url, d->ReadSdConfirmDtmfValue());
}
+// ================= SchemeHandlerPrivate METHODS =======================
+
/*!
- * @return turn/false
+ * \class SchemeHandlerPrivate
+ * \brief SchemeHandlerPrivate class
*/
-bool SchemeHandler::ReadSdConfirmDtmfValue()
+// ---------------------------------------------------------
+// SchemeHandlerPrivate::SchemeHandlerPrivate()
+// ---------------------------------------------------------
+//
+SchemeHandlerPrivate::SchemeHandlerPrivate()
+{
+}
+
+SchemeHandlerPrivate::~SchemeHandlerPrivate()
+{
+}
+
+/*!
+ Returns ConfirmDTMF value as a bool.
+*/
+bool SchemeHandlerPrivate::ReadSdConfirmDtmfValue()
{
return BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->value("ConfirmDTMF",false).toBool();
}
/*!
- * HandleUrlEmbedded
- * @return true/false
- */
-bool SchemeHandler::HandleUrlEmbedded( const QUrl &url, bool /*confirmDTMF*/ )
+ Handles the specified URL. Calls the handler method corresponding to the
+ URL scheme.
+*/
+SchemeHandler::SchemeHandlerError SchemeHandlerPrivate::HandleUrl(const QUrl &url, bool /*confirmDTMF*/)
{
- QString path = url.path();
QString scheme = url.scheme().toLower();
-
-#if defined(Q_OS_SYMBIAN)
- if (!m_telService)
- m_telService = new WrtTelService();
-#endif
-
- if (scheme.startsWith("h") || scheme.startsWith("f"))
- // quickly exit if scheme is http, https, or file
- return false;
-
- else if (scheme.startsWith(MAILTO_SCHEME))
- return HandleMailtoScheme(url);
-
- else if (scheme.startsWith(RTSP_SCHEME))
- return HandleRtspScheme(url);
+ SchemeHandler::SchemeHandlerError retVal = SchemeHandler::SchemeUnsupported;
-#if defined(Q_OS_SYMBIAN)
- else if (scheme.startsWith(TEL_SCHEME)) {
- //m_telService->MakeCall(path, confirmDTMF);
- QDesktopServices::openUrl(url);
- return true;
- }
- else if (scheme.startsWith(SIP_SCHEME)) {
- //m_telService->MakeVOIPCall(path, confirmDTMF);
- QDesktopServices::openUrl(url);
- return true;
+ if ((scheme == HTTP_SCHEME) || (scheme == HTTPS_SCHEME) ||
+ (scheme == FILE_SCHEME)) {
+ // exit if scheme is http, https, or file
+ retVal = SchemeHandler::SchemeNotHandled;
+ } else {
+ retVal = HandleScheme(url);
}
- else if (scheme.startsWith(WTAI_SCHEME)) {
- if (path.startsWith(WTAI_MC)) {
- QString number = path.mid(path.indexOf(';') + 1);
- //m_telService->MakeCall(number, confirmDTMF);
- number = "tel:" + number;
- QUrl dialUrl(number);
- QDesktopServices::openUrl(dialUrl);
- return true;
- }
- }
-#endif
- return false;
+ return retVal;
}
-
-#if !defined(Q_OS_SYMBIAN)
-/*
- * HandleMailtoScheme
- * @return true/false
- */
-bool SchemeHandler::HandleMailtoScheme(const QUrl &url)
-{
-#ifndef QT_NO_DESKTOPSERVICES
- return QDesktopServices::openUrl(url);
-#else
- return false;
-#endif
-}
-#else // Q_OS_SYMBIAN
-/*
- * HandleMailtoScheme
- * @return true/false
- */
-
-bool SchemeHandler::HandleMailtoScheme(const QUrl &url)
-{
- TRAPD(err, HandleMailtoSchemeL(url));
- return err ? false : true;
-}
-void SchemeHandler::HandleMailtoSchemeL(const QUrl &url)
-{
- QString recipient = url.path();
- QString subject = url.queryItemValue("subject");
- QString body = url.queryItemValue("body");
- QString to = url.queryItemValue("to");
- QString cc = url.queryItemValue("cc");
- QString bcc = url.queryItemValue("bcc");
-
- // these fields might have comma separated addresses
- QStringList recipients = recipient.split(",");
- QStringList tos = to.split(",");
- QStringList ccs = cc.split(",");
- QStringList bccs = bcc.split(",");
-
-
- CSendUi* sendUi = CSendUi::NewLC();
-
- // Construct symbian sendUI data holder
- CMessageData* messageData = CMessageData::NewLC();
-
- // Subject
- TPtrC subj( qt_QString2TPtrC(subject) );
- messageData->SetSubjectL( &subj );
-
- // Body
- CParaFormatLayer* paraFormat = CParaFormatLayer::NewL();
- CleanupStack::PushL( paraFormat );
- CCharFormatLayer* charFormat = CCharFormatLayer::NewL();
- CleanupStack::PushL( charFormat );
- CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat );
- CleanupStack::PushL( bodyRichText );
-
- TPtrC bodyPtr( qt_QString2TPtrC(body) );
- if( bodyPtr.Length() )
- bodyRichText->InsertL( 0, bodyPtr );
- else
- bodyRichText->InsertL( 0, KNullDesC );
-
- messageData->SetBodyTextL( bodyRichText );
-
- // To
- foreach(QString item, recipients)
- messageData->AppendToAddressL(qt_QString2TPtrC(item));
-
- foreach(QString item, tos)
- messageData->AppendToAddressL(qt_QString2TPtrC(item));
-
- // Cc
- foreach(QString item, ccs)
- messageData->AppendCcAddressL(qt_QString2TPtrC(item));
-
- // Bcc
- foreach(QString item, bccs)
- messageData->AppendBccAddressL(qt_QString2TPtrC(item));
-
- TRAP_IGNORE(sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ));
- CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi
-}
-// Returned TPtrC is valid as long as the given parameter is valid and unmodified
-TPtrC SchemeHandler::qt_QString2TPtrC( const QString& string )
-{
- return reinterpret_cast<const TUint16*>(string.utf16());
-}
-#endif
-
-#if !defined(Q_OS_SYMBIAN)
-/*
- * HandleRtspScheme
- * @return true/false
- */
-bool SchemeHandler::HandleRtspScheme(const QUrl &url)
-{
-#ifndef QT_NO_DESKTOPSERVICES
- return QDesktopServices::openUrl(url);
-#else
- return false;
-#endif
-}
-#else // Q_OS_SYMBIAN
-/*
- * HandleRtspSchemeL
- * @return true/false
- */
-
-bool SchemeHandler::HandleRtspScheme(const QUrl &url)
-{
- TRAPD(err, HandleRtspSchemeL(url));
- return (err ? false : true);
-}
-void SchemeHandler::HandleRtspSchemeL(const QUrl &url)
-{
- //Launch the appropriate application in embedded mode
-
- RFs rfs;
- RFile ramFile;
-
- HBufC* urlBuf = qt_QString2HBufC(url.toString());
- CleanupStack::PushL(urlBuf);
- // 8-bit buffer is required.
- HBufC8* urlBuf8 = HBufC8::NewLC( urlBuf->Size() );
- urlBuf8->Des().Copy( *urlBuf );
-
- // Open the file.
- User::LeaveIfError(rfs.Connect());
- CleanupClosePushL(rfs);
-
- // Replace file if exists or Create file if not exist yet
- User::LeaveIfError( ramFile.Replace( rfs, KRtspFileName, EFileWrite | EFileShareAny ) );
- CleanupClosePushL(ramFile);
- // Write to file
- User::LeaveIfError( ramFile.Write(*urlBuf8) );
- ramFile.Flush();
-
- CleanupStack::PopAndDestroy(/*ramFile*/);
- CleanupStack::PopAndDestroy(/*rfs*/);
- CleanupStack::PopAndDestroy( /*urlBuf8*/ );
- CleanupStack::PopAndDestroy( /*urlBuf*/ );
-
- RFile ramDocTempFile;
- CDocumentHandler* docHandler = CDocumentHandler::NewL();
- docHandler->OpenTempFileL( KRtspFileName, ramDocTempFile );
-
- CleanupClosePushL( ramDocTempFile );
-
- TDataType dataType( _L8("audio/x-pn-realaudio-plugin") );
- CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC();
- TAiwVariant filename( _L8("c:\\system\\temp\\RtspTemp.ram") );
- TAiwGenericParam param( EGenericParamFile, filename );
-
- paramList->AppendL( param );
-
- // Allow save among Options
-
- TBool allowSave( ETrue );
- TAiwVariant allowSaveVariant( allowSave );
- TAiwGenericParam genericParamAllowSave
- ( EGenericParamAllowSave, allowSaveVariant );
-
- paramList->AppendL( genericParamAllowSave );
-
- // launch RAM file via DocHandler
-
- docHandler->OpenFileEmbeddedL( ramDocTempFile, dataType, *paramList );
-
- CleanupStack::PopAndDestroy( paramList );
- CleanupStack::PopAndDestroy( &ramDocTempFile );
-}
-
-HBufC* SchemeHandler::qt_QString2HBufC(const QString& string) {
- TPtrC16 str(reinterpret_cast<const TUint16*>(string.utf16()));
- return str.Alloc();
-}
-#endif
-}
+} // WRT
--- a/browsercore/core/network/SchemeHandlerBr.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/network/SchemeHandlerBr.h Mon Oct 04 00:04:54 2010 +0300
@@ -25,20 +25,14 @@
// INCLUDES
#include <QtCore/QObject>
-#if defined(Q_OS_SYMBIAN)
-#include <txtrich.h> // CRichText
-#endif
// CLASS DECLARATION
class QUrl;
-#if defined(Q_OS_SYMBIAN)
-class WrtTelService;
-#endif
-
namespace WRT {
+class SchemeHandlerPrivate;
/**
* Scheme Handler IF definition class
@@ -48,28 +42,21 @@
Q_OBJECT
public:
+ enum SchemeHandlerError {
+ NoError, // Success
+ SchemeNotHandled, // http(s) and file schemes to be handled elsewhere
+ SchemeUnsupported, // scheme not supported
+ LaunchFailed // attempt to launch handling application failed
+ };
+
SchemeHandler();
~SchemeHandler();
- bool HandleSpecialScheme(const QUrl &url);
+ SchemeHandlerError HandleSpecialScheme(const QUrl &url);
private:
- bool ReadSdConfirmDtmfValue();
- bool HandleUrlEmbedded( const QUrl &url, bool confirmDTMF );
-
- bool HandleMailtoScheme(const QUrl &url);
- bool HandleRtspScheme(const QUrl &url);
-#if defined(Q_OS_SYMBIAN)
- void HandleRtspSchemeL(const QUrl &url);
- void HandleMailtoSchemeL(const QUrl &url);
- TPtrC qt_QString2TPtrC( const QString& string );
- HBufC* qt_QString2HBufC(const QString& string);
-#endif
-
-private:
-#if defined(Q_OS_SYMBIAN)
- WrtTelService* m_telService; ///< Owned.
-#endif
+ SchemeHandlerPrivate *d;
};
+
}
#endif /* def SCHEME_HANDLER_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/core/network/SchemeHandlerBrDefault_p.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,344 @@
+/*
+* 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 FILES
+#include <QUrl>
+#include <QDesktopServices>
+#include <QStringList>
+
+#if defined(Q_OS_SYMBIAN)
+#include "WrtTelServiceBr.h"
+#include <miutset.h> // KUidMsgTypeSMTP
+#include <sendui.h> // CSendUi
+#include <cmessagedata.h> // CMessageData
+//For Rtsp Scheme
+#include <aiwgenericparam.h>
+#include <DocumentHandler.h>
+#include <apparc.h>
+
+_LIT( KRtspFileName, "c:\\system\\temp\\RtspTemp.ram" );
+#endif // defined(Q_OS_SYMBIAN)
+
+#include "SchemeHandlerBr_p.h"
+#include "SchemeHandlerBrDefault_p.h"
+
+#define MAILTO_SCHEME "mailto"
+#define TEL_SCHEME "tel"
+#define RTSP_SCHEME "rtsp"
+#define SIP_SCHEME "sip"
+#define WTAI_SCHEME "wtai"
+#define WTAI_MC "/mc;"
+#define WTAI_AP "/ap;"
+
+namespace WRT {
+
+DefSchemeHandlerPrivate::DefSchemeHandlerPrivate()
+#if defined(Q_OS_SYMBIAN)
+ : m_telService(NULL)
+#endif
+{
+}
+
+DefSchemeHandlerPrivate::~DefSchemeHandlerPrivate()
+{
+#if defined(Q_OS_SYMBIAN)
+ delete m_telService;
+#endif
+}
+
+/*!
+ * HandleUrl
+ * @return true/false
+ */
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleUrl(const QUrl &url, bool confirmDTMF)
+{
+#if defined(Q_OS_SYMBIAN)
+ if (!m_telService)
+ m_telService = new WrtTelService();
+#endif
+
+ return SchemeHandlerPrivate::HandleUrl(url, confirmDTMF);
+}
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleScheme(const QUrl &url)
+{
+ QString scheme = url.scheme().toLower();
+ SchemeHandler::SchemeHandlerError retVal = SchemeHandler::SchemeUnsupported;
+
+ if (scheme == MAILTO_SCHEME) {
+ // launch associated program
+ retVal = HandleMailtoScheme(url);
+ }
+ else if (scheme == RTSP_SCHEME) {
+ // launch associated program
+ retVal = HandleRtspScheme(url);
+ }
+
+#if defined(Q_OS_SYMBIAN)
+ else if (scheme == TEL_SCHEME) {
+ // launch associated program
+ retVal = HandleTelScheme(url);
+ }
+ else if (scheme == SIP_SCHEME) {
+ // launch associated program
+ retVal = HandleSipScheme(url);
+ }
+ else if (scheme == WTAI_SCHEME) {
+ QString path = url.path();
+
+ if (path.startsWith(WTAI_MC)) {
+ // launch associated program
+ retVal = HandleWtaiMcScheme(url);
+ }
+ }
+#endif
+
+ return retVal;
+}
+
+
+#if !defined(Q_OS_SYMBIAN)
+/*
+ * HandleMailtoScheme
+ * @return true/false
+ */
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleMailtoScheme(const QUrl &url)
+{
+ SchemeHandler::SchemeHandlerError retVal = SchemeHandler::NoError;
+#ifndef QT_NO_DESKTOPSERVICES
+ if (!QDesktopServices::openUrl(url)) {
+ // Failed to handle scheme
+ retVal = SchemeHandler::LaunchFailed;
+ }
+#else
+ retVal = SchemeHandler::SchemeUnsupported;
+#endif
+
+ return (retVal);
+}
+#else // Q_OS_SYMBIAN
+/*
+ * HandleMailtoScheme
+ * @return true/false
+ */
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleMailtoScheme(const QUrl &url)
+{
+ TRAPD(err, HandleMailtoSchemeL(url));
+ return err ? SchemeHandler::LaunchFailed : SchemeHandler::NoError;
+}
+void DefSchemeHandlerPrivate::HandleMailtoSchemeL(const QUrl &url)
+{
+ QString recipient = url.path();
+ QString subject = url.queryItemValue("subject");
+ QString body = url.queryItemValue("body");
+ QString to = url.queryItemValue("to");
+ QString cc = url.queryItemValue("cc");
+ QString bcc = url.queryItemValue("bcc");
+
+ // these fields might have comma separated addresses
+ QStringList recipients = recipient.split(",");
+ QStringList tos = to.split(",");
+ QStringList ccs = cc.split(",");
+ QStringList bccs = bcc.split(",");
+
+
+ CSendUi* sendUi = CSendUi::NewLC();
+
+ // Construct symbian sendUI data holder
+ CMessageData* messageData = CMessageData::NewLC();
+
+ // Subject
+ TPtrC subj( qt_QString2TPtrC(subject) );
+ messageData->SetSubjectL( &subj );
+
+ // Body
+ CParaFormatLayer* paraFormat = CParaFormatLayer::NewL();
+ CleanupStack::PushL( paraFormat );
+ CCharFormatLayer* charFormat = CCharFormatLayer::NewL();
+ CleanupStack::PushL( charFormat );
+ CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat );
+ CleanupStack::PushL( bodyRichText );
+
+ TPtrC bodyPtr( qt_QString2TPtrC(body) );
+ if( bodyPtr.Length() )
+ bodyRichText->InsertL( 0, bodyPtr );
+ else
+ bodyRichText->InsertL( 0, KNullDesC );
+
+ messageData->SetBodyTextL( bodyRichText );
+
+ // To
+ foreach(QString item, recipients)
+ messageData->AppendToAddressL(qt_QString2TPtrC(item));
+
+ foreach(QString item, tos)
+ messageData->AppendToAddressL(qt_QString2TPtrC(item));
+
+ // Cc
+ foreach(QString item, ccs)
+ messageData->AppendCcAddressL(qt_QString2TPtrC(item));
+
+ // Bcc
+ foreach(QString item, bccs)
+ messageData->AppendBccAddressL(qt_QString2TPtrC(item));
+
+ TRAP_IGNORE(sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ));
+ CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi
+}
+
+// Returned TPtrC is valid as long as the given parameter is valid and unmodified
+TPtrC DefSchemeHandlerPrivate::qt_QString2TPtrC( const QString& string )
+{
+ return reinterpret_cast<const TUint16*>(string.utf16());
+}
+#endif // Q_OS_SYMBIAN
+
+#if !defined(Q_OS_SYMBIAN)
+/*
+ * HandleRtspScheme
+ * @return true/false
+ */
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleRtspScheme(const QUrl &url)
+{
+ SchemeHandler::SchemeHandlerError retVal = SchemeHandler::NoError;
+
+#ifndef QT_NO_DESKTOPSERVICES
+ if (!QDesktopServices::openUrl(url)) {
+ // Failed to handle scheme
+ retVal = SchemeHandler::LaunchFailed;
+ }
+#else
+ retVal = SchemeHandler::SchemeUnsupported;
+#endif
+
+ return (retVal);
+}
+#else // Q_OS_SYMBIAN
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleTelScheme(const QUrl &url)
+{
+ //QString path = url.path();
+
+ // should probably delete this call to m_telService method
+ //m_telService->MakeCall(path, confirmDTMF);
+ QDesktopServices::openUrl(url);
+ return SchemeHandler::NoError;
+}
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleSipScheme(const QUrl &url)
+{
+ // should probably delete this call to m_telService method
+ //m_telService->MakeVOIPCall(path, confirmDTMF);
+ QDesktopServices::openUrl(url);
+ return SchemeHandler::NoError;
+}
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleWtaiMcScheme(const QUrl &url)
+{
+ QString path = url.path();
+ QString number = path.mid(path.indexOf(';') + 1);
+
+ // should probably delete this call to m_telService method
+ //m_telService->MakeCall(number, confirmDTMF);
+ number = "tel:" + number;
+ QUrl dialUrl(number);
+ QDesktopServices::openUrl(dialUrl);
+ return SchemeHandler::NoError;
+}
+
+/*
+ * HandleRtspSchemeL
+ * @return true/false
+ */
+
+SchemeHandler::SchemeHandlerError DefSchemeHandlerPrivate::HandleRtspScheme(const QUrl &url)
+{
+ TRAPD(err, HandleRtspSchemeL(url));
+ return (err ? SchemeHandler::LaunchFailed : SchemeHandler::NoError);
+}
+void DefSchemeHandlerPrivate::HandleRtspSchemeL(const QUrl &url)
+{
+ //Launch the appropriate application in embedded mode
+
+ RFs rfs;
+ RFile ramFile;
+
+ HBufC* urlBuf = qt_QString2HBufC(url.toString());
+ CleanupStack::PushL(urlBuf);
+ // 8-bit buffer is required.
+ HBufC8* urlBuf8 = HBufC8::NewLC( urlBuf->Size() );
+ urlBuf8->Des().Copy( *urlBuf );
+
+ // Open the file.
+ User::LeaveIfError(rfs.Connect());
+ CleanupClosePushL(rfs);
+
+ // Replace file if exists or Create file if not exist yet
+ User::LeaveIfError( ramFile.Replace( rfs, KRtspFileName, EFileWrite | EFileShareAny ) );
+ CleanupClosePushL(ramFile);
+ // Write to file
+ User::LeaveIfError( ramFile.Write(*urlBuf8) );
+ ramFile.Flush();
+
+ CleanupStack::PopAndDestroy(/*ramFile*/);
+ CleanupStack::PopAndDestroy(/*rfs*/);
+ CleanupStack::PopAndDestroy( /*urlBuf8*/ );
+ CleanupStack::PopAndDestroy( /*urlBuf*/ );
+
+ RFile ramDocTempFile;
+ CDocumentHandler* docHandler = CDocumentHandler::NewL();
+ docHandler->OpenTempFileL( KRtspFileName, ramDocTempFile );
+
+ CleanupClosePushL( ramDocTempFile );
+
+ TDataType dataType( _L8("audio/x-pn-realaudio-plugin") );
+ CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC();
+ TAiwVariant filename( _L8("c:\\system\\temp\\RtspTemp.ram") );
+ TAiwGenericParam param( EGenericParamFile, filename );
+
+ paramList->AppendL( param );
+
+ // Allow save among Options
+
+ TBool allowSave( ETrue );
+ TAiwVariant allowSaveVariant( allowSave );
+ TAiwGenericParam genericParamAllowSave
+ ( EGenericParamAllowSave, allowSaveVariant );
+
+ paramList->AppendL( genericParamAllowSave );
+
+ // launch RAM file via DocHandler
+
+ docHandler->OpenFileEmbeddedL( ramDocTempFile, dataType, *paramList );
+
+ CleanupStack::PopAndDestroy( paramList );
+ CleanupStack::PopAndDestroy( &ramDocTempFile );
+}
+
+HBufC* DefSchemeHandlerPrivate::qt_QString2HBufC(const QString& string) {
+ TPtrC16 str(reinterpret_cast<const TUint16*>(string.utf16()));
+ return str.Alloc();
+}
+#endif // Q_OS_SYMBIAN
+
+
+} // WRT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/core/network/SchemeHandlerBrDefault_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* 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 SCHEME_HANDLER_DEFAULT_P_H
+#define SCHEME_HANDLER_DEFAULT_P_H
+
+// INCLUDES
+
+#include <QtCore/QObject>
+#if defined(Q_OS_SYMBIAN)
+#include <txtrich.h> // CRichText
+#endif
+
+#include "SchemeHandlerBr_p.h"
+
+
+// CLASS DECLARATION
+
+class QUrl;
+
+#if defined(Q_OS_SYMBIAN)
+class WrtTelService;
+#endif
+
+namespace WRT {
+
+/**
+* Scheme Handler default implementation used if platform isn't using QtHighway.
+*/
+class DefSchemeHandlerPrivate : public SchemeHandlerPrivate {
+
+Q_OBJECT
+
+public:
+ DefSchemeHandlerPrivate();
+ ~DefSchemeHandlerPrivate();
+
+ virtual SchemeHandler::SchemeHandlerError HandleUrl(const QUrl &url, bool confirmDTMF);
+ virtual SchemeHandler::SchemeHandlerError HandleScheme(const QUrl &url);
+
+private:
+ SchemeHandler::SchemeHandlerError HandleMailtoScheme(const QUrl &url);
+ SchemeHandler::SchemeHandlerError HandleRtspScheme(const QUrl &url);
+#if defined(Q_OS_SYMBIAN)
+ SchemeHandler::SchemeHandlerError HandleTelScheme(const QUrl &url);
+ SchemeHandler::SchemeHandlerError HandleSipScheme(const QUrl &url);
+ SchemeHandler::SchemeHandlerError HandleWtaiMcScheme(const QUrl &url);
+
+ void HandleRtspSchemeL(const QUrl &url);
+ void HandleMailtoSchemeL(const QUrl &url);
+ TPtrC qt_QString2TPtrC( const QString& string );
+ HBufC* qt_QString2HBufC(const QString& string);
+#endif
+
+private:
+#if defined(Q_OS_SYMBIAN)
+ WrtTelService* m_telService; ///< Owned.
+#endif
+};
+
+}
+#endif /* def SCHEME_HANDLER_DEFAULT_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/core/network/SchemeHandlerBrQtHighway_p.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* 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 FILES
+#include <QUrl>
+#include <QList>
+#include <xqaiwdecl.h>
+
+#include "SchemeHandlerBrQtHighway_p.h"
+
+
+namespace WRT {
+
+
+QtHighwaySchemeHandlerPrivate::QtHighwaySchemeHandlerPrivate()
+{
+}
+
+QtHighwaySchemeHandlerPrivate::~QtHighwaySchemeHandlerPrivate()
+{
+}
+
+SchemeHandler::SchemeHandlerError QtHighwaySchemeHandlerPrivate::HandleScheme(const QUrl &url)
+{
+ return SendStandardUriViewRequest(url);
+}
+
+
+/*!
+ Creates request with "com.nokia.symbian.IUriView" interface name and
+ "view(QString)" operation. QtHighway uses the \a url parameter to
+ determine the service application and the service application
+ uses it as data. The request is asynchronous. Application launched
+ as stand-alone app, not embedded.
+*/
+SchemeHandler::SchemeHandlerError
+ QtHighwaySchemeHandlerPrivate::SendStandardUriViewRequest(const QUrl& url)
+{
+ SchemeHandler::SchemeHandlerError retVal = SchemeHandler::NoError;
+ XQAiwRequest *request = NULL; // Application Interworking request
+ bool embedded = false; // window groups not chained
+
+ // Create request - Apply first implementation of url, "com.nokia.symbian.IUriView"
+ // interface name and "view(QString)" operation.
+ request = mAiwMgr.create(url, embedded);
+
+ if (request) {
+ // Debug - what service and interface are we using?
+ //XQAiwInterfaceDescriptor const &desc = request->descriptor();
+ //qDebug() << "HandleTelScheme: sn=" << desc.serviceName() << "if=" << desc.interfaceName();
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << url.toString();
+ request->setArguments(args);
+ request->setEmbedded(embedded);
+ request->setSynchronous(false); // asynchronous request
+
+ // Send the request
+ if (!request->send()) {
+ // to debug get error code from request->lastError()
+ // or connect to requestError() signal
+ retVal = SchemeHandler::LaunchFailed;
+ }
+ } else {
+ // failed to create request - maybe scheme is unsupported
+ retVal = SchemeHandler::SchemeUnsupported;
+ }
+
+ // if need to get service result connect to requestOk() signal
+
+ // currently not interested in requestOk() or requestError() signals so
+ // OK to delete request now
+ delete request;
+
+ return retVal;
+}
+
+} // WRT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/core/network/SchemeHandlerBrQtHighway_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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 SCHEME_HANDLER_QTHIGHWAY_P_H
+#define SCHEME_HANDLER_QTHIGHWAY_P_H
+
+// INCLUDES
+
+#include <QtCore/QObject>
+#include <xqappmgr.h>
+#include "SchemeHandlerBr_p.h"
+
+// CLASS DECLARATION
+
+class QUrl;
+
+
+namespace WRT {
+
+/**
+* Scheme Handler implementation for platform that are using QtHighway.
+*/
+class QtHighwaySchemeHandlerPrivate : public SchemeHandlerPrivate {
+
+Q_OBJECT
+
+public:
+ QtHighwaySchemeHandlerPrivate();
+ ~QtHighwaySchemeHandlerPrivate();
+
+ virtual SchemeHandler::SchemeHandlerError HandleScheme(const QUrl &url);
+
+private:
+ SchemeHandler::SchemeHandlerError SendStandardUriViewRequest(const QUrl& url);
+
+ // application interworking manager from QtHighway
+ XQApplicationManager mAiwMgr;
+};
+
+} // WRT
+#endif /* def SCHEME_HANDLER_QTHIGHWAY_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/browsercore/core/network/SchemeHandlerBr_p.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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 SCHEME_HANDLER_P_H
+#define SCHEME_HANDLER_P_H
+
+// INCLUDES
+
+#include <QtCore/QObject>
+#include "SchemeHandlerBr.h"
+
+// CLASS DECLARATION
+
+class QUrl;
+
+
+namespace WRT {
+
+// Use default scheme handler if platform isn't using QtHighway for application
+// interworking.
+#ifndef QTHIGHWAY
+#define SCHEME_HNDLR_PRIVATE DefSchemeHandlerPrivate
+#else
+#define SCHEME_HNDLR_PRIVATE QtHighwaySchemeHandlerPrivate
+#endif // QTHIGHWAY
+
+/**
+* Scheme Handler implementation abstract base class.
+* The implementation of this class depends on whether the platform uses
+* QtHighway for application interworking.
+*/
+class SchemeHandlerPrivate : public QObject {
+
+Q_OBJECT
+
+public:
+ SchemeHandlerPrivate();
+ virtual ~SchemeHandlerPrivate();
+
+ bool ReadSdConfirmDtmfValue();
+ virtual SchemeHandler::SchemeHandlerError HandleUrl(const QUrl &url, bool confirmDTMF);
+
+ virtual SchemeHandler::SchemeHandlerError HandleScheme(const QUrl &url) = 0;
+};
+
+} // WRT
+#endif /* def SCHEME_HANDLER_P_H */
--- a/browsercore/core/network/webnetworkaccessmanager.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/network/webnetworkaccessmanager.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -41,7 +41,7 @@
namespace WRT {
-WebNetworkAccessManager::WebNetworkAccessManager(WrtBrowserContainer* container, QObject* parent) : QNetworkAccessManager(container), m_browserContainer(container)
+WebNetworkAccessManager::WebNetworkAccessManager(WrtBrowserContainer* container, QObject* /*parent*/) : QNetworkAccessManager(container), m_browserContainer(container)
{
m_cookieJar = new CookieJar();
m_reply = NULL;
@@ -68,21 +68,30 @@
{
QNetworkReply::NetworkError networkError = reply->error();
QString requestUrl = reply->request().url().toString();
-
- if ( networkError != QNetworkReply::OperationCanceledError &&
- networkError != QNetworkReply::NoError )
+
+ if (networkError != QNetworkReply::OperationCanceledError &&
+ networkError != QNetworkReply::NoError)
{
QString errorMsg = reply->errorString();
- if ( activeNetworkInterfaces() == 0 ) {
+
+ // check for previously flagged error from scheme handler
+ if (m_schemeError == SchemeHandler::SchemeUnsupported) {
+ // override error message from Qt network access manager
+ errorMsg = qtTrId("txt_browser_error_dialog_link_not_associated");
+ } else if (m_schemeError == SchemeHandler::LaunchFailed) {
+ // override error message from Qt network access manager
+ errorMsg = qtTrId("txt_browser_error_dialog_application_not_responding");
+ } else if (activeNetworkInterfaces() == 0) {
errorMsg = "Network not available";
} else {
int httpErrorCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
- if ( httpErrorCode ) {
+ if (httpErrorCode) {
QString httpErrorStr = QString ("HTTP %1 ").arg(httpErrorCode);
QString httpReasonStr = reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
errorMsg = httpErrorStr + httpReasonStr;
- }
+ }
}
+
emit networkErrorHappened(errorMsg);
emit networkErrorUrl(requestUrl);
}
@@ -98,6 +107,7 @@
{
QNetworkRequest req = request;
+ m_schemeError = SchemeHandler::NoError; // clear previous error
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
// improve performance by
// load from cache if available, otherwise load from network.
@@ -167,12 +177,16 @@
return reply;
}
- if (m_browserContainer->schemeHandler()->HandleSpecialScheme(req.url())) {
+ // Some schemes such as tel are handled by scheme handler.
+ m_schemeError = m_browserContainer->schemeHandler()->HandleSpecialScheme(req.url());
+ if (m_schemeError == SchemeHandler::NoError) {
// handled in scheme handler - block network access
QNetworkReply* reply = new NetworkErrorReply(QNetworkReply::OperationCanceledError, "Scheme Handled", req.url());
QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
return reply;
}
+ // else let Qt network access manager create request but if it fails
+ // m_schemeError may be used to determine an appropriate error message
//Accept-Language header
QLocale language;
--- a/browsercore/core/network/webnetworkaccessmanager.h Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/network/webnetworkaccessmanager.h Mon Oct 04 00:04:54 2010 +0300
@@ -25,6 +25,7 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "messageboxproxy.h"
+#include "SchemeHandlerBr.h"
#if QT_VERSION >= 0x040500
#include <QNetworkDiskCache>
@@ -68,6 +69,7 @@
CookieJar* m_cookieJar;
QNetworkReply* m_reply;
QNetworkRequest* m_req;
+ SchemeHandler::SchemeHandlerError m_schemeError;
#if QT_VERSION >= 0x040500
QNetworkDiskCache *qDiskCache;
--- a/browsercore/core/wrtbrowsercontainer.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/browsercore/core/wrtbrowsercontainer.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -146,6 +146,7 @@
connect(this, SIGNAL(loadProgress(int)), d->m_loadController, SLOT(loadProgress(int)));
connect(this, SIGNAL(loadFinished(bool)), d->m_loadController, SLOT(loadFinished(bool)));
connect(mainFrame(), SIGNAL(urlChanged(QUrl)), d->m_loadController, SLOT(urlChanged(QUrl)));
+ connect(mainFrame(), SIGNAL(initialLayoutCompleted()), d->m_loadController, SLOT(initialLayoutCompleted()));
}
--- a/browserui.pri Fri Sep 17 08:27:10 2010 +0300
+++ b/browserui.pri Mon Oct 04 00:04:54 2010 +0300
@@ -72,25 +72,24 @@
#########################
br_mobility_bearer=no
br_mobility_sysinfo=no
+ br_mobility_serviceframework=no
br_fast_allocator=no
- br_download_mgr=no
br_default_iap=no
br_orbit_ui=no
br_openurl=no
br_qthighway=no
br_tiled_backing_store=no
+ br_layout=default
# For now Symbian only, Windows, Maemo will use the defaults
symbian {
contains (browser_addon, fivezero) {
br_fast_allocator=yes
- br_download_mgr=yes
br_mobility_sysinfo=yes
br_mobility_bearer=yes
}
contains (browser_addon, ninetwo) {
br_fast_allocator=yes
- br_download_mgr=yes
br_mobility_sysinfo=yes
br_mobility_bearer=yes
}
@@ -98,9 +97,11 @@
browser_addon=no
br_mobility_sysinfo=yes
br_mobility_bearer=yes
+ br_mobility_serviceframework=yes
br_orbit_ui=yes
br_openurl=yes
br_qthighway=yes
+ br_layout=tenone
}
}
}
--- a/browserui.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/browserui.pro Mon Oct 04 00:04:54 2010 +0300
@@ -5,10 +5,16 @@
SUBDIRS += bedrockProvisioning
SUBDIRS += browsercore
SUBDIRS += ginebra2
+symbian : {
+ contains(browser_addon, no) {
+ SUBDIRS += homescreen
+ }
+}
# rom MUST come last because it depends on *_template.pkg files generated by qmake from all the other apps
SUBDIRS += rom
contains( what, tests ) {
+ DEFINES += ENABLE_TESTS
exists($$PWD/internal/tests/perfTracing/perfTracing.pro): SUBDIRS += internal/tests/perfTracing/perfTracing.pro
exists($$PWD/internal/tests/mw/mw.pro): SUBDIRS += internal/tests/mw/mw.pro
exists($$PWD/internal/tests/Bookmarks_Test/Bookmarks_Test.pro): SUBDIRS += internal/tests/mw/Bookmarks_Test/Bookmarks_Test.pro
@@ -18,6 +24,7 @@
contains(browser_addon, no ) {
BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
- "rom/browser.iby CORE_APP_LAYER_IBY_EXPORT_PATH(browser.iby)"
+ "rom/browser.iby CORE_APP_LAYER_IBY_EXPORT_PATH(browser.iby)" \
+ "rom/browserresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(browserresources.iby)"
}
}
--- a/common/commonExternals.pri Fri Sep 17 08:27:10 2010 +0300
+++ b/common/commonExternals.pri Mon Oct 04 00:04:54 2010 +0300
@@ -64,11 +64,12 @@
# Import pre-built binary components.
symbian: {
- contains (br_download_mgr, yes) {
+ contains(browser_addon, no) {
DEFINES += USE_DOWNLOAD_MANAGER=1
INCLUDEPATH += /epoc32/include/applications
- LIBS += -lBrServiceIPCClient
- LIBS += -lBrDownloadMgr
+ INCLUDEPATH += /epoc32/include/platform/mw/cwrt
+ LIBS += -lWrtDownloadMgrIpc
+ LIBS += -lWrtDownloadMgr
}
} else {
include($$ROOT_DIR/import/import.pri)
@@ -80,6 +81,7 @@
# Bookmarks
#LIBS += -lBookMarksClient
+LIBS += -lbookmarksapi
LIBS += -lbrowsercontentdll
# Browsercore
--- a/ginebra2/Application.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/Application.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -66,4 +66,17 @@
qDebug() << msg;
}
+QString GinebraApplication::layoutType() {
+
+ QString layout;
+#ifdef BROWSER_LAYOUT_TENONE
+ layout = "tenone";
+#else
+ layout = "default";
+#endif
+
+ return layout;
}
+
+
+}
--- a/ginebra2/Application.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/Application.h Mon Oct 04 00:04:54 2010 +0300
@@ -29,6 +29,12 @@
#define UI_FRAMEWORK ""
#endif // ORBIT_UI
+#ifdef QT_MOBILITY_SERVICE_FRAMEWORK
+#define MOBILITY_SERVICE_FRAMEWORK "mobility_service_framework"
+#else
+#define MOBILITY_SERVICE_FRAMEWORK "junk"
+#endif // QT_MOBILITY_SERVICE_FRAMEWORK
+
class QCoreApplication;
namespace GVA {
@@ -51,7 +57,17 @@
void quit();
void debug(const QString &msg);
QString ui() const { return UI_FRAMEWORK; }
+ QString layoutType() ;
+ QString serviceFramework() const { return MOBILITY_SERVICE_FRAMEWORK; }
void sendToBackground();
+ /*
+ * You can use this to breakpoint inside your javascript. Here's how:
+ * 1) put a breakpoint on this function
+ * 2) to your javascript, add: app.breakpoint();
+ * 3) when the breakpoint hits, you will be in the C++ stack at the point of that JS execution
+ * It doesn't really help you step through javascript (unless you know the javascript core well), but helps you debug C++ and javascript interaction
+ */
+ void breakpoint() {}
signals:
void aboutToQuit();
private:
--- a/ginebra2/BookmarksToolbarSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/BookmarksToolbarSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -25,7 +25,7 @@
#include "ToolbarChromeItem.h"
#include "ViewStack.h"
#include "GWebContentView.h"
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
#include <QDebug>
namespace GVA {
@@ -35,6 +35,7 @@
: DualButtonToolbarSnippet(elementId, chrome, element),
m_action1(0), m_action2(0)
{
+ connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged()));
}
BookmarksToolbarSnippet::~BookmarksToolbarSnippet()
@@ -45,6 +46,11 @@
delete m_action2;
}
+ void BookmarksToolbarSnippet::onAspectChanged( ) {
+
+ updateOwnerArea();
+
+ }
BookmarksToolbarSnippet * BookmarksToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
{
BookmarksToolbarSnippet * that = new BookmarksToolbarSnippet( elementId, chrome, element );
--- a/ginebra2/BookmarksToolbarSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/BookmarksToolbarSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -48,6 +48,7 @@
private Q_SLOTS:
// Back action trigger handler. Switches back to webview
void handleBackButton();
+ void onAspectChanged( );
private:
/// Reimplemented
--- a/ginebra2/ChromeDOM.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ChromeDOM.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -46,6 +46,7 @@
#include "ActionButtonSnippet.h"
#include "mostvisitedpageview.h"
#include "mostvisitedsnippet.h"
+#include "TitleUrlContainerSnippet.h"
#include "UrlSearchSnippet.h"
#include "EditorSnippet.h"
@@ -160,6 +161,9 @@
else if (className == "TextEditSnippet") {
return EditorSnippet::instance(elementId, m_chrome, element);
}
+ else if (className == "TitleUrlContainerSnippet") {
+ return TitleUrlContainerSnippet::instance(elementId, m_chrome, element);
+ }
else {
ChromeSnippet* result = new ChromeSnippet(elementId, m_chrome, 0, element);
result->setChromeWidget(new QGraphicsWidget());
--- a/ginebra2/ChromeView.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ChromeView.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -82,13 +82,12 @@
ungrabGesture(Qt::SwipeGesture);
#endif
+#ifdef ORBIT_UI
+ /* Hide the platform title bar */
+ HbView * view = currentView();
+ view->setTitleBarVisible(false);
+#endif
-#ifdef ORBIT_UI
- HbView * view = currentView();
- HbAction *backAction = new HbAction(Hb::BackNaviAction, this);
- connect(backAction, SIGNAL(triggered()), m_chrome, SIGNAL(goToBackground()));
- view->setNavigationAction(backAction);
-#endif
}
ChromeView::~ChromeView()
@@ -109,7 +108,13 @@
m_chrome->sizeChange(ev->size());
m_topWidget->setGeometry(0,0, ev->size().width(), ev->size().height());
}
- QGraphicsView::resizeEvent(ev);
+
+
+#ifdef ORBIT_UI
+ HbMainWindow::resizeEvent(ev);
+#else
+ QGraphicsView::resizeEvent(ev);
+#endif
#ifdef BEDROCK_TILED_BACKING_STORE
if (scene()) {
--- a/ginebra2/ChromeWidget.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ChromeWidget.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -45,7 +45,8 @@
#include "GWebPage.h"
#include "webpagecontroller.h"
//#include "ViewStack.h"
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
+#include "bookmarkscontroller.h"
#include "ScriptObjects.h"
#include "LocaleDelegate.h"
#include "DeviceDelegate.h"
@@ -59,6 +60,10 @@
#include "SystemNetworkImpl.h"
#endif
+#ifdef QT_MOBILITY_SERVICE_FRAMEWORK
+#include "hsbookmarkpublishclient.h"
+#endif // QT_MOBILITY_SERVICE_FRAMEWORK
+
#include "Downloads.h"
#include "wrtbrowsercontainer.h"
@@ -328,11 +333,15 @@
addJSObjectToPage(m_app, page);
addJSObjectToPage(m_viewController, page);
addJSObjectToPage(WebPageController::getSingleton(), page);
- addJSObjectToPage(WRT::BookmarksManager::getSingleton(), page);
+ addJSObjectToPage(BookmarksController::getSingleton(), page);
+ addJSObjectToPage(WRT::HistoryManager::getSingleton(), page);
addJSObjectToPage(ViewStack::getSingleton(), page);
addJSObjectToPage(m_localeDelegate, page);
addJSObjectToPage(m_deviceDelegate, page);
addJSObjectToPage(m_networkDelegate, page);
+#ifdef QT_MOBILITY_SERVICE_FRAMEWORK
+ addJSObjectToPage(&(WRT::HsBookmarkPublishClientSingleton::Instance()), page);
+#endif // QT_MOBILITY_SERVICE_FRAMEWORK
// Dynamically added objects
//foreach(QObject * jsObj, m_jsObjects) {
// addJSObjectToPage(jsObj, page);
--- a/ginebra2/ContentToolbarSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentToolbarSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -338,6 +338,8 @@
// Connect to hide and show signals of the linked snippet
connectHideShowSignals(button);
+ //Connect to handle external events of back press
+ connect( button->linkedSnippet(), SIGNAL(externalMouseEvent(QEvent *, const QString , const QString )), this, SLOT(onExternalMouse(QEvent *, const QString , const QString)));
}
void ContentToolbarSnippet::addToggleTBButton(QAction * action, ActionButtonSnippet* button) {
@@ -457,6 +459,7 @@
void ContentToolbarSnippet::onAspectChanged( ) {
+ updateOwnerArea();
// Hide any pop-up that is visible
hideOtherPopups(QString());
}
--- a/ginebra2/ContentViews/GWebContentView.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentView.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -15,7 +15,7 @@
* along with this program. If not,
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
*
-* Description:
+* Description :
*
*/
@@ -54,7 +54,7 @@
const qreal KZoomInStep = 1.05;
const qreal KZoomOutStep = 0.95238;
-
+ const qreal KInitialZoomFactorValue = 0.653061;
GWebContentView::GWebContentView(ChromeWidget *chrome, QObject * parent, const QString &objectName)
: ControllableViewBase(parent),
m_networkMgr(0),
@@ -67,7 +67,8 @@
m_currentSuperPage(m_superPages.begin()),
m_currentPageIsSuperPage(false),
m_timer(NULL),
- m_enabled(true)
+ m_enabled(true),
+ m_savedZoomValueInView(KInitialZoomFactorValue)
{
setObjectName(objectName);
WRT::WrtBrowserContainer* page = BrowserPageFactory::openBrowserPage();
@@ -176,7 +177,7 @@
void GWebContentView::zoomN()
{
if ((m_value * webWidget()->zoomFactor()) < webWidget()->minimumScale()){
- if (m_timer && m_timer->isActive())
+ // if (m_timer && m_timer->isActive())
bitmapZoomStop();
}else {
if (m_timer->isSingleShot()) {
@@ -213,6 +214,7 @@
m_timer = NULL;
webWidget()->setZoomFactor(m_value * webWidget()->zoomFactor());
}
+ setSavedZoomValueInView(m_value * webWidget()->zoomFactor());
}
}
@@ -241,6 +243,7 @@
m_timer = NULL;
webWidget()->setZoomFactor(m_value * webWidget()->zoomFactor());
}
+ setSavedZoomValueInView(m_value * webWidget()->zoomFactor());
}
}
@@ -580,9 +583,19 @@
void GWebContentView::loadUrlToCurrentPage(const QString & url)
{
WRT::WrtBrowserContainer * activePage = WebPageController::getSingleton()->currentPage();
-
+ QString bookmark_url = url;
+ if(!bookmark_url.contains(KBOOKMARKURLFILESLASH)){
+ if(bookmark_url.contains(KBOOKMARKURLFILE))
+ bookmark_url.replace(QString(KBOOKMARKURLFILE), QString(KBOOKMARKURLFILESLASH));
+ }
+ //--DeCoding URL for DoubleQuote and BackSlash--
+ if (bookmark_url.contains(KENCODEDBACKSLASH, Qt::CaseInsensitive))
+ bookmark_url.replace(QString(KENCODEDBACKSLASH), QString("\\"));
+ if (bookmark_url.contains(KENCODEDDOUBLEQUOTE, Qt::CaseInsensitive))
+ bookmark_url.replace(QString(KENCODEDDOUBLEQUOTE), QString("\""));
+
if (activePage) {
- activePage->mainFrame()->load(url);
+ activePage->mainFrame()->load(bookmark_url);
}
}
@@ -814,6 +827,11 @@
m_widget->showPage(false);
#endif
}
+ WRT::WrtBrowserContainer * currPage = WebPageController::getSingleton()->currentPage();
+ if(currPage){
+ webWidget()->initializeViewportParams();
+ webWidget()->setZoomFactor(currPage->pageZoomMetaData().zoomValue);
+ }
}
QObjectList GWebContentView::getSuperPages() {
@@ -861,8 +879,10 @@
emit forwardEnabled(false);
}
- // Set focus to the Web View so that text boxes have the focus (BR-994)
- m_widget->setFocus();
+ // Set focus to the Web View so that text boxes have the focus (BR-994) if user is not editing the
+ // url field
+ if (!WebPageController::getSingleton()->editMode())
+ m_widget->setFocus();
#if defined(__gva_no_chrome__) || defined(NO_RESIZE_ON_LOAD)
m_widget->onLoadFinished();
@@ -1015,6 +1035,13 @@
widget()->setEnabled(value);
widget()->update();
}
+ void GWebContentView::setSavedZoomValueInView(qreal zoomValue){
+ m_savedZoomValueInView = zoomValue;
+ }
+
+ qreal GWebContentView::getSavedZoomValueInView() const{
+ return m_savedZoomValueInView;
+ }
} // end of namespace GVA
--- a/ginebra2/ContentViews/GWebContentView.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentView.h Mon Oct 04 00:04:54 2010 +0300
@@ -34,6 +34,10 @@
#include "ContentViewDelegate.h"
#include "GContentViewTouchNavigation.h"
+static const char KBOOKMARKURLFILE[] = "file://";
+static const char KBOOKMARKURLFILESLASH[] = "file:///";
+static const char KENCODEDBACKSLASH[] = "%5C";
+static const char KENCODEDDOUBLEQUOTE[] = "%22";
class WebViewEventContext;
class QContextMenuEvent;
class QWebPage;
@@ -90,6 +94,8 @@
qreal getZoomFactor();
#else
qreal getZoomFactor() const;
+ void setSavedZoomValueInView(qreal zoomValue);
+ qreal getSavedZoomValueInView() const;
#endif
static ControllableView* createNew(QWidget *parent);
@@ -261,6 +267,7 @@
qreal m_value;
bool m_gesturesEnabled;
bool m_enabled;
+ qreal m_savedZoomValueInView;
};
}
--- a/ginebra2/ContentViews/GWebContentViewJSObject.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentViewJSObject.h Mon Oct 04 00:04:54 2010 +0300
@@ -111,6 +111,7 @@
return false;
#endif
}
+ void setSavedZoomValueInView(qreal zoomValue){ webContentView()->setSavedZoomValueInView(zoomValue); }
signals:
void ContextChanged();
--- a/ginebra2/ContentViews/GWebContentViewWidget.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentViewWidget.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -59,6 +59,7 @@
const int KMaxPageZoom = 10;
const qreal KDefaultMinScale = 0.25;
const qreal KDefaultMaxScale = 10.00;
+const qreal KInitialZoomFactorValue = 0.653061;
const QPoint KFocussPoint(5, 50);
const int checkerSize = 16;
const unsigned checkerColor1 = 0xff555555;
@@ -340,7 +341,8 @@
#if QT_VERSION < 0x040600
page()->setFixedContentsSize(QSize(m_viewportWidth, m_viewportHeight/zoom));
#else
- page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight/zoom));
+ if(!m_webContentView->currentPageIsSuperPage())
+ page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight/zoom));
#endif
}
@@ -654,6 +656,7 @@
data.maxScale = KDefaultMaxScale;
data.minScale = KDefaultMinScale;
data.userScalable = false;
+ data.zoomValue = KInitialZoomFactorValue;
return data;
}
@@ -705,6 +708,9 @@
page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight));
#endif
#endif //NO_RESIZE_ON_LOAD
+ if((m_webContentView->currentPageIsSuperPage())){
+ page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight));
+ }
#ifndef NO_RESIZE_ON_LOAD
qreal zoomF = 0.0;
QString str;
@@ -842,6 +848,7 @@
data.minScale = m_minimumScale;
data.maxScale = m_maximumScale;
data.userScalable = m_userScalable;
+ data.zoomValue = view()->getSavedZoomValueInView();
return data;
}
@@ -851,6 +858,7 @@
m_minimumScale = data.minScale ;
m_maximumScale = data.maxScale ;
m_userScalable = data.userScalable;
+ view()->setSavedZoomValueInView(data.zoomValue);
}
QWebPage* GWebContentViewWidget::page() const
--- a/ginebra2/EditorWidget.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/EditorWidget.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -202,38 +202,11 @@
void GTextLineItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
{
+
QGraphicsTextItem::mouseReleaseEvent(event);
QPointF pos = event->pos();
emit tapped(pos);
-
- // add specific button
-#ifdef ORBIT_UI
- if (m_setSpecificBtn) {
- HbEditorInterface editorInterface(this);
- QList<HbAction*> actionsList = editorInterface.actions();
- for (int i = 0; i < actionsList.size(); ++i) {
- editorInterface.removeAction(actionsList.at(i));
- }
- QIcon icon(m_spBtnIconPath);
- HbAction* action = new HbAction(HbIcon(icon), QString(""), this);
- connect(action, SIGNAL(triggered(bool)), this, SLOT(specificBtnTriggered(bool)));
-
- editorInterface.addAction(action);
- m_setSpecificBtn = false;
- }
-#endif
-
- // open vkb by single tap
- QWidget * widget = event->widget();
- QEvent vkbEvent(QEvent::RequestSoftwareInputPanel);
- QApplication::sendEvent(widget, &vkbEvent);
-
- // disable prediction
-#ifdef ORBIT_UI
- HbInputSettingProxy* hbISProxy = HbInputSettingProxy::instance();
- if (hbISProxy->predictiveInputStatusForActiveKeyboard())
- hbISProxy->togglePrediction();
-#endif
+ launchVKB();
}
void GTextLineItem::keyPressEvent(QKeyEvent * event)
@@ -294,6 +267,44 @@
m_hints |= Qt::ImhNoPredictiveText; // disable the predictive text
}
+ void GTextLineItem::launchVKB() {
+
+
+ // add specific button
+#ifdef ORBIT_UI
+ if (m_setSpecificBtn) {
+ HbEditorInterface editorInterface(this);
+ QList<HbAction*> actionsList = editorInterface.actions();
+ for (int i = 0; i < actionsList.size(); ++i) {
+ editorInterface.removeAction(actionsList.at(i));
+ }
+ QIcon icon(m_spBtnIconPath);
+ HbAction* action = new HbAction(HbIcon(icon), QString(""), this);
+ connect(action, SIGNAL(triggered(bool)), this, SLOT(specificBtnTriggered(bool)));
+
+ editorInterface.addAction(action);
+ m_setSpecificBtn = false;
+ }
+#endif
+ sendInputPanelEvent(QEvent::RequestSoftwareInputPanel);
+
+
+ // disable prediction
+#ifdef ORBIT_UI
+ HbInputSettingProxy* hbISProxy = HbInputSettingProxy::instance();
+ if (hbISProxy->predictiveInputStatusForActiveKeyboard())
+ hbISProxy->togglePrediction();
+#endif
+ }
+
+ void GTextLineItem::sendInputPanelEvent(QEvent::Type type) {
+ QInputContext *ic = qApp->inputContext();
+ if (ic) { QEvent *event = new QEvent(type);
+ ic->filterEvent(event);
+ delete event;
+ }
+ }
+
// Methods for class GLineEditor
// GLineEditor is a QGraphicsWidget that wraps a GTextLineItem to implement scrolling,
// draw a background and set padding
@@ -302,7 +313,9 @@
: QGraphicsWidget(parent)
, m_chrome(chrome)
, m_viewPortWidth(0.0)
- , m_viewPortHeight(0.0)
+#ifdef BROWSER_LAYOUT_TENONE
+ , m_titleModeWidth(0.0)
+#endif
, m_padding(0.0)
, m_rightTextMargin(0.0)
{
@@ -314,10 +327,22 @@
m_viewPort->setFlags(QGraphicsItem::ItemClipsChildrenToShape);
// The actual text editor item
+ //m_textColor = QColor(Qt::black);
m_editor = new GTextLineItem(m_viewPort);
+#ifndef BROWSER_LAYOUT_TENONE
m_editor->setDefaultTextColor(m_textColor);
+#endif
m_editor->installEventFilter(this);
+#ifdef BROWSER_LAYOUT_TENONE
+ m_titleColor = QColor(Qt::white);
+ m_title = new GTitleItem(m_viewPort);
+ m_title->setDefaultTextColor(m_titleColor);
+ m_title->hide();
+ safe_connect(m_title, SIGNAL(tapped(QPointF& )),
+ this, SIGNAL(titleMouseEvent(QPointF&)));
+#endif
+
// Monitor editor cursor position changes for horizontal scrolling.
safe_connect(m_editor, SIGNAL(cursorXChanged(qreal)),
this, SLOT(makeVisible(qreal)));
@@ -325,6 +350,9 @@
safe_connect(m_editor, SIGNAL(textMayChanged()),
this, SIGNAL(textMayChanged()));
+ safe_connect(m_editor->document(), SIGNAL(contentsChange(int, int, int)),
+ this, SIGNAL(contentsChange(int, int, int)));
+
safe_connect(m_editor, SIGNAL(focusChanged(bool)),
this, SIGNAL(focusChanged(bool)));
@@ -346,6 +374,19 @@
m_editor->setDefaultTextColor(m_textColor);
}
+#ifdef BROWSER_LAYOUT_TENONE
+ void GLineEditor::setTitleColor(QColor & color)
+ {
+ m_titleColor = color;
+ m_title->setDefaultTextColor(m_titleColor);
+ }
+
+ void GLineEditor::setTitleFont(QFont & font)
+ {
+ m_title->setFont(font);
+ }
+#endif
+
void GLineEditor::setPadding(qreal padding)
{
m_padding = padding;
@@ -386,18 +427,83 @@
void GLineEditor::resizeEvent(QGraphicsSceneResizeEvent * event)
{
QSizeF size = event->newSize();
- m_viewPortWidth = size.width() - m_rightTextMargin - m_padding * 2;
- m_viewPortHeight = size.height() - m_padding * 2;
+ qreal height = size.height() - m_padding * 2;
+ qreal width;
+
+ width = m_viewPortWidth = size.width() - m_rightTextMargin - m_padding * 2;
+
+#ifdef BROWSER_LAYOUT_TENONE
+ m_titleModeWidth = size.width() - m_padding * 2;
+ if (m_title->isVisible() ) {
+ width = m_titleModeWidth;
+ }
+ m_title->setTextWidth(m_titleModeWidth);
+
+#endif
m_viewPort->setGeometry(
m_padding,
(size.height() - m_editor->boundingRect().height()) / 2,
- m_viewPortWidth,
- m_viewPortHeight);
+ width,
+ height);
+
m_editor->setTextWidth(m_viewPortWidth);
// move back the m_editor'x to 0
qreal editorShift = -1 * m_editor->pos().x();
m_editor->moveBy(editorShift, 0);
updateEditor();
+
+
+ }
+
+#ifdef BROWSER_LAYOUT_TENONE
+
+ void GLineEditor::changeEditorMode(bool edit) {
+ QRectF rect = m_viewPort->geometry();
+ if (edit) {
+ m_backgroundColor = QColor(Qt::white);
+
+ // Update the width of viewPort
+ if (m_title->isVisible() ) {
+ m_viewPort->setGeometry(rect.x(), rect.y(), (rect.width() - m_rightTextMargin ), rect.height());
+
+ //move back the m_editor'x to 0
+ qreal editorShift = -1 * m_editor->pos().x();
+ m_editor->moveBy(editorShift, 0);
+ updateEditor();
+ m_title->hide();
+ m_editor->show();
+ }
+ }
+ else {
+ m_backgroundColor = QColor(Qt::transparent);
+
+ // Update the width of viewPort
+ if (m_editor->isVisible() ) {
+
+ m_viewPort->setGeometry(rect.x(), rect.y(), (rect.width() + m_rightTextMargin ), rect.height());
+ m_editor->hide();
+ m_title->show();
+ }
+
+ }
+ }
+
+ void GLineEditor::setTitle(const QString & text)
+ {
+ m_title->setText(text);
+ }
+#endif
+
+ void GLineEditor::closeVKB()
+ {
+ m_editor->sendInputPanelEvent(QEvent::CloseSoftwareInputPanel);
+
+ }
+
+ void GLineEditor::openVKB()
+ {
+ m_editor->launchVKB();
+
}
void GLineEditor::setText(const QString & text)
@@ -637,7 +743,9 @@
QColor borderColor;
NativeChromeItem::CSSToQColor(we.styleProperty("border-top-color", QWebElement::ComputedStyle),
borderColor);
+#ifndef BROWSER_LAYOUT_TENONE
m_textEditor->setBorderColor(borderColor);
+#endif
//Padding sets the "border" width
QString cssPadding = we.styleProperty("padding-top", QWebElement::ComputedStyle);
--- a/ginebra2/EditorWidget.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/EditorWidget.h Mon Oct 04 00:04:54 2010 +0300
@@ -24,6 +24,7 @@
#include "ActionButton.h"
#include "NativeChromeItem.h"
+#include "TitleItem.h"
#include <QGraphicsTextItem>
#include <QGraphicsWidget>
@@ -55,6 +56,8 @@
Qt::InputMethodHints inputMethodHints() const { return m_hints; }
void setInputMethodHints(Qt::InputMethodHints hints);
void setSpecificButton(QString& commitString, QString& buttonIconPath);
+ void launchVKB();
+ void sendInputPanelEvent(QEvent::Type type);
protected:
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
@@ -99,6 +102,7 @@
void unselect() { m_editor->unselect(); }
void setTextColor(QColor & color);
+
void setBackgroundColor(QColor & color) {m_backgroundColor = color;}
void setPadding(qreal padding);
void setRightTextMargin(qreal margin);
@@ -106,7 +110,7 @@
void updateEditor();
bool tappedOnText(qreal x) const;
void grabFocus() { m_editor->setFocus(); }
- void removeFocus() { m_editor->clearFocus(); }
+ void removeFocus() {m_editor->clearFocus(); }
void setCursorPosition (int pos) { m_editor->setCursorPosition(pos); }
void shiftToLeftEnd() { setCursorPosition(0); }
int characterCount() { return m_editor->document()->characterCount(); }
@@ -114,8 +118,17 @@
Qt::InputMethodHints inputMethodHints() { return m_editor->inputMethodHints(); }
// Calling this function will overwrite the existing hints
void setInputMethodHints(Qt::InputMethodHints hints) { m_editor->setInputMethodHints(hints); }
- void setMaxTextLength(int length) { m_editor->setMaxTextLength(length); }
+ void setMaxTextLength(int length) { m_editor->setMaxTextLength(length);}
+#ifdef BROWSER_LAYOUT_TENONE
+ void changeEditorMode(bool edit);
+ void setTitle(const QString & text);
+ void setTitleColor(QColor & color);
+ void setTitleFont(QFont & font);
+
+#endif
void setSpecificButton(QString commitString, QString buttonIcon) { m_editor->setSpecificButton(commitString, buttonIcon);}
+ void closeVKB();
+ void openVKB();
protected:
virtual bool eventFilter(QObject * object, QEvent * event);
@@ -125,8 +138,10 @@
signals:
void activated();
void textMayChanged();
+ void contentsChange(int position, int charsRemoved, int charsAdded);
void focusChanged(bool focusIn);
void tapped(QPointF& pos);
+ void titleMouseEvent(QPointF& pos);
private slots:
void makeVisible(qreal cursorX);
@@ -142,7 +157,11 @@
// Cached values used for painting and scrolling.
qreal m_viewPortWidth;
- qreal m_viewPortHeight;
+#ifdef BROWSER_LAYOUT_TENONE
+ qreal m_titleModeWidth;
+ GTitleItem * m_title;
+ QColor m_titleColor;
+#endif
// At runtime, UrlSearchSnippet is parent to a QGraphicsWidget
// (m_viewPort) that is parent to a UrlEditorWidget (m_editor).
@@ -152,6 +171,7 @@
// Attributes
QString m_text;
QColor m_textColor;
+
QColor m_backgroundColor;
qreal m_padding;
//TODO: add left margin too
--- a/ginebra2/NativeChromeItem.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/NativeChromeItem.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -42,9 +42,12 @@
//qDebug() << vals[0] << ":" << vals[1] << ":" << vals[2];
if (vals.size() == 4) {
color.setRgb(vals[0].toInt(), vals[1].toInt(), vals[2].toInt(), vals[3].toInt());
- } else {
+ } else if (vals.size() == 3) {
color.setRgb(vals[0].toInt(), vals[1].toInt(), vals[2].toInt());
}
+ else {
+ color.setNamedColor(cssColor);
+ }
}
} // end of namespace GVA
--- a/ginebra2/PageSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/PageSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -90,6 +90,10 @@
return constPageItem()->html();
}
+bool PageSnippet::hasFocus() {
+ return element().hasFocus();
+}
+
void PageSnippet::setGeometry(int x, int y, int width, int height) {
widget()->setGeometry(x, y, width, height);
}
--- a/ginebra2/PageSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/PageSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -66,6 +66,9 @@
void setHtml(const QString &value);
QString html() const;
Q_PROPERTY(QString html WRITE setHtml READ html)
+
+ bool hasFocus();
+ Q_PROPERTY(bool hasFocus READ hasFocus)
public slots:
void setGeometry(int x, int y, int width, int height);
--- a/ginebra2/RecentUrlToolbarSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/RecentUrlToolbarSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -25,7 +25,7 @@
#include "ToolbarChromeItem.h"
#include "ViewStack.h"
#include "GWebContentView.h"
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
#include <QDebug>
namespace GVA {
@@ -35,6 +35,7 @@
: DualButtonToolbarSnippet(elementId, chrome, element),
m_action1(0)
{
+ connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged()));
}
RecentUrlToolbarSnippet::~RecentUrlToolbarSnippet()
@@ -43,6 +44,10 @@
delete m_action1;
}
+ void RecentUrlToolbarSnippet::onAspectChanged( ) {
+
+ updateOwnerArea();
+ }
RecentUrlToolbarSnippet * RecentUrlToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
{
RecentUrlToolbarSnippet * that = new RecentUrlToolbarSnippet( elementId, chrome, element );
@@ -94,8 +99,8 @@
}
else if (t->actionId == RECENTURL_VIEW_ACTION_CLEARALL) {
if( !action ) {
- // Action is created/handled/owned by BookmarksManager
- QAction * a = WRT::BookmarksManager::getSingleton()->getActionClearHistory();
+ // Action is created/handled/owned by HistoryManager
+ QAction * a = WRT::HistoryManager::getSingleton()->getActionClearHistory();
button->setDefaultAction(a);
}
}
--- a/ginebra2/RecentUrlToolbarSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/RecentUrlToolbarSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -45,6 +45,7 @@
private Q_SLOTS:
/// Back action trigger handler. Switches back to webview
void handleBackButton();
+ void onAspectChanged( );
private:
/// Reimplemented
--- a/ginebra2/SettingsToolbarSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/SettingsToolbarSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -35,6 +35,7 @@
: DualButtonToolbarSnippet(elementId, chrome, element),
m_action1(0), m_action2(0)
{
+ connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged()));
}
SettingsToolbarSnippet::~SettingsToolbarSnippet()
@@ -44,7 +45,11 @@
if(m_action2)
delete m_action2;
}
-
+ void SettingsToolbarSnippet::onAspectChanged( ) {
+
+ updateOwnerArea();
+
+ }
SettingsToolbarSnippet * SettingsToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
{
SettingsToolbarSnippet * that = new SettingsToolbarSnippet( elementId, chrome, element );
--- a/ginebra2/SettingsToolbarSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/SettingsToolbarSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -44,6 +44,7 @@
// Back action trigger handler. Switches back to webview
void handleBackButton();
void handleFeedbackButton();
+ void onAspectChanged( );
private:
/// Reimplemented
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/TitleItem.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,88 @@
+/*
+ * 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:
+ *
+ */
+
+#include "TitleItem.h"
+#include "webpagecontroller.h"
+#include "Utilities.h"
+
+
+namespace GVA {
+
+ // Methods for class TitleItem
+
+ //GTitleItem extends QGraphicsTextItem
+
+ GTitleItem::GTitleItem(QGraphicsItem * parent)
+ : QGraphicsTextItem(parent)
+ , m_maxTextLength(0)
+ {
+ // Disable wrapping, force text to be stored and displayed
+ // as a single line.
+ QTextOption textOption = document()->defaultTextOption();
+ textOption.setWrapMode(QTextOption::NoWrap);
+ document()->setDefaultTextOption(textOption);
+ // This is needed to initialize m_textLine.
+ setText("");
+
+ WebPageController * pageController = WebPageController::getSingleton();
+ }
+
+ GTitleItem::~GTitleItem()
+ {
+ }
+
+ void GTitleItem::setText(const QString & text)
+ {
+ //qDebug() << "GTitleItem::setText " << text;
+ QString newText = text;
+ if(m_maxTextLength > 0 && text.length() > m_maxTextLength ) {
+ newText = newText.left(m_maxTextLength);
+ }
+ setPlainText(newText);
+ m_textLine = document()->begin().layout()->lineForTextPosition(0);
+ }
+
+ void GTitleItem::setMaxTextLength(int length)
+ {
+ if (m_maxTextLength <= 0 && length > 0) {
+ QString text = toPlainText();
+ if( text.length() > length ) {
+ setPlainText(text.left(length));
+ }
+ }
+ m_maxTextLength = length;
+ }
+
+
+ qreal GTitleItem::textWidth()
+ {
+ return m_textLine.naturalTextWidth();
+ }
+
+ void GTitleItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
+ {
+ QGraphicsTextItem::mousePressEvent(event);
+ QPointF pos = event->pos();
+ //qDebug() << "GTitleItem: received mouse press" << pos;
+ emit tapped(pos);
+ }
+
+} // namespace GVA
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/TitleItem.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,61 @@
+/*
+ * 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:
+ *
+ */
+
+#ifndef __TITLE_ITEM_H__
+#define __TITLE_ITEM_H__
+
+
+#include <QGraphicsTextItem>
+#include <QtGui>
+
+namespace GVA {
+
+
+
+class GTitleItem : public QGraphicsTextItem
+{
+ Q_OBJECT
+
+ public:
+ GTitleItem(QGraphicsItem * parent);
+ virtual ~GTitleItem();
+
+ void setMaxTextLength(int length);
+ qreal textWidth();
+
+ protected:
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
+
+ public Q_SLOTS:
+ void setText(const QString & text);
+
+ Q_SIGNALS:
+ void tapped(QPointF& pos);
+
+ private:
+ QTextLine m_textLine;
+ int m_maxTextLength;
+};
+
+
+} // namespace GVA
+
+#endif // __TITLE_ITEM_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/TitleUrlContainerSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,234 @@
+/*
+ * 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:
+ * This class extends WebChromeContainerSnippet class
+ *
+ */
+
+#include "ActionButton.h"
+#include "ActionButtonSnippet.h"
+#include "ChromeRenderer.h"
+#include "ChromeWidget.h"
+#include "NativeChromeItem.h"
+#include "TitleUrlContainerSnippet.h"
+#include "UrlSearchSnippet.h"
+#include "WebChromeSnippet.h"
+#include "Utilities.h"
+
+#include "QGraphicsPixmapItem"
+
+#include "ChromeEffect.h"
+
+#define BACKGROUND_GRADIENT_START "#232323"
+#define BACKGROUND_GRADIENT_END "#000000"
+
+#include <QDebug>
+
+namespace GVA {
+
+// Need to read this from the platform later
+#define ICONWIDTH 65
+#define ICONHEIGHT 44
+
+TitleUrlContainerItem::TitleUrlContainerItem(ChromeSnippet * snippet, ChromeWidget * chrome, QGraphicsItem * parent)
+: NativeChromeItem(snippet, parent)
+, m_chrome(chrome)
+{
+ setProperties();
+ // Create the view port widget
+ m_viewPort = new QGraphicsWidget(this);
+ m_viewPort->setFlags(QGraphicsItem::ItemClipsChildrenToShape);
+
+ // Create title-url widget(still by the name UrlSearchItem)
+ m_urlTileWidget = new GUrlSearchItem(snippet, chrome, m_viewPort);
+
+ QPixmap dividerPixmap;
+ dividerPixmap.load(":/chrome/bedrockchrome/urlsearch.snippet/icons/URL_search_divider.png", "PNG");
+ m_dividerImage = new QGraphicsPixmapItem(dividerPixmap, m_viewPort);
+
+ QAction * backAction = new QAction(this);
+ connect(backAction, SIGNAL(triggered()), m_chrome, SIGNAL(goToBackground()));
+
+ m_backStepButton = new ActionButton(snippet, m_viewPort);
+ m_backStepButton->setAction(backAction);
+ m_backStepButton->setActiveOnPress(true);
+ m_backStepButton->addIcon(":/chrome/bedrockchrome/urlsearch.snippet/icons/backstep.png", QIcon::Normal);
+ m_backStepButton->addIcon(":/chrome/bedrockchrome/urlsearch.snippet/icons/backstep_pressed.png", QIcon::Active);
+
+ // Monitor resize events.
+ safe_connect(m_chrome->renderer(), SIGNAL(chromeResized()), this, SLOT(onChromeResize()));
+ safe_connect(m_urlTileWidget, SIGNAL(changeEditMode(bool)), this, SLOT(changeLayout(bool)));
+}
+
+TitleUrlContainerItem::~TitleUrlContainerItem()
+{
+
+}
+
+void TitleUrlContainerItem::setProperties() {
+
+ m_pen.setWidth(1);
+ m_pen.setBrush(QBrush(QColor(Qt::black)));
+
+ m_grad.setColorAt(0, BACKGROUND_GRADIENT_START);
+ m_grad.setColorAt(1, BACKGROUND_GRADIENT_END);
+}
+
+void TitleUrlContainerItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+{
+ Q_UNUSED(option)
+ Q_UNUSED(widget)
+
+ painter->save();
+
+ painter->setRenderHint(QPainter::Antialiasing);
+ painter->setPen(m_pen);
+ if (snippet()->enabled()) {
+ painter->fillRect(boundingRect(), QBrush(m_grad));
+ }
+ else {
+ painter->fillRect(boundingRect(), QColor(Qt::gray));
+ painter->setOpacity(ChromeEffect::disabledOpacity);
+ painter->fillRect(boundingRect(), ChromeEffect::disabledColor);
+ }
+
+ // top border
+ painter->setPen(QPen(QColor(53,53,53)));
+ painter->drawLine(boundingRect().x(), boundingRect().y(), boundingRect().x() + boundingRect().width(), boundingRect().y());
+ // bottom border
+ painter->setPen(QPen(QColor(76,76,78)));
+ painter->drawLine(boundingRect().x(), boundingRect().y() + boundingRect().height(), boundingRect().x() + boundingRect().width(), boundingRect().y() + boundingRect().height());
+ // right border
+ painter->setPen(QPen(QColor(0,0,0)));
+ painter->drawLine(boundingRect().x() + boundingRect().width(), boundingRect().y(), boundingRect().x() + boundingRect().width(), boundingRect().y() + boundingRect().height());
+ // left border
+ painter->setPen(m_pen);
+ QLinearGradient grad = QLinearGradient();
+ grad.setColorAt(0, QColor(41,41,41));
+ grad.setColorAt(0.5, QColor(83,83,84));
+ grad.setColorAt(1, QColor(2,2,2));
+ painter->fillRect(QRect(boundingRect().x(), boundingRect().y(), 1, boundingRect().height()), QBrush(grad));
+
+ painter->restore();
+
+ NativeChromeItem::paint(painter, option, widget);
+}
+
+void TitleUrlContainerItem::onChromeResize() {
+
+ QWebElement we = m_snippet->element();
+ QRectF g = we.geometry();
+ QGraphicsWidget::resize(g.width(), g.height());
+}
+
+void TitleUrlContainerItem::resizeEvent(QGraphicsSceneResizeEvent * event)
+{
+ QSizeF size = event->newSize();
+
+ qreal width = size.width();
+ qreal height = size.height();
+
+ m_viewPort->setGeometry(
+ 0,
+ 0,
+ width,
+ height);
+
+ m_backStepButton->setGeometry(
+ width - ICONWIDTH,
+ (height - ICONHEIGHT)/2,
+ ICONWIDTH,
+ ICONHEIGHT);
+
+ // When we first get resize event, the widget is not yet set to visible by
+ // Ginebra. If the widget is not visible and for later resize events, if back-step
+ // button is visible, set the width of url-title widget taking into account
+ // the width of back-step button
+ if ((!this->isVisible()) || m_backStepButton->isVisible()) {
+
+ width = width - ICONWIDTH - m_dividerImage->boundingRect().width();
+ }
+ m_urlTileWidget->setGeometry(0,
+ 0,
+ width,
+ height);
+
+ m_dividerImage->setPos(m_urlTileWidget->rect().width() + 1, (height - m_dividerImage->boundingRect().height())/2);
+}
+
+
+void TitleUrlContainerItem::changeLayout(bool editMode){
+
+ qreal width = m_viewPort->geometry().width();
+ qreal height = m_viewPort->geometry().height();
+
+ // If we are changing to edit mode, we need to hide the back-step button
+ if (editMode) {
+
+ m_backStepButton->hide();
+ m_dividerImage->hide();
+ }
+ else {
+
+ // show back-step button and re-layout the widgets
+ m_backStepButton->show();
+ m_dividerImage->show();
+ width = width - ICONWIDTH - m_dividerImage->boundingRect().width();
+ }
+ m_urlTileWidget->setGeometry(0,
+ 0,
+ width,
+ height);
+}
+
+QString TitleUrlContainerItem::url() const
+{
+ return m_urlTileWidget->url();
+}
+
+// TitleUrlContainerSnippet class
+TitleUrlContainerSnippet::TitleUrlContainerSnippet(const QString & elementId, ChromeWidget * chrome,
+ QGraphicsWidget * widget, const QWebElement & element)
+ : ChromeSnippet(elementId, chrome, widget, element)
+{
+}
+
+TitleUrlContainerSnippet::~TitleUrlContainerSnippet()
+{
+}
+
+TitleUrlContainerSnippet * TitleUrlContainerSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
+{
+ TitleUrlContainerSnippet * that = new TitleUrlContainerSnippet( elementId, chrome, 0, element );
+ that->setChromeWidget( new TitleUrlContainerItem(that, chrome));
+
+ return that;
+}
+
+QString TitleUrlContainerSnippet::url() const
+{
+ TitleUrlContainerItem const *urlContainer;
+
+ urlContainer = dynamic_cast<TitleUrlContainerItem const *> (constWidget());
+ return urlContainer->url();
+}
+
+} // end of namespace GVA
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/TitleUrlContainerSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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:
+*
+*/
+#ifndef __GINEBRA_TITLEURLCONTAINERSNIPPET_H
+#define __GINEBRA_TITLEURLCONTAINERSNIPPET_H
+
+#include <QtGui>
+#include "ChromeSnippet.h"
+#include "NativeChromeItem.h"
+
+namespace GVA {
+
+
+class ChromeWidget;
+class GUrlSearchItem;
+class ActionButton;
+
+/* \brief This is the container widget for title-url combo snippet
+ *
+ *
+ */
+class TitleUrlContainerItem : public NativeChromeItem
+{
+ Q_OBJECT
+ public:
+ TitleUrlContainerItem(ChromeSnippet * snippet, ChromeWidget * chrome, QGraphicsItem * parent = 0);
+ virtual ~TitleUrlContainerItem();
+
+ /// The URL of the web page.
+ QString url() const;
+
+ protected:
+ virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
+ virtual void resizeEvent(QGraphicsSceneResizeEvent * event);
+
+ private Q_SLOTS:
+ void onChromeResize();
+ void changeLayout(bool editMode);
+
+ private:
+ void setProperties();
+
+ private:
+ ChromeWidget * m_chrome;
+ QGraphicsWidget * m_viewPort;
+ ActionButton * m_backStepButton;
+ GUrlSearchItem * m_urlTileWidget;
+ QGraphicsPixmapItem * m_dividerImage;
+ // painting support
+ QPen m_pen;
+ QLinearGradient m_grad;
+};
+
+
+/* \brief This is the container snippet for title-url combo
+ *
+ *
+ */
+class TitleUrlContainerSnippet : public ChromeSnippet
+{
+ Q_OBJECT
+ public:
+ TitleUrlContainerSnippet(const QString & elementId, ChromeWidget * chrome,
+ QGraphicsWidget * widget, const QWebElement & element);
+ virtual ~TitleUrlContainerSnippet();
+
+ static TitleUrlContainerSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element);
+
+ /// The URL of the web page.
+ QString url() const;
+ Q_PROPERTY(QString url READ url)
+};
+
+} // end of namespace GVA
+
+#endif // __GINEBRA_TITLEURLCONTAINERSNIPPET_H
--- a/ginebra2/UrlSearchSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/UrlSearchSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -34,6 +34,7 @@
#include "GWebContentView.h"
#include "WindowFlowView.h"
+
#include <QWebHistoryItem>
namespace GVA {
@@ -45,6 +46,15 @@
#define SPECIFIC_BUTTON_STRING ".com"
#define BETWEEN_ENTRY_AND_BUTTON_SPACE 4
+static const QString KBookmarkHistoryViewName = "BookmarkHistoryView";
+static const QString KBookmarkTreeViewName = "BookmarkTreeView";
+static const QString KWindowViewName = "WindowView";
+static const QString KSettingsViewName = "SettingsView";
+
+//#define VBORDER_GRADIENT_START "#292929"
+//#define VBORDER_GRADIENT_STOP "#535354"
+//#define VBORDER_GRADIENT_END "#020202"
+
GUrlSearchItem::GUrlSearchItem(ChromeSnippet * snippet, ChromeWidget * chrome, QGraphicsItem * parent)
: NativeChromeItem(snippet, parent)
, m_chrome(chrome)
@@ -62,27 +72,46 @@
// padding-left) etc, which will all be equal. Hence we just use one of the
// computed primitive values (top) to represent the common value.
+
QWebElement we = m_snippet->element();
QColor textColor;
+
+ QColor backgroundColor;
+ QColor progressColor;
+
+#ifndef BROWSER_LAYOUT_TENONE
+
NativeChromeItem::CSSToQColor(
we.styleProperty("color", QWebElement::ComputedStyle),
textColor);
- QColor backgroundColor;
NativeChromeItem::CSSToQColor(
we.styleProperty("background-color", QWebElement::ComputedStyle),
- backgroundColor); // FIXME text edit background color doesn't work
-
- QColor progressColor;
- NativeChromeItem::CSSToQColor(
- we.styleProperty("border-bottom-color", QWebElement::ComputedStyle),
- progressColor); //FIXME text-underline-color causes the crash
+ backgroundColor);
NativeChromeItem::CSSToQColor(
we.styleProperty("border-top-color", QWebElement::ComputedStyle),
m_borderColor);
+#endif
+ NativeChromeItem::CSSToQColor(
+ we.styleProperty("border-bottom-color", QWebElement::ComputedStyle),
+ progressColor);
+
+#ifdef BROWSER_LAYOUT_TENONE
+ QFont titleFont;
+ QColor titleColor;
+ textColor = QColor(Qt::black);
+ titleColor = QColor(Qt::white);
+ m_borderColor = QColor(Qt::transparent);
+ backgroundColor = QColor(Qt::transparent);
+
+ titleFont = QFont(QApplication::font());
+ titleFont.setPointSize(9);
+ titleFont.setWeight(QFont::Bold);
+#endif
+
QString cssPadding = we.styleProperty("padding-top", QWebElement::ComputedStyle);
m_padding = cssPadding.remove("px").toInt();
@@ -96,16 +125,24 @@
// Create the url search editor
m_urlSearchEditor = new GProgressEditor(snippet, chrome, m_viewPort);
m_urlSearchEditor->setTextColor(textColor);
+ #ifdef BROWSER_LAYOUT_TENONE
+ m_urlSearchEditor->setTitleFont(titleFont);
+ m_urlSearchEditor->setTitleColor(titleColor);
+ #endif
m_urlSearchEditor->setBackgroundColor(backgroundColor);
m_urlSearchEditor->setProgressColor(progressColor);
m_urlSearchEditor->setBorderColor(m_borderColor);
m_urlSearchEditor->setPadding(0.1); // draw the Rounded Rect
m_urlSearchEditor->setInputMethodHints(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
m_urlSearchEditor->setSpecificButton(SPECIFIC_BUTTON_STRING, SPECIFIC_BUTTON_ICON);
- safe_connect(m_urlSearchEditor, SIGNAL(textMayChanged()), this, SLOT(updateLoadStateAndSuggest()));
+ safe_connect(m_urlSearchEditor, SIGNAL(contentsChange(int, int, int)),
+ this, SLOT(updateLoadStateAndSuggest(int, int, int)));
safe_connect(m_urlSearchEditor, SIGNAL(activated()),this, SLOT(urlSearchActivatedByEnterKey()));
safe_connect(m_urlSearchEditor, SIGNAL(focusChanged(bool)),this, SLOT(focusChanged(bool)));
safe_connect(m_urlSearchEditor, SIGNAL(tapped(QPointF&)),this, SLOT(tapped(QPointF&)));
+#ifdef BROWSER_LAYOUT_TENONE
+ safe_connect(m_urlSearchEditor, SIGNAL(titleMouseEvent(QPointF&)),this, SLOT(changeToUrl(QPointF&)));
+#endif
// Create the url search button
m_urlSearchBtn = new ActionButton(snippet, m_viewPort);
@@ -121,6 +158,7 @@
QSize actualSize = btnIcon.actualSize(defaultSize);
m_iconWidth = actualSize.width();
m_iconHeight = actualSize.height();
+
// Set the right text margin to accomodate the icon inside the editor
m_urlSearchEditor->setRightTextMargin(m_iconWidth + BETWEEN_ENTRY_AND_BUTTON_SPACE);
@@ -128,43 +166,20 @@
safe_connect(m_chrome, SIGNAL(chromeComplete()),
this, SLOT(onChromeComplete()));
+#ifndef BROWSER_LAYOUT_TENONE
// Monitor resize events.
safe_connect(m_chrome->renderer(), SIGNAL(chromeResized()),
- this, SLOT(resize()));
-
- WebPageController * pageController = WebPageController::getSingleton();
-
- safe_connect(pageController, SIGNAL(pageUrlChanged(const QString)),
- m_urlSearchEditor, SLOT(setText(const QString &)))
-
- safe_connect(pageController, SIGNAL(pageLoadStarted()),
- this, SLOT(setStarted()));
-
- safe_connect(pageController, SIGNAL(pageLoadProgress(const int)),
- this, SLOT(setProgress(int)));
-
- safe_connect(pageController, SIGNAL(pageLoadFinished(bool)),
- this, SLOT(setFinished(bool)));
-
- safe_connect(pageController, SIGNAL(pageCreated(WRT::WrtBrowserContainer*)),
- this, SLOT(setPageCreated()));
-
- safe_connect(pageController, SIGNAL(pageChanged(WRT::WrtBrowserContainer*, WRT::WrtBrowserContainer*)),
- this, SLOT(setPageChanged()));
-
- // Monitor view changes.
-
- ViewController * viewController = chrome->viewController();
-
- safe_connect(viewController, SIGNAL(currentViewChanged()),
- this, SLOT(viewChanged()));
+ this, SLOT(resize()));
+#endif
/* safe_connect(ViewStack::getSingleton(), SIGNAL(currentViewChanged()),
this, SLOT(viewChanged()));*/
+
}
GUrlSearchItem::~GUrlSearchItem()
{
+
}
//TODO: Shouldn't have to explicitly set the viewport sizes here
@@ -176,6 +191,7 @@
m_viewPortWidth = size.width() - m_padding * 2;
m_viewPortHeight = size.height() - m_padding * 2;
+
m_viewPort->setGeometry(
m_padding,
m_padding,
@@ -195,7 +211,6 @@
0,
m_viewPortWidth,
m_viewPortHeight);
-
}
void GUrlSearchItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
@@ -232,10 +247,99 @@
painter->restore();
NativeChromeItem::paint(painter, option, widget);
+
+}
+
+#ifdef BROWSER_LAYOUT_TENONE
+void GUrlSearchItem::changeToUrl(QPointF& pos)
+{
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
+
+ if( curView && curView->type() == "webView" ) {
+ emit changeEditMode(true);
+ //qDebug() << "GUrlSearchItem::changeToUrl";
+ m_urlSearchEditor->changeEditorMode(true);
+ m_urlSearchBtn->show();
+ m_urlSearchEditor->grabFocus();
+ tapped(pos);
+ m_urlSearchEditor->openVKB();
+ }
+
+}
+
+void GUrlSearchItem::changeToTitle()
+{
+ emit changeEditMode(false);
+ m_urlSearchEditor->changeEditorMode(false);
+ m_urlSearchBtn->hide();
+}
+
+#endif
+
+void GUrlSearchItem::onContentMouseEvent(QEvent::Type type )
+{
+
+ //qDebug() << "UrlSearchItem::onContentMouseEvent" << type;
+ // We are dismissing the VKB on mouse release so that if the mouse press was on a link
+ // we will not close VKB that might cause a shift in geometry which can potentially prevent
+ // the link from being selected
+ if ((WebPageController::getSingleton()->editMode()) && (type == QEvent::GraphicsSceneMouseRelease)) {
+ // Edit canceled, so update LoadController state
+ changeLoadState(false);
+
+ m_urlSearchEditor->closeVKB();
+
+#ifdef BROWSER_LAYOUT_TENONE
+ if (! WebPageController::getSingleton()->isPageLoading())
+ changeToTitle();
+ // Set the text to the url of page
+ setUrlText(urlToBeDisplayed());
+#endif
+ }
+
}
void GUrlSearchItem::onChromeComplete()
{
+ WebPageController * pageController = WebPageController::getSingleton();
+
+ safe_connect(pageController, SIGNAL(pageUrlChanged(const QString)),
+ this, SLOT(setUrlText(const QString &)))
+
+ safe_connect(pageController, SIGNAL(pageLoadStarted()),
+ this, SLOT(setStarted()));
+
+ safe_connect(pageController, SIGNAL(pageLoadProgress(const int)),
+ this, SLOT(setProgress(int)));
+
+ safe_connect(pageController, SIGNAL(pageLoadFinished(bool)),
+ this, SLOT(setFinished(bool)));
+
+ safe_connect(pageController, SIGNAL(pageCreated(WRT::WrtBrowserContainer*)),
+ this, SLOT(setPageCreated()));
+
+ safe_connect(pageController, SIGNAL(pageChanged(WRT::WrtBrowserContainer*, WRT::WrtBrowserContainer*)),
+ this, SLOT(setPageChanged()));
+
+ safe_connect(pageController, SIGNAL(pageLoadFailed()),
+ this, SLOT(setPageFailed()));
+#ifdef BROWSER_LAYOUT_TENONE
+ safe_connect(pageController, SIGNAL(titleChanged(const QString&)),
+ this, SLOT(onTitleChange(const QString&)));
+#endif
+ // Monitor view changes.
+
+ ViewController * viewController = m_chrome->viewController();
+
+ safe_connect(viewController, SIGNAL(currentViewChanged()),
+ this, SLOT(viewChanged()));
+
+
+ GWebContentView* webView = static_cast<GWebContentView*> (m_chrome->getView("WebView"));
+ safe_connect(webView, SIGNAL(contentViewMouseEvent(QEvent::Type )), this, SLOT(onContentMouseEvent(QEvent::Type )));
+
+
setStarted();
WRT::WindowFlowView* windowView = static_cast<WRT::WindowFlowView *>(m_chrome->viewController()->view("WindowView"));
@@ -254,13 +358,24 @@
WebPageController * pageController = WebPageController::getSingleton();
ViewController * viewController = m_chrome->viewController();
- m_urlSearchEditor->setText(pageController->currentRequestedUrl());
+#ifdef BROWSER_LAYOUT_TENONE
+ emit changeEditMode(false);
+ m_urlSearchBtn->show();
+ m_urlSearchEditor->changeEditorMode(true);
+#endif
+
+ QString url = pageController->currentRequestedUrl();
+ if(!url.contains(KBOOKMARKURLFILESLASH)){
+ if(url.contains(KBOOKMARKURLFILE))
+ url.replace(QString(KBOOKMARKURLFILE), QString(KBOOKMARKURLFILESLASH));
+ }
+ setUrlText(url);
ControllableViewBase* curView = viewController->currentView();
if (curView && curView->type() == "webView") {
GWebContentView * gView = qobject_cast<GWebContentView*> (curView);
bool isSuperPage = gView ? gView->currentPageIsSuperPage() : false;
if(!isSuperPage)
- m_chrome->layout()->slideView(100);
+ m_chrome->layout()->slideView(100);
}
// Strictly speaking we should set progress to 0.
// But set it higher to give immediate visual feedback
@@ -278,7 +393,10 @@
void GUrlSearchItem::setProgress(int percent)
{
- m_urlSearchEditor->setProgress(percent);
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
+ if ( curView && curView->type() == "webView" )
+ m_urlSearchEditor->setProgress(percent);
}
// Wait a half-second before actually clearing the progress bar.
@@ -308,26 +426,46 @@
void GUrlSearchItem::setFinished(bool ok)
{
WebPageController * pageController = WebPageController::getSingleton();
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
+ //qDebug() << "GUrlSearchItem::setFinished" << pageController->loadState();
+
+ if (pageController->loadState() != WRT::LoadController::GotoModeEditing) {
+ m_urlSearchEditor->removeFocus();
+
+ if ( ok && curView && curView->type() == "webView" ){
+ setUrlText(formattedUrl());
+#ifdef BROWSER_LAYOUT_TENONE
+ m_urlSearchEditor->setTitle(currentTitle());
+#endif
+ }
+ if (curView && curView->type() == "webView" && pageController->contentsYPos() > 0)
+ m_chrome->layout()->slideView(-100);
+ }
+
// If the load was finished normally and not due to user stopping it,
// simulate progress completion
- if (!pageController->loadCanceled())
+ if ( !pageController->loadCanceled() && curView && curView->type() == "webView" )
m_urlSearchEditor->setProgress(100);
- if (ok)
- m_urlSearchEditor->setText(formattedUrl());
-
- m_urlSearchEditor->removeFocus();
-
- ViewController * viewController = m_chrome->viewController();
- ControllableViewBase* curView = viewController->currentView();
- if (curView && curView->type() == "webView" && pageController->contentsYPos() > 0)
- m_chrome->layout()->slideView(-100);
-
++m_pendingClearCalls;
QTimer::singleShot(500, this, SLOT(clearProgress()));
}
+void GUrlSearchItem::setPageFailed()
+{
+ WebPageController * pageController = WebPageController::getSingleton();
+ LoadController * loadController = pageController->currentPage()->loadController();
+ if( loadController->loadCanceled() && !loadController->pointOfNoReturn() )
+ {
+ setUrlText(loadController->urlText());
+ }
+ else
+ {
+ setUrlText(formattedUrl());
+ }
+}
void GUrlSearchItem::setPageCreated()
{
// remove slideview(100) since the new transition for the code-driven window
@@ -336,10 +474,26 @@
void GUrlSearchItem::setPageChanged()
{
- m_urlSearchEditor->setText(formattedUrl());
+ setUrlText(formattedUrl());
updateUrlSearchBtn();
+ WebPageController * pageController = WebPageController::getSingleton();
+#ifdef BROWSER_LAYOUT_TENONE
+
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
- WebPageController * pageController = WebPageController::getSingleton();
+ QString title;
+ if (curView && curView->type() == KWindowViewName ) {
+ title = getWindowsViewTitle();
+ }
+ else {
+ title = currentTitle();
+ }
+
+ m_urlSearchEditor->setTitle(title);
+#endif
+
+
int progress = pageController->loadProgressValue();
if (progress == 100)
m_urlSearchEditor->removeFocus();
@@ -357,8 +511,15 @@
if (pageController->isPageLoading()) {
return;
}
+
m_urlSearchEditor->setProgress(0);
updateUrlSearchBtn();
+
+#ifdef BROWSER_LAYOUT_TENONE
+ if ( !pageController->editMode() ) {
+ changeToTitle();
+ }
+#endif
}
void GUrlSearchItem::viewChanged()
@@ -370,40 +531,103 @@
GWebContentView * gView = qobject_cast<GWebContentView*> (curView);
bool isSuperPage = gView ? gView->currentPageIsSuperPage() : false;
+
// view changes to web content view
if (curView && curView->type() == "webView" && !isSuperPage) {
- int progress = pageController->loadProgressValue();
- if (progress >= 100)
- progress = 0;
- m_urlSearchEditor->setProgress(progress);
- updateUrlSearchBtn();
+
+
+#ifdef BROWSER_LAYOUT_TENONE
+
+ if (pageController->isPageLoading()) {
+ m_urlSearchEditor->changeEditorMode(true);
+ m_urlSearchBtn->show();
+#endif
+ int progress = pageController->loadProgressValue();
+ if (progress >= 100)
+ progress = 0;
+ m_urlSearchEditor->setProgress(progress);
+ updateUrlSearchBtn();
- // place focus in urlsearch bar when returning from adding a new window in windows view
- if (pageController->loadText() == "") {
- if (m_backFromNewWinTrans ) {
- m_backFromNewWinTrans = false;
- WebPageController * pageController = WebPageController::getSingleton();
- m_urlSearchEditor->setText(pageController->currentRequestedUrl());
+ // place focus in urlsearch bar when returning from adding a new window in windows view
+ if (pageController->loadText() == "") {
+ if (m_backFromNewWinTrans ) {
+ m_backFromNewWinTrans = false;
+ setUrlText(pageController->currentRequestedUrl());
+ }
+ else {
+ m_urlSearchEditor->grabFocus();
+ }
}
- else {
- m_urlSearchEditor->grabFocus();
- }
+#ifdef BROWSER_LAYOUT_TENONE
+ }
+ else {
+ m_urlSearchEditor->setTitle(currentTitle());
}
+#endif
if (!isSuperPage && (pageController->contentsYPos() <= 0 || pageController->isPageLoading())){
- m_chrome->layout()->slideView(100);
+ m_chrome->layout()->slideView(100);
} else {
- m_chrome->layout()->slideView(-100);
+ m_chrome->layout()->slideView(-100);
}
m_backFromNewWinTrans = false;
} else {
- pageController->urlTextChanged(m_urlSearchEditor->text());
- // Remove progress bar
- // incorrect values are not seen before we can update when we come back
- m_urlSearchEditor->setProgress(0);
- m_chrome->layout()->slideView(-100);
+
+ pageController->urlTextChanged(m_urlSearchEditor->text());
+ // Remove progress bar
+ // incorrect values are not seen before we can update when we come back
+ m_urlSearchEditor->setProgress(0);
+
+#ifdef BROWSER_LAYOUT_TENONE
+ QString key = curView->objectName();
+ if (key == KWindowViewName) {
+ key = getWindowsViewTitle();
+ }
+ else if (key == KSettingsViewName) {
+ key = qtTrId("txt_browser_settings_settings");
+ }
+ else if (key == KBookmarkHistoryViewName) {
+ key = qtTrId("txt_browser_history_history");
+ }
+ else if (key == KBookmarkTreeViewName) {
+ key = qtTrId("txt_browser_bookmarks_bookmarks");
+ }
+ changeToTitle();
+ m_urlSearchEditor->setTitle(key);
+#else
+ m_chrome->layout()->slideView(-100);
+#endif
}
+
}
+#ifdef BROWSER_LAYOUT_TENONE
+void GUrlSearchItem::onTitleChange(const QString& text)
+{
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
+ if ( curView && curView->type() == "webView" ){
+
+ m_urlSearchEditor->setTitle(text);
+
+ }
+}
+
+QString GUrlSearchItem::getWindowsViewTitle() {
+ QString title = currentTitle();
+ if (title.isEmpty()) {
+ title = qtTrId("txt_browser_windows_windows");
+ title += ": ";
+ title += qtTrId("txt_browser_windows_new_window");
+ }
+ else {
+ title.prepend(": ");
+ title.prepend(qtTrId("txt_browser_windows_windows"));
+
+ }
+ return title;
+}
+#endif
+
void GUrlSearchItem::urlSearchActivatedByEnterKey()
{
m_urlSearchEditor->removeFocus();
@@ -413,26 +637,26 @@
void GUrlSearchItem::urlSearchActivated()
{
WebPageController * pageController = WebPageController::getSingleton();
- switch (pageController->loadState()) {
- case WRT::LoadController::GotoModeLoading:
- pageController->currentStop();
- ++m_pendingClearCalls;
- QTimer::singleShot(500, this, SLOT(clearProgress()));
- break;
- case WRT::LoadController::GotoModeEditing:
- loadToMainWindow();
- break;
- case WRT::LoadController::GotoModeReloadable:
- if (pageController->currentDocUrl() == m_urlSearchEditor->text())
- pageController->currentReload();
- else
- loadToMainWindow();
- break;
- default:
- qDebug() << "Incorrect state";
- break;
- }
- updateUrlSearchBtn();
+ switch (pageController->loadState()) {
+ case WRT::LoadController::GotoModeLoading:
+ pageController->currentStop();
+ ++m_pendingClearCalls;
+ QTimer::singleShot(500, this, SLOT(clearProgress()));
+ break;
+ case WRT::LoadController::GotoModeEditing:
+ loadToMainWindow();
+ break;
+ case WRT::LoadController::GotoModeReloadable:
+ if (pageController->currentDocUrl() == m_urlSearchEditor->text())
+ pageController->currentReload();
+ else
+ loadToMainWindow();
+ break;
+ default:
+ qDebug() << "GUrlSearchItem::urlSearchActivated() Incorrect state";
+ break;
+ }
+ updateUrlSearchBtn();
}
void GUrlSearchItem::updateUrlSearchBtn()
@@ -442,14 +666,19 @@
case WRT::LoadController::GotoModeLoading:
m_urlSearchBtn->addIcon(STOP_BUTTON_ICON);
break;
+ case WRT::LoadController::GotoModeEditinLoading:
case WRT::LoadController::GotoModeEditing:
m_urlSearchBtn->addIcon(GO_BUTTON_ICON);
break;
case WRT::LoadController::GotoModeReloadable:
+#ifdef BROWSER_LAYOUT_TENONE
+ m_urlSearchBtn->addIcon(GO_BUTTON_ICON);
+#else
m_urlSearchBtn->addIcon(REFRESH_BUTTON_ICON);
+#endif
break;
default:
- qDebug() << "Incorrect state";
+ qDebug() << "GUrlSearchItem::updateUrlSearchBtn Incorrect state";
break;
}
m_urlSearchBtn->update();
@@ -465,40 +694,54 @@
void GUrlSearchItem::loadToMainWindow()
{
QString url = m_urlSearchEditor->text();
+ if(!url.contains(KBOOKMARKURLFILESLASH)){
+ if(url.contains(KBOOKMARKURLFILE))
+ url.replace(QString(KBOOKMARKURLFILE), QString(KBOOKMARKURLFILESLASH));
+ }
WebPageController * pageController = WebPageController::getSingleton();
QString gotourl = pageController->guessUrlFromString(url);
- m_urlSearchEditor->setText(gotourl);
+ setUrlText(gotourl);
pageController->currentLoad(gotourl);
pageController->urlTextChanged(gotourl);
+#ifdef BROWSER_LAYOUT_TENONE
+ m_urlSearchEditor->closeVKB();
+#endif
}
-void GUrlSearchItem::updateLoadState()
+void GUrlSearchItem::updateLoadStateAndSuggest(int /*position*/, int charsRemoved, int charsAdded)
{
WebPageController * pageController = WebPageController::getSingleton();
- if (pageController->loadState() == WRT::LoadController::GotoModeReloadable) {
- pageController->setLoadState(WRT::LoadController::GotoModeEditing);
+
+ // will get contentsChanged() signal on programmatic changes and sometimes
+ // position changes but we are only interested in user input
+ if ((charsRemoved || charsAdded) && pageController->editMode()) {
+ PageSnippet * suggestSnippet = qobject_cast<PageSnippet*>(m_chrome->getSnippet("SuggestsChromeId"));
+ if (suggestSnippet) {
+ QString cmd = "searchSuggests.updateUserInput();";
+ suggestSnippet->evaluateJavaScript(cmd);
+ }
+ }
+}
+
+
+void GUrlSearchItem::changeLoadState(bool editing) {
+
+ WebPageController * pageController = WebPageController::getSingleton();
+ if (pageController->editMode() != editing) {
+ pageController->setEditMode(editing);
updateUrlSearchBtn();
}
}
-
-void GUrlSearchItem::updateLoadStateAndSuggest()
-{
- updateLoadState();
- PageSnippet * suggestSnippet = qobject_cast<PageSnippet*>(m_chrome->getSnippet("SuggestsChromeId"));
- if (suggestSnippet) {
- QString cmd = "searchSuggests.updateUserInput();";
- suggestSnippet->evaluateJavaScript(cmd);
- }
-}
-
void GUrlSearchItem::tapped(QPointF& pos)
{
+ changeLoadState(true);
bool hitText = m_urlSearchEditor->tappedOnText(pos.x());
if (!m_justFocusIn && !hitText)
m_urlSearchEditor->unselect();
if (m_justFocusIn) {
m_justFocusIn = false;
+
if (hitText && !m_urlSearchEditor->hasSelection())
m_urlSearchEditor->selectAll();
}
@@ -506,19 +749,20 @@
void GUrlSearchItem::focusChanged(bool focusIn)
{
- if (focusIn)
+ // Suggestion snippet needs to know about this event.
+ PageSnippet * suggestSnippet = qobject_cast<PageSnippet*>(m_chrome->getSnippet("SuggestsChromeId"));
+ if (suggestSnippet) {
+ QString cmd("searchSuggests.urlSearchFocusChanged(");
+ cmd += focusIn ? "true);" : "false);";
+ suggestSnippet->evaluateJavaScript(cmd);
+ }
+
+ if (focusIn) {
m_justFocusIn = true;
+ }
else {
m_justFocusIn = false;
- m_urlSearchEditor->unselect();
- m_urlSearchEditor->shiftToLeftEnd();
-
- // Suggestion snippet needs to know about this event.
- PageSnippet * suggestSnippet = qobject_cast<PageSnippet*>(m_chrome->getSnippet("SuggestsChromeId"));
- if (suggestSnippet) {
- QString cmd = "searchSuggests.urlSearchLostFocus();";
- suggestSnippet->evaluateJavaScript(cmd);
- }
+
}
}
@@ -540,14 +784,50 @@
{
WebPageController * pageController = WebPageController::getSingleton();
QString url = pageController->loadText();
+
// for first load of the windows restored from last session
if (url.isEmpty()&& pageController->currentDocUrl().isEmpty()) {
QWebHistoryItem item = pageController->currentPage()->history()->currentItem();
url = item.url().toString();
}
+
return url.replace(" ","+");
}
+void GUrlSearchItem::setUrlText(const QString & str)
+{
+ ViewController * viewController = m_chrome->viewController();
+ ControllableViewBase* curView = viewController->currentView();
+ if ( curView && curView->type() == "webView" )
+ m_urlSearchEditor->setText(WebPageController::getSingleton()->removeScheme(str));
+}
+
+QString GUrlSearchItem::urlToBeDisplayed()
+{
+
+ WebPageController * pageController = WebPageController::getSingleton();
+ QString url = pageController->currentDocUrl();
+ if (url.isEmpty() ) {
+ url = pageController->currentRequestedUrl();
+ }
+ //qDebug() << "GUrlSearchItem::urlToBeDisplayed" << url;
+ return url;
+}
+
+QString GUrlSearchItem::currentTitle()
+{
+
+ WebPageController * pageController = WebPageController::getSingleton();
+ QString title = pageController->currentDocTitle();
+ if (title.isEmpty() ){
+ title = pageController->currentPartialUrl();
+ }
+ return title;
+}
+
+// GUrlSearchSnippet class
+
+
GUrlSearchSnippet::GUrlSearchSnippet(const QString & elementId, ChromeWidget * chrome,
QGraphicsWidget * widget, const QWebElement & element)
: ChromeSnippet(elementId, chrome, widget, element)
--- a/ginebra2/UrlSearchSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/UrlSearchSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -28,6 +28,7 @@
namespace GVA {
class ChromeWidget;
+
class GUrlSearchItem : public NativeChromeItem
{
Q_OBJECT
@@ -38,6 +39,9 @@
QString url() const { return m_urlSearchEditor->text();}
void setUrl(const QString &url) {m_urlSearchEditor->setText(url);}
+Q_SIGNALS:
+ void changeEditMode(bool);
+
protected:
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
virtual void resizeEvent(QGraphicsSceneResizeEvent * event);
@@ -46,25 +50,40 @@
void loadToMainWindow();
void updateUrlSearchBtn();
QString formattedUrl() const;
+#ifdef BROWSER_LAYOUT_TENONE
+ void changeToTitle();
+ QString getWindowsViewTitle();
+#endif
+ void changeLoadState(bool editing=true);
+ QString urlToBeDisplayed();
+ QString currentTitle();
private slots:
+
+ void onContentMouseEvent(QEvent::Type type);
+#ifdef BROWSER_LAYOUT_TENONE
+ void changeToUrl(QPointF&);
+ void onTitleChange(const QString&);
+#endif
+ void setUrlText(const QString &);
void onChromeComplete();
void setStarted();
void setProgress(int percent);
void setFinished(bool ok);
void setPageCreated();
void setPageChanged();
+ void setPageFailed();
void clearProgress();
void viewChanged();
void urlSearchActivatedByEnterKey();
void urlSearchActivated();
- void updateLoadState();
void focusChanged(bool focusIn);
void resize();
- void updateLoadStateAndSuggest();
+ void updateLoadStateAndSuggest(int /*position*/, int charsRemoved, int charsAdded);
void onNewWindowTransitionComplete();
void tapped(QPointF&);
+
private:
ChromeWidget * m_chrome;
@@ -79,6 +98,7 @@
QGraphicsWidget * m_viewPort;
ActionButton * m_urlSearchBtn;
GProgressEditor * m_urlSearchEditor;
+
// variables
int m_pendingClearCalls;
--- a/ginebra2/WindowToolbarSnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/WindowToolbarSnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -33,11 +33,17 @@
: DualButtonToolbarSnippet(elementId, chrome, element)
{
m_type = TOOLBAR_WINDOWS_VIEW;
+ connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged()));
}
WindowToolbarSnippet::~WindowToolbarSnippet()
{
}
+
+ void WindowToolbarSnippet::onAspectChanged( ) {
+
+ updateOwnerArea();
+ }
WindowToolbarSnippet * WindowToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
{
--- a/ginebra2/WindowToolbarSnippet.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/WindowToolbarSnippet.h Mon Oct 04 00:04:54 2010 +0300
@@ -45,6 +45,7 @@
private Q_SLOTS:
/// Back action trigger handler. Switches back to webview
void handleBackButton();
+ void onAspectChanged( );
private:
/// Reimplemented
--- a/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkDialog.css Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkDialog.css Mon Oct 04 00:04:54 2010 +0300
@@ -94,3 +94,19 @@
div.bookmarkCancelButton:active{
background-image: url(icons/dialog_buttons_cross_pressed.png);
}
+
+div.bookmarkCheckboxTextLabel {
+ font-size:20px;
+ height:20px;
+ color:#fff;
+ display: none;
+}
+
+#bookmarkCheckboxId {
+ width:20px;
+ height:20px;
+ background-color:white;
+ border-color:#c8c8c8;
+ border-radius:3px;
+ margin-top:15px;
+}
--- a/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkDialog.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkDialog.js Mon Oct 04 00:04:54 2010 +0300
@@ -1,12 +1,33 @@
var _dailogFlag = 0;
var _OriginalTitle = 0;
+document.getElementsByClassName = function(class_name) {
+ var docList = this.all || this.getElementsByTagName('*');
+ var matchArray = new Array();
+
+ /*Create a regular expression object for class*/
+ var re = new RegExp("(?:^|\\s)"+class_name+"(?:\\s|$)");
+ for (var i = 0; i < docList.length; i++) {
+ if (re.test(docList[i].className) ) {
+ matchArray[matchArray.length] = docList[i];
+ }
+ }
+
+ return matchArray;
+}
+
function bookmarkDialog()
{
- this.write = writeBookmarkDialog;
+ this.write = writeBookmarkDialog;
+
+ // do setup
+ this.write();
- // do setup
- this.write();
+ if (app.serviceFramework() == "mobility_service_framework")
+ {
+ document.getElementsByClassName("bookmarkCheckboxTextLabel")[0].style.display = "inline";
+ }
+
}
function writeBookmarkDialog()
@@ -17,6 +38,8 @@
'<div class="bookmarkTextLabel" id="bookmarkDialogTitle">Add Bookmark</div>'+
'<div class="GinebraSnippet" id="BookmarkDialogTitleId" data-GinebraNativeClass="TextEditSnippet" data-GinebraVisible="true"></div>'+
'<div class="GinebraSnippet" id="BookmarkDialogUrlId" data-GinebraNativeClass="TextEditSnippet" data-GinebraVisible="true"></div>'+
+ '<div class="bookmarkCheckboxTextLabel"><input type="checkbox" id="bookmarkCheckboxId"/>Add shortcut to home screen</div>'+
+ '<div><input type="hidden" id="BookmarkDialogBookmarkId" name="BookmarkDialogBookmarkId" value=""/></div>'+
'<div class="controls">' +
'<div type="button" onmouseup="bookmarkOperation();" class="bookmarkDoneButton"></div>'+
'<div type="button" onmouseup="bookmarkDialogIdHide();" class="bookmarkCancelButton"></div>'+
@@ -30,23 +53,38 @@
window.snippets.BookmarkDialogId.hide();
snippets.BookmarkViewToolbarId.enabled = true;
snippets.WebViewToolbarId.enabled = true;
+
+ if (app.serviceFramework() == "mobility_service_framework")
+ {
+ if (document.getElementById("bookmarkCheckboxId").checked)
+ {
+ document.getElementById("bookmarkCheckboxId").checked = false;
+ }
+ }
}
-function launchBookmarkDialog(bmtitle, bmurl, dialogFlag)
+function launchBookmarkDialog(bmtitle, bmurl, bmid, dialogFlag)
{
try{
snippets.BookmarkViewToolbarId.enabled = false;
snippets.WebViewToolbarId.enabled = false;
if (dialogFlag == 0) {
- var dlgTitle = document.getElementById("bookmarkDialogTitle");
- dlgTitle.firstChild.nodeValue= window.localeDelegate.translateText("txt_browser_input_dial_add_bm");
- }
- else if (dialogFlag == 1) {
- var dlgTitle = document.getElementById("bookmarkDialogTitle");
- dlgTitle.firstChild.nodeValue= window.localeDelegate.translateText("txt_browser_input_dial_edit_bm");
- }
-
+ if (app.serviceFramework() == "mobility_service_framework")
+ {
+ document.getElementsByClassName("bookmarkCheckboxTextLabel")[0].style.display = "inline";
+ }
+ var dlgTitle = document.getElementById("bookmarkDialogTitle");
+ dlgTitle.firstChild.nodeValue= window.localeDelegate.translateText("txt_browser_input_dial_add_bm");
+ var chkboxTitle = document.getElementsByClassName("bookmarkCheckboxTextLabel")[0];
+ chkboxTitle.firstChild.nodeValue= window.localeDelegate.translateText("txt_browser_bookmarks_also_add_to_home_screen");
+ }
+ else if (dialogFlag == 1) {
+ document.getElementsByClassName("bookmarkCheckboxTextLabel")[0].style.display = "none";
+ var dlgTitle = document.getElementById("bookmarkDialogTitle");
+ dlgTitle.firstChild.nodeValue= window.localeDelegate.translateText("txt_browser_input_dial_edit_bm");
+ }
+
_dailogFlag = dialogFlag;
_OriginalTitle = bmtitle;
window.snippets.BookmarkDialogTitleId.lostFocus.connect(titleFieldLostFocus);
@@ -66,7 +104,8 @@
if (bmurl == "")
window.snippets.BookmarkDialogUrlId.text = "Url";
else
- window.snippets.BookmarkDialogUrlId.text = bmurl;
+ window.snippets.BookmarkDialogUrlId.text = bmurl;
+ document.getElementById('BookmarkDialogBookmarkId').value = bmid;
window.snippets.BookmarkDialogId.show(false);
@@ -76,7 +115,6 @@
}
-
function bookmarkOperation()
{
snippets.BookmarkViewToolbarId.enabled = true;
@@ -87,13 +125,27 @@
//Hide the dialog
window.snippets.BookmarkDialogId.hide();
//Update the database
- var errCode;
+ var errCode = 0;
- if (_dailogFlag == 0)
- errCode = window.bookmarksManager.addBookmark(bmtitle,bmurl);
- else if (_dailogFlag == 1)
- errCode = window.bookmarksManager.modifyBookmark(_OriginalTitle,bmtitle,bmurl);
-
+ if (_dailogFlag == 0) {
+ var bmid = window.bookmarksController.addBookmark(bmtitle,bmurl);
+ if (bmid < 0) {
+ alert("Unknown error adding bookmark");
+ return;
+ }
+ if (app.serviceFramework() == "mobility_service_framework")
+ {
+ if (document.getElementById("bookmarkCheckboxId").checked)
+ {
+ errCode = window.hsBookmarkPublishClient.addWidget(bmtitle, bmurl);
+ document.getElementById("bookmarkCheckboxId").checked = false;
+ }
+ }
+ }
+ else if (_dailogFlag == 1) {
+ var bmid = document.getElementById('BookmarkDialogBookmarkId').value;
+ errCode = window.bookmarksController.modifyBookmark(bmid,bmtitle,bmurl);
+ }
if (errCode == -3){
alert("Bookmark Url Is Empty");
@@ -133,6 +185,6 @@
}
-function showBookmarkEditDialog(bmtitle,bmurl) {
- launchBookmarkDialog(bmtitle,bmurl,1);
+function showBookmarkEditDialog(bmtitle,bmurl,id) {
+ launchBookmarkDialog(bmtitle,bmurl,id,1);
}
--- a/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkview.css Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkview.css Mon Oct 04 00:04:54 2010 +0300
@@ -4,37 +4,49 @@
height:100%;
background-color: #889cbf;
}
-/*
-.bookmarkList li.ui-state-highlight {
- border: 4px dotted #999;
- background-image:url(icons/cc0d0d-hatch.png);
- background-repeat: repeat;
- }
-*/
#BottomPad {
padding: 8px 10px 8px 10px;
height: 54px;
}
-.bookmarkList li.highlight{
+.bookmarkList li.selected {
background-image: url(icons/list_itembg_pressed.png);
font-weight: bold;
}
-.bookmarkList div.controlInSort {
+/* DogEar open, unselected */
+.bookmarkList .dogEar {
+ height: 70px;
+ background-repeat: no-repeat;
+ float: left;
+ background-image: url(icons/dogear_open.png);
+ width: 67px;
+}
+
+/* DogEarBox open, unselected */
+.bookmarkList .dogEarBox {
height: 70px;
background-repeat: repeat-x;
- width: 51px;
- background-image: url(icons/dogear_open_bg_pressed.png);
+ background-image: url(icons/dogear_open_bg.png);
float:right;
z-index:30;
}
-.bookmarkList div.collapsedSort {
+
+.bookmarkList .dogEar.selected {
background-image: url(icons/dogear_pressed.png);
- background-repeat: no-repeat;
- float: left;
- height: 70px;
+}
+
+.bookmarkList .dogEarBox.selected {
+ background-image: url(icons/dogear_open_bg_pressed.png);
+}
+
+.bookmarkList .dogEar.closed {
+ background-image: url(icons/dogear.png);
+ width: 51px;
+}
+
+.bookmarkList .dogEarBox.closed {
width: 51px;
}
@@ -54,40 +66,8 @@
-webkit-user-select: none;
}
-.bookmarkList div.controlIn {
- height: 70px;
- background-repeat: repeat-x;
- width: 51px;
- background-image: url(icons/dogear_open_bg.png);
- float:right;
- z-index:30;
-}
-.bookmarkList div.collapsed {
- background-image: url(icons/dogear.png);
- background-repeat: no-repeat;
- float: left;
- height: 70px;
- width: 51px;
-}
-.bookmarkList div.controlOut {
- height: 70px;
- background-image: url(icons/dogear_open_bg.png);
- background-repeat: repeat-x;
- float:right;
- z-index:31;
-}
-
-.bookmarkList div.expanded {
- background-image: url(icons/dogear_open.png);
- background-repeat: no-repeat;
- float: left;
- height: 70px;
- width: 67px;
-}
-
-
-div.Title {
+div.bookmarkItem {
color: #000;
margin-top: 15px;
float:left;
@@ -100,18 +80,10 @@
text-overflow: ellipsis;
}
-.bookmarkList div.Title:active {
+.bookmarkList div.bookmarkItem:active {
font-weight: bold;
}
-/*
-img.FavIcon {
- padding-top: 15px;
- padding-right: 10px;
- padding-bottom: 10px;
- padding-left: 10px;
-}
-*/
span.aTitle{
font-size: 20px;
}
--- a/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkview.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/bookmarkview.superpage/bookmarkview.js Mon Oct 04 00:04:54 2010 +0300
@@ -1,42 +1,47 @@
var __prevOpenedBookmarkControl = null;
var __previousSortEle = null;
var __bookmarkCount= 0;
-var __bookmarkEditElement= null;
var __dragendFlag = false;
+var __dogearSelected = false;
+var __timerValueLeft = 0;
+var __timerId = "";
+var __longPressEvent = false;
// Set to the LongPress object that is currently waiting for activation,
// ie. it has gotten a mouse-down event and has its timer running.
var __currentLongPress;
var __cancelLinkOpening = false;
function _enableSorting(ele) {
-
- ele.className = 'sort';
+ // This is messy, why do we even need to do this sort/no-sort stuff???
+ $(ele).removeClass('no-sort');
+ $(ele).addClass('sort');
- var evt = document.createEvent("MouseEvents");
- evt.initMouseEvent("mousedown", true, true, window,
- 0, 0, 0, gInitialX, gInitialY, false, false, false, false, 0, null);
- var canceled = !ele.dispatchEvent(evt);
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("mousedown", true, true, window,
+ 0, 0, 0, gInitialX, gInitialY, false, false, false, false, 0, null);
+ var canceled = !ele.dispatchEvent(evt);
views.WebView.gesturesEnabled = false;
- ele.childNodes[0].className = 'controlInSort';
- ele.childNodes[0].childNodes[0].className = 'collapsedSort';
+ $(ele).find(".dogEarBox").addClass('selected');
+ $(ele).find(".dogEar").addClass('selected');
__sortingEnabled = true;
__sortEleOffsetTop = ele.offsetTop;
__previousSortEle = ele;
-
- ele.className = 'highlight';
+ $(ele).toggleClass('highlight');
}
function _disableSorting(ele) {
+// app.debug('disablesorting:'); printProp(ele);
views.WebView.gesturesEnabled = true;
- ele.className = 'no-sort';
- ele.childNodes[0].className = 'controlIn';
- ele.childNodes[0].childNodes[0].className = 'collapsed';
+ $(ele).removeClass('sort');
+ $(ele).addClass('no-sort');
+ $(ele).find('.dogEarBox').removeClass('selected').addClass('closed');
+ $(ele).find('.dogEar').removeClass('selected').addClass('closed');
__sortingEnabled = false;
__sortEleOffsetTop = 0;
@@ -55,18 +60,23 @@
__dragendFlag = true;
},
update: function(event, ui) {
- var sortedItemId = ui.item[0].id;
- var _a = $('#bookmarkListTree').sortable('toArray');
- for (var i=0; i<_a.length; i++)
- {
- if (sortedItemId == _a[i])
- {
- var li = document.getElementById(sortedItemId);
- _disableSorting(li);
-
- var div = li.childNodes[1];
- window.bookmarksManager.reorderBokmarks(div.childNodes[0].firstChild.nodeValue,i);
- }
+ var sortedBookmark = ui.item[0];
+ _disableSorting(sortedBookmark); // Unselect it
+ // If there's only one bookmark in the list, do nothing
+ if ($('#bookmarkListTree').children().length == 0)
+ return;
+ var nextBookmark = $(sortedBookmark).next()[0];
+ var bm = window.bookmarksController.findBookmark(sortedBookmark.id);
+ // If it wasn't moved to the end, change the sortIndex to the next bookmark's sortIndex and the rest will propagate down
+ if (nextBookmark) {
+ var nextbm = window.bookmarksController.findBookmark(nextBookmark.id);
+ window.bookmarksController.reorderBookmark(sortedBookmark.id, nextbm.sortIndex);
+ }
+ // It was moved to the end, so change the sortIndex to the prev bookmark's sortIndex + 1
+ else {
+ var prevBookmark = $(sortedBookmark).prev()[0];
+ var prevbm = window.bookmarksController.findBookmark(prevBookmark.id);
+ window.bookmarksController.reorderBookmark(sortedBookmark.id, prevbm.sortIndex+1);
}
}
});
@@ -77,6 +87,12 @@
function _longPress(ele)
{
+ __longPressEvent = true;
+ if(__timerId != "")
+ {
+ window.clearTimeout(__timerId);
+ __timerId = "";
+ }
if (__sortingEnabled)
{
_disableSorting(__previousSortEle)
@@ -86,11 +102,26 @@
if(__prevOpenedBookmarkControl)
_bookmarkHideControl(__prevOpenedBookmarkControl);
- _enableSorting(ele);
+ if(!__dogearSelected)
+ _enableSorting(ele);
}
+function _timeLeft()
+{
+ __timerValueLeft = 1;
+}
function _longPressStarted(lp)
{
+ __timerValueLeft = 0;
+ __longPressEvent = false;
+ if(!window.views.WebView.bedrockTiledBackingStoreEnabled())
+ {
+ __timerId = window.setTimeout("_timeLeft()",250);
+ }
+ else
+ {
+ __timerId = window.setTimeout("_timeLeft()",550);
+ }
// Remember the current LongPress object so we can cancel it if scrolling
// starts.
__currentLongPress = lp;
@@ -110,34 +141,47 @@
function _bookmarkHideControl(ele){
- ele.childNodes[0].className = 'controlIn';
- ele.childNodes[0].childNodes[0].className = 'collapsed';
- ele.childNodes[1].style.width = (parseInt(window.innerWidth)-70)+"px";
+ $(ele).find('.dogEarBox').addClass('closed');
+ $(ele).find('.dogEar').addClass('closed');
+ $(ele).find('.bookmarkItem').css('width', (parseInt(window.innerWidth)-70)+"px");
}
-function _bookmarkToggleControls(ele){
+function _bookmarkToggleControls(event){
+ var ele = event.target;
try {
+ if(__timerId != "")
+ {
+ window.clearTimeout(__timerId);
+ __timerId = "";
+ }
+ if (__sortingEnabled && ele.parentNode.parentNode!=__previousSortEle)
+ {
+ _disableSorting(__previousSortEle)
+ return false;
+ }
+ else if (__sortingEnabled && (ele.parentNode.parentNode==__previousSortEle))
+ {
+ return false;
+ }
+ if(__timerValueLeft == 1 || __longPressEvent == true)
+ {
+ __timerValueLeft = 0;
+ __longPressEvent = false;
+ return false;
+ }
+ __timerValueLeft = 0;
- if (__sortingEnabled && ele.parentNode.parentNode!=__previousSortEle)
- {
- _disableSorting(__previousSortEle)
- return false;
- }
- else if (__sortingEnabled && (ele.parentNode.parentNode==__previousSortEle))
- {
- return false;
- }
-
- ele.parentNode.className = (ele.parentNode.className == 'controlIn') ? 'controlOut' : 'controlIn';
- if (ele.parentNode.className == 'controlIn') {
- ele.className = 'collapsed';
- ele.parentNode.parentNode.childNodes[1].style.width = (parseInt(window.innerWidth)-70)+"px";
- }
- else {
- ele.className = 'expanded';
- ele.parentNode.parentNode.childNodes[1].style.width = (parseInt(window.innerWidth)-220)+"px";
- }
-
+ var li = $(ele).parents('li');
+ var dogEarBox = li.find('.dogEarBox');
+ dogEarBox.toggleClass('closed');
+ dogEarBox.find('.dogEar').toggleClass('closed');
+ // It's too bad we can't do this via margin-right because then we could just do it in the .css file coz it would be a static value
+ if (dogEarBox.hasClass('closed')) {
+ li.find('.bookmarkItem').css('width', (parseInt(window.innerWidth)-70)+"px");
+ }
+ else {
+ li.find('.bookmarkItem').css('width', (parseInt(window.innerWidth)-220)+"px");
+ }
if (__prevOpenedBookmarkControl != null && __prevOpenedBookmarkControl != ele.parentNode.parentNode)
_bookmarkHideControl(__prevOpenedBookmarkControl);
@@ -146,25 +190,20 @@
__prevOpenedBookmarkControl = ele.parentNode.parentNode;
}
-function _addNewBookmark(bmtitle,bmurl)
+function _addNewBookmark(bmtitle,bmurl,bmid)
{
- if(__prevOpenedBookmarkControl)
+ // bookmark title/url may have been altered by the controller's add method (i.e. to include http://) so reload it
+ var bm = window.bookmarksController.findBookmark(bmid);
+ bmtitle = bm.title;
+ bmurl = bm.url;
+ if(__timerId != "")
+ {
+ window.clearTimeout(__timerId);
+ __timerId = "";
+ }
+ if(__prevOpenedBookmarkControl)
_bookmarkHideControl(__prevOpenedBookmarkControl);
- var ul=document.getElementById('bookmarkListTree');
- for (x=0; x< ul.childNodes.length; x++)
- {
- var li_element= ul.childNodes[x];
- var bm_title= li_element.childNodes[1].childNodes[0].innerText;
-
- if(bmtitle.toLowerCase() == bm_title.toLowerCase())
- {
- ul.removeChild(li_element);
- break;
- }
-
- }
-
if(__previousSortEle != null)
_disableSorting(__previousSortEle)
@@ -172,11 +211,11 @@
//create element and add it to bookmark view
var ul=document.getElementById('bookmarkListTree');
var dbgTitle = bmtitle.replace(/'/g, "'");
- dbgTitle = dbgTitle.replace(/"/g, """);
- var li = _createBookmarkElement(dbgTitle,bmurl,__bookmarkCount);
- li.className = 'no-sort';
- ul.insertBefore(li, ul.childNodes[0]);
- ul.childNodes[0].focus();
+ dbgTitle = dbgTitle.replace(/"/g, """);
+ var li = _createBookmarkElement(dbgTitle,bmurl,bmid);
+ $(li).addClass('no-sort');
+ ul.insertBefore(li, ul.firstChild);
+ ul.childNodes[ul.childNodes.length-1].focus();
if (!window.views.WebView.bedrockTiledBackingStoreEnabled())
new LongPress(li.id, _longPress, _longPressStarted, 250);
@@ -187,88 +226,84 @@
scrollTop: 0}, 1000);
}
-function _editBookmark(bmtitle,bmurl)
+function _editBookmark(bmtitle,bmurl,bmid)
{
- if(__prevOpenedBookmarkControl)
- _bookmarkHideControl(__prevOpenedBookmarkControl);
+ if(__prevOpenedBookmarkControl)
+ _bookmarkHideControl(__prevOpenedBookmarkControl);
- var ul=document.getElementById('bookmarkListTree');
- for (x=0; x< ul.childNodes.length; x++)
- {
- var li_element= ul.childNodes[x];
- var bm_title= li_element.childNodes[1].childNodes[0].innerText;
-
- if(bmtitle.toLowerCase() == bm_title.toLowerCase() &&
- __bookmarkEditElement.childNodes[1].childNodes[0].innerText.toLowerCase() != bmtitle.toLowerCase())
- {
- ul.removeChild(li_element);
- break;
- }
-
- }
- __bookmarkEditElement.childNodes[1].childNodes[0].innerText = bmtitle;
- __bookmarkEditElement.childNodes[1].childNodes[2].innerText = bmurl;
+ // bookmark title/url may have been altered by the controller's edit method (i.e. to include http://) so reload it
+ var bm = window.bookmarksController.findBookmark(bmid);
+
+ $('#'+bmid).find('.aTitle').text(bm.title);
+ $('#'+bmid).find('.aUrl').text(bm.url);
}
-function _launchEditBookmark(r,bmtitle,bmurl)
+function _launchEditBookmark(r,bmtitle,bmurl,id)
{
- __bookmarkEditElement = r.parentNode.parentNode;
- window.bookmarksManager.launchEditBookmark(bmtitle,bmurl);
+ // bookmark title/url may have been altered by the controller's edit method, so reload it
+ var bm = window.bookmarksController.findBookmark(id);
+ window.bookmarksController.showBookmarkEditDialog(bm.title,bm.url,id);
}
-function _deleteBookmark(r,bmtitle)
+function _deleteBookmark(r,bmid)
{
- window.bookmarksManager.deleteBookmark(bmtitle);
- //ToDo : check for error code
- r.parentNode.parentNode.parentNode.removeChild(r.parentNode.parentNode);
-
+ window.bookmarksController.deleteBookmark(bmid);
+ $('#'+bmid).remove();
}
-function _openUrl(ele, newUrl) {
- // DragStart & DragEnd listeners are defined at bottom
- if (__sortingEnabled && (ele.parentNode!=__previousSortEle))
+function _openUrl(ele, bmid) {
+ if(__timerId != "")
+ {
+ window.clearTimeout(__timerId);
+ __timerId = "";
+ }
+ // DragStart & DragEnd listeners are defined at bottom
+ if (__sortingEnabled && (ele.parentNode!=__previousSortEle))
+ {
+ _disableSorting(__previousSortEle)
+ return false;
+ }
+ else if (__sortingEnabled && (ele.parentNode==__previousSortEle))
{
- _disableSorting(__previousSortEle)
return false;
}
- else if (__sortingEnabled && (ele.parentNode==__previousSortEle))
- {
- return false;
- }
- else if (__dragendFlag)
- {
- __dragendFlag = false;
- return false;
- }
- else if(__cancelLinkOpening)
- {
- __cancelLinkOpening = false;
- return false;
- }
+ else if (__dragendFlag)
+ {
+ __dragendFlag = false;
+ return false;
+ }
+ else if(__cancelLinkOpening)
+ {
+ __cancelLinkOpening = false;
+ return false;
+ }
window.views.WebView.showNormalPage();
window.ViewStack.switchView( "WebView","BookmarkTreeView");
- // Laod a page to chrome view
- window.views.WebView.loadUrlToCurrentPage(newUrl);
- views.WebView.gesturesEnabled = true;
+ // Laod a page to chrome view
+ // bookmark title/url may have been altered by the controller's edit method, so reload it
+ var bm = window.bookmarksController.findBookmark(bmid);
+ window.views.WebView.loadUrlToCurrentPage(bm.url);
+ views.WebView.gesturesEnabled = true;
}
function _updateBookmarkViewGoemetry(displayMode)
{
- try{
- var _list = document.getElementsByClassName('Title');
- for (var i=0; i<_list.length; i++){
- if (_list[i].parentNode.childNodes[0].className == 'controlIn'){
- _list[i].style.width = (parseInt(window.innerWidth)-70)+"px";
- }
- else{
- _list[i].style.width = (parseInt(window.innerWidth)-220)+"px";
- }
- }
- }catch(e){ alert(e); }
+ // It's too bad we couldn't use margin-right instead of width coz then we could just put a static value in the .css file and not even need to do anything
+ $('.dogEarBox.closed').next('.bookmarkItem').css('width', (parseInt(window.innerWidth)-70)+"px");
+ $('.dogEarBox').not('.closed').next('.bookmarkItem').css('width', (parseInt(window.innerWidth)-220)+"px");
+}
+function _setDogear()
+{
+ __dogearSelected = true;
+}
+
+function _unsetDogear()
+{
+ __dogearSelected = false;
}
function _createBookmarkElement(bmtitle,bmfullurl,idValue)
@@ -278,19 +313,26 @@
var li=document.createElement('li');
li.id = idValue;
li.innerHTML =
- '<div class="controlIn">'+
- '<div class="collapsed" onClick="javascript:_bookmarkToggleControls(this);"></div>'+
- '<img src="icons/edit_btn.png" width="56" height="56" vspace="7" hspace="5" '+
- 'onclick="_launchEditBookmark(this,this.parentNode.parentNode.childNodes[1].childNodes[0].innerText,'+
- 'this.parentNode.parentNode.childNodes[1].childNodes[2].innerText)">'+
- '<img src="icons/delete_btn.png" width="56" height="56" vspace="7" hspace="5" '+
- 'onclick="_deleteBookmark(this, \''+escapedTitle+'\')">'+
+ '<div class="dogEarBox closed">'+ // bookmarkBox
+ '<div class="dogEar closed"></div>'+
+ '<img class="bookmarkEditBtn" src="icons/edit_btn.png" width="56" height="56" vspace="7" hspace="5">'+
+ '<img class="bookmarkDeleteBtn" src="icons/delete_btn.png" width="56" height="56" vspace="7" hspace="5" >'+
'</div>'+
- '<div class="Title" style="width:'+_width+'px;" onclick="_openUrl(this,this.childNodes[2].innerText);">'+
- '<span class="aTitle">'+bmtitle+'</span>'+
- '<br/>'+
- '<span class="aUrl">'+bmfullurl+'</span>'+
+ '<div class="bookmarkItem" style="width:'+_width+'px;">'+
+ '<span class="aTitle">'+bmtitle+'</span>'+
+ '<br/>'+
+ '<span class="aUrl">'+bmfullurl+'</span>'+
'</div>';
+ $(li).find(".dogEar")
+ .click(_bookmarkToggleControls)
+ .mouseover(_setDogear)
+ .mouseout(_unsetDogear);
+ $(li).find(".bookmarkItem").
+ click(function (event) {_openUrl(event.target, idValue);});
+ $(li).find(".bookmarkEditBtn").
+ click(function (event) {_launchEditBookmark(event.target, bmtitle, bmfullurl, idValue);});
+ $(li).find(".bookmarkDeleteBtn").
+ click(function (event) {_deleteBookmark(event.target, idValue);});
return li;
}
@@ -301,17 +343,18 @@
{
__currentLongPress = undefined;
//Get bookmarks data from database
- var bookmakrData = window.bookmarksManager.getBookmarksJSON();
- var myObject = eval('(' + bookmakrData + ')');
+ window.bookmarksController.findAllBookmarks();
var ul=document.getElementById('bookmarkListTree');
- for (x=0; x<myObject.length; x++)
+ while (window.bookmarksController.hasMoreBookmarks())
{
- var bmurl = myObject[x].urlvalue;
- var bmtitle = myObject[x].title;
+ var bm = window.bookmarksController.nextBookmark();
+ var bmurl = bm.url;
+ var bmtitle = bm.title;
+ var id = bm.id;
//create element and add it to bookmark view
- var li = _createBookmarkElement(bmtitle,bmurl, x);
- li.className = 'no-sort';
+ var li = _createBookmarkElement(bmtitle,bmurl,id);
+ $(li).addClass('no-sort');
ul.appendChild(li);
ul.childNodes[0].focus();
if (!window.views.WebView.bedrockTiledBackingStoreEnabled())
@@ -319,7 +362,7 @@
else
new LongPress(li.id, _longPress, _longPressStarted, 550);
- __bookmarkCount = x;
+ __bookmarkCount++;
}
} catch(E) { alert(E); }
@@ -330,8 +373,8 @@
{
try{
window.chrome.aspectChanged.connect(_updateBookmarkViewGoemetry);
- window.bookmarksManager.bookmarkEntryAdded.connect(_addNewBookmark);
- window.bookmarksManager.bookmarkEntryModified.connect(_editBookmark);
+ window.bookmarksController.bookmarkAdded.connect(_addNewBookmark);
+ window.bookmarksController.bookmarkModified.connect(_editBookmark);
// Get Bookmarks from the database
_createBookmarkView();
Binary file ginebra2/chrome/bedrockchrome/bookmarkview.superpage/icons/dialog_center.png has changed
--- a/ginebra2/chrome/bedrockchrome/chrome.css Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/chrome.css Mon Oct 04 00:04:54 2010 +0300
@@ -15,9 +15,14 @@
height: 26px;
}
-#UrlSearchChromeId {
-// height: 34px;
+#UrlSearchChromeId, #TitleUrlId {
height: 44px;
+ padding-top: 5px;
+ border-top-width: 0px;
+ border-top-color: #646f85;
+ color:black;
+ background-color: white;
+ border-bottom-color: #b0c4de;
}
/*
--- a/ginebra2/chrome/bedrockchrome/chrome.html Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/chrome.html Mon Oct 04 00:04:54 2010 +0300
@@ -48,18 +48,13 @@
<!-- Native UrlSearch -->
- <div class="GinebraSnippet"
- id="UrlSearchChromeId"
- name="urlsearch"
- style="padding-top: 5px; border-top-width: 0px; border-top-color: #646f85; color:black; background-color: white; border-bottom-color: #b0c4de"
- data-GinebraNativeClass="UrlSearchSnippet"
- data-GinebraVisible="true">
+
+ <div class="GinebraSnippet" id="UrlSearchChromeId" name="urlsearch" data-GinebraNativeClass="UrlSearchSnippet" data-GinebraVisible="true">
</div>
-
<div class = "GinebraSnippet" id="NetworkStatusChromeId" name="networkstatus"
data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter"
- style="width: 310px; height: 200px">
+ style="width: 310px; height: 230px">
<script type="text/javascript">
var networkstatus = new NetworkStatusDialog();
</script>
--- a/ginebra2/chrome/bedrockchrome/chrome.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/chrome.js Mon Oct 04 00:04:54 2010 +0300
@@ -31,9 +31,10 @@
window.views.WebView.createSuperPage(pageName, true);
window.views.WebView[pageName].load(chrome.baseDirectory + path);
}
-
- if (!window.views.WebView.bedrockTiledBackingStoreEnabled())
- window.views.WebView.zoomFactor = 1.0;
+ if (!window.views.WebView.bedrockTiledBackingStoreEnabled()){
+ window.views.WebView.setSavedZoomValueInView(window.views.WebView.zoomFactor);
+ window.views.WebView.zoomFactor = 1.0;
+ }
//window.views.WebView.showSuperPage(pageName);
window.ViewStack.switchView(pageName, "WebView");
if (!window.views.WebView.bedrockTiledBackingStoreEnabled())
@@ -65,7 +66,7 @@
}
function chrome_addBookmark() {
- launchBookmarkDialog(window.pageController.currentDocTitle,window.pageController.currentDocUrl,0);
+ launchBookmarkDialog(window.pageController.currentDocTitle,window.pageController.currentDocUrl,-1,0);
}
function chrome_cancelMenu() {
@@ -91,7 +92,7 @@
}
function onActivateBookmarkView() {
- window.bookmarksManager.launchBookmarkEditDailog.connect(showBookmarkEditDialog);
+ window.bookmarksController.launchBookmarkEditDailog.connect(showBookmarkEditDialog);
}
function preLoad()
{
@@ -118,7 +119,12 @@
function onPopupShown(id) {
if(chrome_popupShownCount == 0) {
// Disable snippets etc. that should be greyed-out while the popup is shown.
- snippets.UrlSearchChromeId.enabled = false;
+ if (app.layoutType() == "tenone") {
+ snippets.TitleUrlId.enabled = false;
+ }
+ else {
+ snippets.UrlSearchChromeId.enabled = false;
+ }
views.WebView.enabled = false;
views.WebView.freeze();
@@ -138,7 +144,12 @@
chrome_popupShownCount--;
if(chrome_popupShownCount == 0) {
// Re-enable snippets etc. that were greyed-out while popups were being shown.
- snippets.UrlSearchChromeId.enabled = true;
+ if (app.layoutType() == "tenone") {
+ snippets.TitleUrlId.enabled = true;
+ }
+ else {
+ snippets.UrlSearchChromeId.enabled = true;
+ }
views.WebView.enabled = true;
views.WebView.unfreeze();
}
@@ -156,10 +167,16 @@
if (app.ui() == "orbit_ui") {
snippets.StatusBarChromeId.hide();
}
+ if (app.layoutType() == "tenone") {
+ window.snippets.TitleUrlId.anchorToView("top");
+
+ }
+ else {
+ window.snippets.UrlSearchChromeId.anchorToView("top");
+ }
window.snippets.WebViewToolbarId.menuButtonSelected.connect(chrome_showBasicMenu);
window.snippets.BookmarkViewToolbarId.addBookmarkSelected.connect(chrome_addBookmark);
- window.snippets.UrlSearchChromeId.anchorToView("top");
window.snippets.WebViewToolbarId.menuButtonCanceled.connect(chrome_cancelMenu);
//window.snippets.ButtonContainer.setVisibilityAnimator("G_VISIBILITY_FADE_ANIMATOR");
@@ -178,8 +195,8 @@
chrome.popupHidden.connect(onPopupHidden);
window.pageController.loadFinished.connect(_updateHistory);
window.pageController.loadFinishedForBackgroundWindow.connect(_updateHistory);
- window.bookmarksManager.bookmarksCleared.connect(_updateBookmarks);
- window.bookmarksManager.historyCleared.connect(_updateHistory);
+ window.bookmarksController.bookmarksCleared.connect(_updateBookmarks);
+ window.historyManager.historyCleared.connect(_updateHistory);
}
// For debugging: prints all properties and functions attached to a given object.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/chrome/bedrockchrome/chrome_tenone.html Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,214 @@
+<html>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="chrome.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="zoombar.snippet/zoombar.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="download.snippet/download.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="contextmenu.snippet/ContextMenu.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="bookmarkview.superpage/bookmarkDialog.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="historyview.superpage/clearhistorydialog.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="networkstatus.snippet/networkstatus.css">
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="outofmemory.snippet/outofmemorydialog.css"/>
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="prompt.snippet/prompt.css">
+
+<head>
+ <script src="../js/Bind.js" type="text/javascript"></script>
+ <script src="../js/SimpleButton.js" type="text/javascript"></script>
+ <script src="statusbar.snippet/statusbar.js" type="text/javascript"></script>
+ <script src="networkstatus.snippet/networkstatus.js" type="text/javascript"></script>
+ <script src="prompt.snippet/prompt.js" type="text/javascript"></script>
+ <script src="zoombar.snippet/zoombar.js" type="text/javascript"></script>
+ <script src="download.snippet/download.js" type="text/javascript"></script>
+ <script src="bookmarkview.superpage/bookmarkDialog.js" type="text/javascript"></script>
+ <script src="historyview.superpage/clearhistorydialog.js" type="text/javascript"></script>
+ <script src="chrome.js" type="text/javascript"></script>
+ <script src="contextmenu.snippet/ContextMenu.js" type="text/javascript"></script>
+ <script src="contextmenu.snippet/ViewContextMenu.js" type="text/javascript"></script>
+ <script src="outofmemory.snippet/outofmemorydialog.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ window.chrome.chromeComplete.connect(onChromeComplete);
+ </script>
+</head>
+
+
+<body leftmargin="0" topmargin="0">
+
+ <div class = "GinebraSnippet" id="StatusBarChromeId" name="statusbar" data-GinebraAnchor="AnchorTop" data-GinebraVisible="false">
+ <link rel="stylesheet" id="CSSLink" type="text/css" href="statusbar.snippet/statusbar.css"/>
+ <script type="text/javascript">
+ var statusbar = new StatusBar();
+ </script>
+ </div>
+
+
+ <!-- Native UrlSearch -->
+
+<div class="GinebraSnippet" id="TitleUrlId" name="titleurl" data-GinebraVisible="true" data-GinebraHidesContent="false" data-GinebraNativeClass="TitleUrlContainerSnippet">
+</div>
+
+
+ <div class = "GinebraSnippet" id="NetworkStatusChromeId" name="networkstatus"
+ data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter"
+ style="width: 310px; height: 230px">
+ <script type="text/javascript">
+ var networkstatus = new NetworkStatusDialog();
+ </script>
+ </div>
+
+ <div class = "GinebraSnippet" id="PromptChromeId" name="prompt"
+ data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter"
+ style="width: 310px; height: 200px">
+ <script type="text/javascript">
+ var prompts = new promptDialog();
+ </script>
+ </div>
+
+ <!-- Most Visited Pages-->
+ <div class = "GinebraSnippet" id="MostVisitedViewId" data-GinebraVisible="false" data-GinebraHidesContent="true" data-GinebraNativeClass="MostVisitedPagesWidget" data-GinebraItemLinkedTo="MostVisitedButtonSnippet" style="width:1%; height:1px; color:red; opacity:0.5">
+ </div>
+
+ <!-- Overlay semi-transparent background over the screen to white-wash it. -->
+ <!-- The top can be anchored to the URL search bar or the status bar as needed. -->
+ <!--div class = "GinebraSnippet" id="ShadingOverlayId" data-GinebraAnchor="AnchorBottom AnchorLeft AnchorRight" data-GinebraHidesContent="true" data-GinebraVisible="false">
+ </div-->
+
+ <!-- URL Suggestions page snippet (search, bookmarks, and history) -->
+ <div class = "GinebraSnippet"
+ id="SuggestsChromeId"
+ name="pagesnippet"
+ style="width:320; height: 200px;"
+ data-GinebraNativeClass="PageSnippet"
+ data-GinebraHidesContent="true"
+ data-GinebraVisible="false">
+ </div>
+
+ <div class = "GinebraSnippet" id="ZoomBarId"
+ data-GinebraItemType="popup"
+ data-GinebraVisible="false"
+ data-GinebraHidesContent="true"
+ data-GinebraItemLinkedTo="ZoomButtonSnippet"
+ data-GinebraPopupModal="false">
+ <script type="text/javascript">
+ var zoombar = new ZoomBar();
+ </script>
+ </div>
+
+ <!-- ContextMenu -->
+ <div style="height: 1000px;">
+ <div class = "GinebraSnippet ContextMenu"
+ id="ContextMenuId"
+ data-GinebraItemType="popup"
+ data-GinebraHidesContent="true"
+ data-GinebraVisible="false"
+ data-GinebraItemLinkedTo="MenuButtonSnippet"
+ style="width:320;">
+ <script type="text/javascript">
+ new ContextMenu("ContextMenuId");
+ </script>
+ </div>
+ </div>
+
+
+<!-- Native Window View Toolbar -->
+ <div class="GinebraSnippet" id="WindowViewToolbarId" data-GinebraVisible="false" data-GinebraHidesContent="true" data-GinebraAnchor="AnchorBottom" data-GinebraNativeClass="WindowToolbar" >
+
+ <div class = "GinebraSnippet ButtonSnippet" id="WinBackButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton">
+ </div>
+
+ <div class = "GinebraSnippet ButtonSnippet" id="WinAddWindow" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+<!-- Native Bookmarks Toolbar -->
+ <div class="GinebraSnippet" id="BookmarkViewToolbarId" data-GinebraVisible="false" data-GinebraHidesContent="true" data-GinebraAnchor="AnchorBottom" data-GinebraNativeClass="BookmarksToolbar" >
+
+ <div class = "GinebraSnippet ButtonSnippet" id="BookmarksBackButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton">
+ </div>
+
+ <div class = "GinebraSnippet ButtonSnippet" id="BookmarksAddButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+<!-- Native Recent URL Toolbar -->
+ <div class="GinebraSnippet" id="RecentUrlViewToolbarId" data-GinebraVisible="false" data-GinebraHidesContent="true" data-GinebraAnchor="AnchorBottom" data-GinebraNativeClass="RecentUrlToolbar" >
+
+ <div class = "GinebraSnippet ButtonSnippet" id="RecentBackButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton">
+ </div>
+
+ <div class = "GinebraSnippet ButtonSnippet" id="RecentClearallButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+<!-- Settings View Toolbar -->
+ <div class="GinebraSnippet" id="SettingsViewToolbarId" data-GinebraVisible="false" data-GinebraHidesContent="true" data-GinebraAnchor="AnchorBottom" data-GinebraNativeClass="SettingsToolbar" >
+
+ <div class = "GinebraSnippet ButtonSnippet" id="SettingsBackButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton">
+ </div>
+
+ <div class = "GinebraSnippet ButtonSnippet" id="SettingsFeedbackButton" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+<!-- MAIN Toolbar -->
+ <div class="GinebraSnippet" id="WebViewToolbarId" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraAnchor="AnchorBottom" data-GinebraNativeClass="ContentToolbar" >
+
+ <div class = "GinebraSnippet ButtonSnippet" id="BackButtonSnippet" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton">
+ </div>
+
+ <div class="GinebraSnippet" id="ButtonContainer" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraContainer="true">
+
+
+ <div class="GinebraSnippet ButtonSnippet" id="MostVisitedButtonSnippet" data-GinebraVisible="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ <div class="GinebraSnippet ButtonSnippet" id="ZoomButtonSnippet" data-GinebraVisible="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ <div class="GinebraSnippet ButtonSnippet" id="MenuButtonSnippet" data-GinebraVisible="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+ <div class = "GinebraSnippet ButtonSnippet" id="ToggleTBButtonSnippet" data-GinebraVisible="true" data-GinebraHidesContent="true" data-GinebraNativeClass="ActionButton" >
+ </div>
+
+ </div>
+
+ <--Inline the bookmark dialog. Use the native text edit snippet for text input-->
+
+<div class="GinebraSnippet" id="ClearHistoryDialogId" data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter">
+ <script type="text/javascript">
+ addDialog = new clearHistoryDialog();
+ </script>
+ </div>
+
+
+ <div class="GinebraSnippet" id="BookmarkDialogId" data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter">
+ <script type="text/javascript">
+ addDialog = new bookmarkDialog();
+ </script>
+ </div>
+
+
+
+ <div class="GinebraSnippet" id="DownloadDialogId"
+ data-GinebraItemType="popup"
+ data-GinebraHidesContent="true"
+ data-GinebraVisible="false"
+ style="width:310px; height:87px">
+ <script type="text/javascript">
+ writeDownloadDialog();
+ </script>
+ </div>
+
+
+ <div class="GinebraSnippet" id="OutOfMemoryDialogId" data-GinebraItemType="popup" data-GinebraHidesContent="true" data-GinebraVisible="false" data-GinebraAnchor="AnchorCenter">
+ <script type="text/javascript">
+ addDialog = new outOfMemoryDialog();
+ </script>
+ </div>
+
+</body>
+</html>
--- a/ginebra2/chrome/bedrockchrome/contextmenu.snippet/ViewContextMenu.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/contextmenu.snippet/ViewContextMenu.js Mon Oct 04 00:04:54 2010 +0300
@@ -50,16 +50,22 @@
}
function viewMenu_getLinkItems(linkUrl) {
+ var matchFound = false;
+ var errorUrl= "javascript:"
+
+ if(linkUrl.substring(0,errorUrl.length) == errorUrl) {
+ matchFound=true;
+ }
const maxWindowCount = 5;
var items = new Array();
items =
[
{
- "text": window.localeDelegate.translateText("txt_browser_content_view_menu_link_open_link"), // "Open Link In New Window",
- "onclick": function() {
- pageController.LoadInNewWindow(linkUrl);
- },
- "disabled": (pageController.pageCount() >= maxWindowCount) ? "true" : "false",
+ "text": window.localeDelegate.translateText("txt_browser_content_view_menu_link_open_link"), // "Open Link In New Window",
+ "onclick": function() {
+ pageController.LoadInNewWindow(linkUrl);
+ },
+ "disabled": (pageController.pageCount() >= maxWindowCount || matchFound) ? "true" : "false",
},
]
;
@@ -101,6 +107,7 @@
function viewMenu_getPageMenuData(current) {
var popupsBlocked = pageController.getPopupSettings();
+ var tempUrl = pageController.currentDocUrl;
return {
"text": window.localeDelegate.translateText("txt_browser_content_view_menu_tab_page"), // "Page",
"iconHighlighted": "contextmenu.snippet/icons/page_selected.png",
@@ -111,7 +118,7 @@
{
"text": window.localeDelegate.translateText("txt_browser_content_view_menu_page_add_bookmark"), // "Add Bookmark",
"onclick": function() {
- launchBookmarkDialog(pageController.currentDocTitle, pageController.currentDocUrl,0);
+ launchBookmarkDialog(pageController.currentDocTitle, pageController.currentDocUrl,-1,0);
},
},
{
@@ -124,8 +131,8 @@
},
{
"text": window.localeDelegate.translateText("txt_browser_content_view_menu_page_share"), // "Share",
+ "disabled": tempUrl ? "false" : "true",
"onclick": function() {
- var tempUrl = pageController.currentDocUrl;
pageController.share(tempUrl);
},
},
--- a/ginebra2/chrome/bedrockchrome/historyview.superpage/clearhistorydialog.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/historyview.superpage/clearhistorydialog.js Mon Oct 04 00:04:54 2010 +0300
@@ -2,7 +2,7 @@
function clearHistoryDialog()
{
- window.bookmarksManager.confirmHistoryClear.connect(showClearHistoryDialog);
+ window.historyManager.confirmHistoryClear.connect(showClearHistoryDialog);
this.write = writeClearHistoryDialog;
// do setup
@@ -33,7 +33,7 @@
function clearAllHistoryDialog()
{
- window.bookmarksManager.clearHistory();
+ window.historyManager.clearHistory();
window.views.WebView.reload();
clearHistoryDialogIdHide();
}
--- a/ginebra2/chrome/bedrockchrome/historyview.superpage/historyview.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/historyview.superpage/historyview.js Mon Oct 04 00:04:54 2010 +0300
@@ -19,7 +19,7 @@
{
//clearHistoryList();
//Get historys data from database
- var folderNamesJSN = window.bookmarksManager.getHistoryFoldersJSON();
+ var folderNamesJSN = window.historyManager.getHistoryFoldersJSON();
var folderObjects = eval('(' + folderNamesJSN + ')');
var mainUL = document.createElement('ul');
@@ -45,7 +45,7 @@
mainLI.appendChild(aTag);
- var folderDataJSN = window.bookmarksManager.getHistoryFoldersJSON(folderObjects[i]);
+ var folderDataJSN = window.historyManager.getHistoryFoldersJSON(folderObjects[i]);
var folderDataObject = eval('(' + folderDataJSN + ')');
subUL.id = subUlId;
@@ -128,7 +128,7 @@
if (filderList.childNodes.length > 0 ) {
if (confirm("Are you sure you want to permanently delete your history?")){
- window.bookmarksManager.clearHistory();
+ window.historyManager.clearHistory();
window.views.WebView.reload();
}
}
--- a/ginebra2/chrome/bedrockchrome/networkstatus.snippet/networkstatus.css Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/networkstatus.snippet/networkstatus.css Mon Oct 04 00:04:54 2010 +0300
@@ -45,6 +45,10 @@
//border: solid 1px #f00;
}
+.networkErrorMessage {
+ vertical-align: middle;
+}
+
/* Second line of URL text, truncate the text and append an ellipsis. */
.networkStatusText2 {
vertical-align: middle;
--- a/ginebra2/chrome/bedrockchrome/networkstatus.snippet/networkstatus.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/networkstatus.snippet/networkstatus.js Mon Oct 04 00:04:54 2010 +0300
@@ -105,7 +105,7 @@
'<div class="networkStatusText2" id="networkStatusTextUrl2Id"></div>' +
'</li>' +
'<li>' +
- '<span class="networkStatusText" id="networkStatusTextMsgId"/>' +
+ '<p class="networkErrorMessage" id="networkStatusTextMsgId"/>' +
'</li>' +
'<li>' +
'<center><img id="networkStatus_okId" class="networkStatusOkButton"/></center>' +
--- a/ginebra2/chrome/bedrockchrome/prompt.snippet/prompt.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/prompt.snippet/prompt.js Mon Oct 04 00:04:54 2010 +0300
@@ -92,7 +92,7 @@
'<li>' +
'<img src="prompt.snippet/icons/icon_dialog_error.png"/> ' +
'<span class="promptText">' +
- window.localeDelegate.translateText("txt_browser_info_message") +
+ window.localeDelegate.translateText("txt_browser_error_database_quota") +
'</span>' +
'</li>' +
'<li id="promptTextUrlParent">' +
--- a/ginebra2/chrome/bedrockchrome/settingsview.superpage/settingsview.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/settingsview.superpage/settingsview.js Mon Oct 04 00:04:54 2010 +0300
@@ -254,7 +254,7 @@
if (field == "history") // History
{
- window.bookmarksManager.clearHistory();
+ window.historyManager.clearHistory();
var cs3 = document.getElementById("id3");
cs3.setAttribute("src", "icons/broom_sweep.gif");
setTimeout("initForms()", 2000);
@@ -267,7 +267,7 @@
if (field == "bookmarks") // Bookmarks
{
- window.bookmarksManager.clearBookmarks();
+ window.bookmarksController.clearAll();
var cs4 = document.getElementById("id4");
cs4.setAttribute("src", "icons/broom_sweep.gif");
setTimeout("initForms()", 2000);
@@ -291,11 +291,11 @@
function deleteData()
{
- window.pageController.deleteCache();
- window.pageController.deleteCookies();
- window.bookmarksManager.clearHistory();
- window.bookmarksManager.clearBookmarks();
- window.pageController.deleteDataFiles();
+ window.pageController.deleteCache();
+ window.pageController.deleteCookies();
+ window.historyManager.clearHistory();
+ window.bookmarksController.clearAll();
+ window.pageController.deleteDataFiles();
}
--- a/ginebra2/chrome/bedrockchrome/suggests.snippet/suggests.js Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/suggests.snippet/suggests.js Mon Oct 04 00:04:54 2010 +0300
@@ -13,7 +13,17 @@
var inputTimeoutDelay = _getTimeoutDelaySetting();
var maxHeight = 0; // maximum height of suggest list
var urlSearchHeight = 0;
+ var urlSnippetId;
+ var urlHasFoucus = false; // URL edit field focus flag
+ // Orbit UI has a different URL snippet.
+ if (app.layoutType() == "tenone") {
+ urlSnippetId = "TitleUrlId";
+ }
+ else {
+ urlSnippetId = "UrlSearchChromeId";
+ }
+
// "Private" methods
//! Calculates the maximum height for the suggest list.
@@ -23,12 +33,14 @@
{
// Calculate height of available space for suggest list.
var statusbarSz = snippets.StatusBarChromeId.getGeometry();
- var urlSearchSz = snippets.UrlSearchChromeId.getGeometry();
+ // The Orbit UI doesn't have a status bar.
+ var statusbarHeight = (app.ui() == "orbit_ui") ? 0 : statusbarSz.height;
+ var urlSearchSz = snippets[urlSnippetId].getGeometry();
var toolbarSz = snippets.WebViewToolbarId.getGeometry();
// leave some space between suggest and toolbar (~10% of display height)
var bufferHeight = Math.ceil(chrome.displaySize.height / 10);
var availableHeight = chrome.displaySize.height -
- (statusbarSz.height + urlSearchSz.height + toolbarSz.height + bufferHeight);
+ (statusbarHeight + urlSearchSz.height + toolbarSz.height + bufferHeight);
// Calculate number of elements that can fit in available space.
var elementHeight = 70; // set in suggests.css
var numElements = Math.floor(availableHeight / elementHeight);
@@ -55,15 +67,14 @@
function _showSuggests()
{
// make sure the input is the latest
- var input = window.snippets.UrlSearchChromeId.url;
+ var input = snippets[urlSnippetId].url;
// only display suggestions if there is input
if (input.length != 0) {
_updateSuggestList(input);
this.updateSuggestsSize();
- if (!snippets.SuggestsChromeId.visible
- && (pageController.loadState == Suggests.GotoModeEditing)) {
+ if (!snippets.SuggestsChromeId.visible && pageController.editMode) {
window.scrollTo(0, 0);
// Disable the content view, leave the URL serach bar and status bar enabled.
views.WebView.enabled = false;
@@ -86,7 +97,7 @@
var recenttitle = window.localeDelegate.translateText(
"txt_browser_chrome_suggests_search_for");
var snippetId = document.getElementById('SuggestsId');
- var suggests = window.pageController.fetchSuggestions(input);
+ var suggests = window.bookmarksController.suggestSimilar(input);
var suggestUL = document.createElement('ul');
var suggestLI = document.createElement('li');
var pattern = new RegExp(input, "ig");
@@ -105,8 +116,8 @@
// add each search suggestion to unordered list
for (i=0; i < suggests.length; i++) {
- recenturl = suggests[i].url;
- recenttitle = suggests[i].title;
+ recenturl = suggests[i].url1;
+ recenttitle = suggests[i].title1;
suggestLI = document.createElement('li');
suggestLI.id = "suggestsLiId";
@@ -114,7 +125,7 @@
recenttitle = recenttitle.replace(pattern, "<b>$&</b>");
recenturl = recenturl.replace(pattern, "<b>$&</b>");
- suggestLI.innerHTML = '<a href="#" onclick="searchSuggests.gotoUrl(\''+suggests[i].url+'\');' +
+ suggestLI.innerHTML = '<a href="#" onclick="searchSuggests.gotoUrl(\''+suggests[i].url1+'\');' +
' return false;">'+
'<div class="SuggestElement">'+
'<span class="aTitle">'+recenttitle+'</span><br/>'+
@@ -139,10 +150,10 @@
//! Handler for onload javascript event.
this.loadComplete = function()
{
- var urlSearchSz = snippets.UrlSearchChromeId.getGeometry();
+ var urlSearchSz = snippets[urlSnippetId].getGeometry();
urlSearchHeight = urlSearchSz.height;
- snippets.SuggestsChromeId.anchorTo("UrlSearchChromeId", suggestsXOffset, urlSearchHeight);
+ snippets.SuggestsChromeId.anchorTo(urlSnippetId, suggestsXOffset, urlSearchHeight);
snippets.SuggestsChromeId.zValue = 10;
_setMaxHeight(); // calculate max suggest list height
@@ -210,7 +221,10 @@
*/
this.handleExternalMouseEvent = function(type, name, description)
{
- if (name == "MouseClick") {
+ // external mouse event received on VKB mouse clicks and
+ // suggest list mouse clicks both of which should be ignored
+ if ((name == "MouseClick") && !urlHasFoucus
+ && !snippets.SuggestsChromeId.hasFocus) {
_hideSuggests();
}
}
@@ -230,20 +244,21 @@
//! the load state is editing.
this.updateLoadState = function()
{
- if (pageController.loadState != Suggests.GotoModeEditing) {
- // loading or reloadable - suggests not ok
+ if (!pageController.editMode) {
+ // not in editing mode - suggests not allowed
_hideSuggests(); // ensure suggests are hidden
}
}
- //! Called when URL search bar looses focus. The external mouse event
+ //! Called when URL search bar focus changes. The external mouse event
//! handler deals with most cases where the suggestion list should be
//! dismissed but we don't get those events when the list isn't visible
//! so this handler is needed to cancel the timer in those cases.
- this.urlSearchLostFocus = function()
+ this.urlSearchFocusChanged = function(focusIn)
{
+ urlHasFoucus = focusIn;
// if visible user may be scrolling suggestion page so ignore focus change
- if (!snippets.SuggestsChromeId.visible) {
+ if (!focusIn && !snippets.SuggestsChromeId.visible) {
// prevent suggestion list from being displayed until URL edited again
clearTimeout(inputTimeoutId);
}
@@ -259,5 +274,3 @@
}
}
-// we don't have access to WRT::LoadController::GotoModeEditing
-Suggests.GotoModeEditing = 1;
Binary file ginebra2/chrome/bedrockchrome/urlsearch.snippet/icons/URL_search_divider.png has changed
Binary file ginebra2/chrome/bedrockchrome/urlsearch.snippet/icons/backstep.png has changed
Binary file ginebra2/chrome/bedrockchrome/urlsearch.snippet/icons/backstep_pressed.png has changed
--- a/ginebra2/chrome/bedrockchrome/urlsearch.snippet/icons/com.svg Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/urlsearch.snippet/icons/com.svg Mon Oct 04 00:04:54 2010 +0300
@@ -1,90 +1,27 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="64px"
- height="64px"
- id="svg3606"
- version="1.1"
- inkscape:version="0.47 r22583"
- sodipodi:docname="New document 4">
- <defs
- id="defs3608">
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 32 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="64 : 32 : 1"
- inkscape:persp3d-origin="32 : 21.333333 : 1"
- id="perspective3614" />
- <inkscape:perspective
- id="perspective3600"
- inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
- inkscape:vp_z="1 : 0.5 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_x="0 : 0.5 : 1"
- sodipodi:type="inkscape:persp3d" />
- <inkscape:perspective
- id="perspective3635"
- inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
- inkscape:vp_z="1 : 0.5 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_x="0 : 0.5 : 1"
- sodipodi:type="inkscape:persp3d" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="5.5"
- inkscape:cx="32"
- inkscape:cy="47.305906"
- inkscape:current-layer="layer1"
- showgrid="true"
- inkscape:document-units="px"
- inkscape:grid-bbox="true"
- inkscape:window-width="1440"
- inkscape:window-height="825"
- inkscape:window-x="0"
- inkscape:window-y="24"
- inkscape:window-maximized="1" />
- <metadata
- id="metadata3611">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- id="layer1"
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- <text
- xml:space="preserve"
- style="font-size:25.76272964px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:OpenSymbol;-inkscape-font-specification:OpenSymbol Bold"
- x="2.772336"
- y="36.114693"
- id="text2816"
- transform="scale(0.89862512,1.1128111)"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan2818"
- x="2.772336"
- y="36.114693">.com</tspan></text>
- </g>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
+ <path fill="#FFFFFF" d="M4.153,40.188v-3.934H7.33v3.934H4.153z"/>
+ <path fill="#FFFFFF" d="M21.053,29.718l-3.131,0.7c-0.105-0.774-0.345-1.358-0.718-1.75c-0.373-0.392-0.857-0.588-1.453-0.588
+ c-0.791,0-1.422,0.338-1.894,1.015c-0.471,0.677-0.707,1.808-0.707,3.395c0,1.764,0.239,3.01,0.718,3.737
+ c0.479,0.729,1.121,1.092,1.927,1.092c0.603,0,1.096-0.212,1.481-0.637c0.384-0.424,0.655-1.154,0.813-2.19l3.12,0.657
+ c-0.324,1.773-0.946,3.113-1.865,4.018c-0.919,0.906-2.151,1.358-3.696,1.358c-1.756,0-3.156-0.687-4.2-2.058
+ c-1.044-1.372-1.565-3.271-1.565-5.698c0-2.454,0.523-4.365,1.571-5.732c1.047-1.367,2.464-2.051,4.25-2.051
+ c1.462,0,2.624,0.39,3.487,1.169C20.056,26.934,20.676,28.122,21.053,29.718z"/>
+ <path fill="#FFFFFF" d="M22.726,32.545c0-1.307,0.26-2.571,0.78-3.794c0.52-1.222,1.256-2.156,2.21-2.799
+ c0.953-0.644,2.018-0.966,3.193-0.966c1.816,0,3.305,0.73,4.466,2.191c1.16,1.461,1.74,3.306,1.74,5.537
+ c0,2.25-0.586,4.113-1.758,5.592s-2.647,2.219-4.426,2.219c-1.1,0-2.149-0.308-3.148-0.924c-0.999-0.616-1.758-1.519-2.278-2.709
+ C22.986,35.702,22.726,34.253,22.726,32.545z M25.981,32.755c0,1.475,0.283,2.604,0.848,3.387
+ c0.565,0.784,1.262,1.176,2.091,1.176s1.524-0.392,2.086-1.176c0.561-0.783,0.842-1.922,0.842-3.416
+ c0-1.456-0.281-2.576-0.842-3.359c-0.562-0.784-1.257-1.176-2.086-1.176s-1.526,0.392-2.091,1.176
+ C26.264,30.151,25.981,31.281,25.981,32.755z"/>
+ <path fill="#FFFFFF" d="M37.365,25.322h2.928v2.03c1.047-1.577,2.295-2.366,3.741-2.366c0.769,0,1.436,0.196,2.001,0.588
+ c0.564,0.392,1.029,0.984,1.391,1.777c0.527-0.793,1.096-1.386,1.707-1.777c0.609-0.392,1.262-0.588,1.955-0.588
+ c0.882,0,1.628,0.222,2.238,0.665c0.61,0.443,1.066,1.094,1.368,1.953c0.218,0.634,0.327,1.661,0.327,3.08v9.505h-3.176v-8.497
+ c0-1.475-0.109-2.426-0.328-2.856c-0.294-0.56-0.746-0.84-1.356-0.84c-0.444,0-0.862,0.168-1.255,0.504
+ c-0.392,0.336-0.674,0.829-0.848,1.477c-0.174,0.649-0.26,1.673-0.26,3.072v7.14h-3.177v-8.147c0-1.447-0.057-2.38-0.169-2.8
+ c-0.113-0.42-0.289-0.732-0.526-0.938c-0.237-0.205-0.56-0.308-0.966-0.308c-0.49,0-0.932,0.164-1.323,0.49
+ s-0.673,0.798-0.843,1.414c-0.169,0.616-0.254,1.638-0.254,3.066v7.223h-3.176V25.322z"/>
</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/data/backup_registration.xml Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+ <passive_backup>
+ <include_file name="browserContent.db"/>
+ </passive_backup>
+ <system_backup/>
+ <restore requires_reboot = "no"/>
+</backup_registration>
--- a/ginebra2/emulator/BrowserMainS60.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/emulator/BrowserMainS60.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -27,7 +27,7 @@
*/
// This function handles when an app calls QDesktopServices.openUrl when the browser is already started
-MCoeMessageObserver::TMessageResponse BrowserMainAppUiS60::HandleMessageL(TUint32 aClientHandleOfTargetWindowGroup, TUid aMessageUid, const TDesC8 &aMessageParameters)
+MCoeMessageObserver::TMessageResponse BrowserMainAppUiS60::HandleMessageL(TUint32 /*aClientHandleOfTargetWindowGroup*/, TUid /*aMessageUid*/, const TDesC8 &aMessageParameters)
{
QString url = QString::fromUtf8((const char *)aMessageParameters.Ptr(), aMessageParameters.Length());
//qDebug() << "BrowserMainAppUiS60::HandleMessageL " <<
@@ -56,7 +56,7 @@
// }
// These functions handle when an app calls QDesktopServices.openUrl when the browser isn't already started
-TBool BrowserMainAppUiS60::ProcessCommandParametersL(TApaCommand aCommand,TFileName& aFilename)
+TBool BrowserMainAppUiS60::ProcessCommandParametersL(TApaCommand /*aCommand*/,TFileName& aFilename)
{
//qDebug() << "BrowserMainAppUiS60:: ProcessCmdParms2 - " << aCommand << ", " << QString::fromUtf16(aFilename.Ptr(), aFilename.Length());
// ((RealBrowserApp *)QApplication::instance())->setInitialUrl(QString::fromUtf16(aFilename.Ptr(), aFilename.Length()));
@@ -64,7 +64,7 @@
return ETrue;
}
-TBool BrowserMainAppUiS60::ProcessCommandParametersL(TApaCommand aCommand,TFileName& aFilename, const TDesC8& aTail)
+TBool BrowserMainAppUiS60::ProcessCommandParametersL(TApaCommand /*aCommand*/,TFileName& aFilename, const TDesC8& /*aTail*/)
{
//qDebug()
// << "BrowserMainAppUiS60:: ProcessCmdParms3 - " << aCommand << ", "
--- a/ginebra2/emulator/FileService.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/emulator/FileService.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -19,8 +19,6 @@
*
*/
-#include <QDebug>
-
#include "FileService.h"
#include <xqserviceutil.h>
#include "webpagecontroller.h"
@@ -30,14 +28,12 @@
FileService::FileService(QObject* parent)
: XQServiceProvider(QLatin1String("NokiaBrowser.com.nokia.symbian.IFileView"), parent)
{
- qDebug("FileService::FileService");
publishAll();
}
FileService::~FileService()
{
- qDebug("FileService::~FileService");
}
@@ -45,11 +41,14 @@
// indicates the completion of the request.
void FileService::completeAsyncRequest(bool ok)
{
- qDebug() << "FileService::complete: ok=" << ok;
- // Complete all
- foreach (quint32 reqId, mAsyncReqIds) {
- qDebug("FileService::complete %d", reqId);
- completeRequest(reqId, QVariant(ok));
+ // completing all requests on current page load not technically correct but
+ // not required to service more than one request at a time
+ foreach (int reqId, mAsyncReqIds) {
+ if (!completeRequest(reqId, QVariant(ok))) {
+ // failed to complete request
+ RemoveAsyncReqId();
+ }
+ // else remove async request ID on returnValueDelivered() signal
}
// disconnect slots connected to WebPageController signals
@@ -61,17 +60,18 @@
bool FileService::view(QString file)
{
XQRequestInfo info = requestInfo();
- qDebug() << "FileService::view(" << file << ")";
if (!info.isSynchronous()) {
- qDebug() << "FileService::view: Asynchronous Request";
+ // not required to service more than one request at a time
+ // but just in case we use a map for request IDs
+ // request ID needed to complete request
mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
safe_connect(this, SIGNAL(returnValueDelivered()), this, SLOT(handleAnswerDelivered()));
safe_connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
safe_connect(WebPageController::getSingleton(), SIGNAL(loadFinished(bool)), this, SLOT(completeAsyncRequest(bool)));
}
- // Load specified file.
+ // Load specified file in current window.
file.prepend("file:///"); // create full URL from file path
WebPageController::getSingleton()->loadInitialUrlFromOtherApp(file);
@@ -79,16 +79,12 @@
}
-// Handles clientDisconnected signal emitted by base class, XQServiceProvider.
-// It's emitted if client accessing a service application terminates.
-void FileService::handleClientDisconnect()
+// Removes request from asynchronous IDs. This should be done after request
+// handled or on client disconnect.
+void FileService::RemoveAsyncReqId()
{
XQRequestInfo info = requestInfo();
- // Output some debug info.
- qDebug("FileService::handleClientDisconnect");
- qDebug("\tRequest info: id=%d,sid=%X,vid=%X", info.id(),info.clientSecureId(), info.clientVendorId());
-
// Remove request from asynchronous IDs.
mAsyncReqIds.remove(info.clientSecureId());
@@ -99,26 +95,20 @@
}
}
+// Handles clientDisconnected signal emitted by base class, XQServiceProvider.
+// It's emitted if client accessing a service application terminates.
+void FileService::handleClientDisconnect()
+{
+ RemoveAsyncReqId();
+}
+
// Handles returnValueDelivered signal emitted by base class, XQServiceProvider.
// It's emitted when asynchronous request has been completed and its return
// value has been delivered to the service client.
void FileService::handleAnswerDelivered()
{
- XQRequestInfo info = requestInfo();
-
- // Output some debug info.
- qDebug("FileService::handleAnswerDelivered");
- qDebug("\tRequest info: sid=%X,vid=%X", info.clientSecureId(), info.clientVendorId());
-
- // Done servicing request, remove it from asynchronous IDs.
- mAsyncReqIds.remove(info.clientSecureId());
-
- // Disconnect signal from this slot if no more asynchronous requests.
- if (!asyncAnswer()) {
- // Disconnect all signals from this object to slots in this object.
- disconnect(this, 0, this, 0);
- }
+ RemoveAsyncReqId();
}
--- a/ginebra2/emulator/FileService.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/emulator/FileService.h Mon Oct 04 00:04:54 2010 +0300
@@ -43,8 +43,9 @@
void completeAsyncRequest(bool ok);
private:
+ void RemoveAsyncReqId();
+
QMap<quint32,int> mAsyncReqIds;
- bool mRetValue;
};
--- a/ginebra2/emulator/browser.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/emulator/browser.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -37,6 +37,11 @@
#endif
#include <QWebSettings>
+#ifdef ORBIT_UI
+#include <qmatrix.h>
+const int KLandscapeRoatation =90;
+#endif
+
#ifndef Q_OS_SYMBIAN
// Uncomment the next line to enable the javascript console dialog.
//#define CHROME_CONSOLE 1
@@ -306,7 +311,21 @@
m_splashScreen = new QLabel(NULL);
m_splashScreen->setAlignment(Qt::AlignCenter);
m_splashScreen->setStyleSheet("background-color: #FFF");
- m_splashScreen->setPixmap(QPixmap(imagePath));
+
+#ifdef ORBIT_UI
+ if (m_view->orientation() == Qt::Horizontal) {
+ QMatrix mx;
+ mx.rotate(KLandscapeRoatation);
+ m_splashScreen->setPixmap((QPixmap(imagePath)).transformed(mx));
+ }
+ else {
+ m_splashScreen->setPixmap((QPixmap(imagePath)));
+ }
+#else
+ m_splashScreen->setPixmap((QPixmap(imagePath)));
+#endif
+
+
if (m_splashScreen->pixmap()->isNull()) {
;//qDebug() << "ChromeView::chromeLoaded: ERROR splashscreen creation failed. " << imagePath;
}
--- a/ginebra2/emulator/main.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/emulator/main.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -244,7 +244,7 @@
#ifdef QTHIGHWAY
//qDebug() << "ServiceInfo:" << (XQServiceUtil::isService() ? "Service" : "Normal") << "launch";
//qDebug() << " Embedded=" << XQServiceUtil::isEmbedded() << "Interface=" << XQServiceUtil::interfaceName() << "Operation=" << XQServiceUtil::operationName();
-
+
// provide service for html mime type
FileService *fileServiceProvider = new FileService();
#endif
@@ -258,7 +258,7 @@
if (BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->value("DnsPrefetchEnabled").toBool())
{
// Specifies whether QtWebkit will try to pre-fetch DNS entries to speed up browsing.
- // Without this technique, the DNS lookup is performed only when you click on the link,
+ // Without this technique, the DNS lookup is performed only when you click on the link,
// adding a wait of 250ms (on average) before the page even starts to show up.
// This only works as a global attribute.
QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
@@ -270,16 +270,14 @@
//install the common translator from platform
QTranslator common;
- common.load(":/resource/qt/translations/common_" + lang);
+ common.load("z:/resource/qt/translations/common_" + lang);
QApplication::installTranslator(&common);
//install the translator from Browser
QTranslator translator;
- QString transFilePath = ":/translations";
- //Todo: when platform delivers .ts file
- //QString transFilePath = "Z:/resource/qt/translations/";
- QString transFile = QLatin1String("browserLoc_") + lang;
+ QString transFilePath = "Z:/resource/qt/translations/";
+ QString transFile = QLatin1String("browserloc_") + lang;
translator.load(transFile, transFilePath);
QApplication::installTranslator(&translator);
--- a/ginebra2/ginebra.dox Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ginebra.dox Mon Oct 04 00:04:54 2010 +0300
@@ -18,16 +18,6 @@
*/
/*! \ingroup JavascriptAPI
- * \class WRT::BookmarksManager
- *
- * Javascript object name: "bookmarksManager"
- * Example javascript code to get bookmarks data in JSON format.
- * \code
- * var bookmarkData = bookmarksManager.getBookmarksJSON();
- * \endcode
- */
-
- /*! \ingroup JavascriptAPI
* \class ViewEventContext
*/
--- a/ginebra2/ginebra2.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ginebra2.pro Mon Oct 04 00:04:54 2010 +0300
@@ -60,7 +60,7 @@
# include($$ROOT_DIR/app/common/platform/platform.pri)
# include($$ROOT_DIR/app/common/common.pri)
-TRANSLATIONS += $$PWD/translations/browserLoc.ts
+TRANSLATIONS += browserLoc.ts
# ;;; Following can presumably go away if we will also use Qt's QtWebKit
win32: {
@@ -85,6 +85,12 @@
################################################################################
RESOURCES = ginebra2.qrc
+
+contains(br_layout, tenone) {
+ RESOURCES += ginebra_tenone.qrc
+ DEFINES += BROWSER_LAYOUT_TENONE
+}
+
HEADERS = \
Application.h \
ActionButton.h \
@@ -118,8 +124,8 @@
GraphicsItemAnimation.h \
NativeChromeItem.h \
SlidingWidget.h \
- Charms\ObjectCharm.h \
- Charms\ExternalEventCharm.h \
+ Charms/ObjectCharm.h \
+ Charms/ExternalEventCharm.h \
PageSnippet.h \
PageItem.h \
ProgressBarItem.h \
@@ -134,6 +140,7 @@
ViewStack.h \
GWebTouchNavigation.h \
KineticHelper.h \
+ TitleItem.h \
Toolbar.h \
ToolbarChromeItem.h \
ToolbarSnippet.h \
@@ -144,6 +151,7 @@
BookmarksToolbarSnippet.h \
SettingsToolbarSnippet.h \
RecentUrlToolbarSnippet.h \
+ TitleUrlContainerSnippet.h \
UrlSearchSnippet.h \
Downloads.h \
GAlternateFileChooser.h \
@@ -214,8 +222,8 @@
Snippets.cpp \
ScriptObjects.cpp \
SlidingWidget.cpp \
- Charms\ObjectCharm.cpp \
- Charms\ExternalEventCharm.cpp \
+ Charms/ObjectCharm.cpp \
+ Charms/ExternalEventCharm.cpp \
PageSnippet.cpp \
PageItem.cpp \
ProgressBarItem.cpp \
@@ -229,6 +237,7 @@
ViewStack.cpp \
GWebTouchNavigation.cpp \
KineticHelper.cpp \
+ TitleItem.cpp \
ToolbarChromeItem.cpp \
ToolbarSnippet.cpp \
ContentToolbarChromeItem.cpp \
@@ -238,6 +247,7 @@
BookmarksToolbarSnippet.cpp \
SettingsToolbarSnippet.cpp \
RecentUrlToolbarSnippet.cpp \
+ TitleUrlContainerSnippet.cpp \
UrlSearchSnippet.cpp \
Downloads.cpp \
GAlternateFileChooser.cpp \
@@ -291,18 +301,22 @@
DEFINES += ORBIT_UI
}
+contains(br_mobility_serviceframework, yes) {
+ DEFINES += QT_MOBILITY_SERVICE_FRAMEWORK
+}
+
symbian: {
TARGET.EPOCALLOWDLLDATA = 1
TARGET.EPOCSTACKSIZE = 0x14000
lessThan(QT_VERSION, 4.6.3) {
TARGET.EPOCHEAPSIZE = 0x20000 \
- 0x4000000 \
+ 0x10000000 \
// \
Min \
128kB, \
Max \
- 64MB
+ 256MB
emulatorHeapSize = \
"$${LITERAL_HASH}ifdef WINSCW" \
"EPOCHEAPSIZE 0x20000 0x2000000 // Min 128kB, Max 32MB" \
@@ -311,7 +325,7 @@
} else {
# Set conditional Epoc Heap Size
EHZ.WINSCW = "EPOCHEAPSIZE 0x20000 0x2000000"
- EHZ.default = "EPOCHEAPSIZE 0x20000 0x4000000"
+ EHZ.default = "EPOCHEAPSIZE 0x20000 0x10000000"
# Add the conditional MMP rules
MYCONDITIONS = WINSCW
MYVARIABLES = EHZ
@@ -319,13 +333,18 @@
}
TARGET.CAPABILITY = All -TCB -DRM -AllFiles
- ICON = ./browserIcon.svg
+
contains(browser_addon, no) {
TARGET.UID3 = 0x10008D39
+ CONFIG += hb
+ SKINICON = qtg_large_browser
}
else {
TARGET.UID3 = 0x200267DF
+ ICON = ./browserIcon.svg
}
+ TARGET.VID = VID_DEFAULT
+
LIBS += -lcommdb
LIBS += -lesock -lconnmon -linsock
LIBS += -lavkon -lapparc -leikcore -lcone -lws32 -lapgrfx
@@ -336,7 +355,6 @@
LIBS += -lxqservice -lxqserviceutil
CONFIG += service
SERVICE.FILE = service_conf.xml
- SERVICE.OPTIONS = embeddable
# Browser provides service for html files.
RSS_RULES += \
@@ -345,7 +363,7 @@
" DATATYPE" \
" {" \
" priority = EDataTypePriorityNormal;" \
- " type = \"text/html\";" \
+ " type = \"text/html\";" \
" }" \
" };"
@@ -372,6 +390,11 @@
localpages.path = ./localpages
DEPLOYMENT += localpages
+ # backup restore file
+ backuprestore.sources = ./data/backup_registration.xml
+ backuprestore.path = ./
+ DEPLOYMENT += backuprestore
+
!contains(DEFINES, NO_QSTM_GESTURE) {
qstmgesturelib.sources = qstmgesturelib.dll
qstmgesturelib.path = /sys/bin
@@ -405,3 +428,6 @@
QMAKE_EXTRA_TARGETS += dox
#INCLUDEPATH += $$PWD/../../mw/bedrockProvisioning
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/ginebra2/ginebra2.qrc Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ginebra2.qrc Mon Oct 04 00:04:54 2010 +0300
@@ -1,7 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
- <file>translations/browserLoc.qm</file>
- <file>translations/browserLoc_zh.qm</file>
<file>chrome/localpages/bedrock_splash.png</file>
<file>chrome/js/3rdparty/jquery-ui/effects.core.js</file>
<file>chrome/js/3rdparty/jquery-ui/ui.core.js</file>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ginebra2/ginebra_tenone.qrc Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>chrome/bedrockchrome/urlsearch.snippet/icons/backstep.png</file>
+ <file>chrome/bedrockchrome/urlsearch.snippet/icons/backstep_pressed.png</file>
+ <file>chrome/bedrockchrome/urlsearch.snippet/icons/URL_search_divider.png</file>
+ <file>chrome/bedrockchrome/chrome_tenone.html</file>
+</qresource>
+</RCC>
--- a/ginebra2/mostvisitedpageview.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/mostvisitedpageview.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -25,8 +25,10 @@
#include "linearflowsnippet.h"
#include "mostvisitedpageview.h"
#include "webpagecontroller.h"
-#include "BookmarksManager.h"
+#include "HistoryManager.h"
#include "webpagedata.h"
+#include "ExternalEventCharm.h"
+#include "Utilities.h"
#include "wrtbrowsercontainer.h"
#include "wrtbrowsercontainer_p.h"
@@ -39,6 +41,7 @@
, m_chrome(chrome)
, m_flowInterface(0)
, m_hideOnClose(true)
+ , m_externalEventCharm(0)
{
setFlags(QGraphicsItem::ItemDoesntPropagateOpacityToChildren);
setOpacity(0.5);
@@ -46,7 +49,11 @@
WebPageController* pageController = WebPageController::getSingleton();
connect(pageController, SIGNAL(loadFinished(const bool)), this, SLOT(onLoadFinished(const bool)));
connect(pageController, SIGNAL(loadFinishedForBackgroundWindow(const bool, WRT::WrtBrowserContainer*)), this, SLOT(onLoadFinishedForBackgroundWindow(const bool, WRT::WrtBrowserContainer*)));
- connect(WRT::BookmarksManager::getSingleton(),SIGNAL(historyCleared()),this,SLOT(clearMVStore()));
+ connect(WRT::HistoryManager::getSingleton(),SIGNAL(historyCleared()),this,SLOT(clearMVStore()));
+ //Registering for handling External Events
+ m_externalEventCharm = new ExternalEventCharm(this);
+ safe_connect(m_externalEventCharm, SIGNAL(externalMouseEvent(QEvent*, const QString &, const QString &)),
+ snippet, SIGNAL(externalMouseEvent(QEvent*, const QString &, const QString &)));
}
MostVisitedPagesWidget::~MostVisitedPagesWidget()
@@ -55,9 +62,11 @@
m_flowInterface->deleteLater();
if (m_mostVisitedPageStore)
delete m_mostVisitedPageStore;
+ if(m_externalEventCharm)
+ delete m_externalEventCharm;
WebPageController* pageController = WebPageController::getSingleton();
disconnect(pageController, SIGNAL(loadFinished(const bool)), this, SLOT(onLoadFinished(const bool)));
- disconnect(WRT::BookmarksManager::getSingleton(),SIGNAL(historyCleared()),this,SLOT(clearMVStore()));
+ disconnect(WRT::HistoryManager::getSingleton(),SIGNAL(historyCleared()),this,SLOT(clearMVStore()));
}
@@ -120,7 +129,7 @@
void MostVisitedPagesWidget::updatePos(QPointF pos, qreal &toolBarHeight)
{
QGraphicsWidget::setPos(pos);
- m_flowInterface->setPos(pos.x(), m_parent->size().height() - (toolBarHeight+5) - KLinearSnippetHeight);
+ m_flowInterface->setPos(pos.x(), m_parent->size().height() - (toolBarHeight+KSpaceToolbarMVP) - KLinearSnippetHeight);
}
void MostVisitedPagesWidget::resize(const QSize &size)
@@ -211,7 +220,7 @@
//if it is a new page to the store, get its rank from history
//FIX ME : need to optimize this code
- pageRank = WRT::BookmarksManager::getSingleton()->getPageRank(pageUrl.toString());
+ pageRank = WRT::HistoryManager::getSingleton()->getPageRank(pageUrl.toString());
m_mostVisitedPageStore->pageAccessed(pageUrl, pageThumbnail, pageRank);
}
--- a/ginebra2/mostvisitedpageview.h Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/mostvisitedpageview.h Mon Oct 04 00:04:54 2010 +0300
@@ -23,12 +23,16 @@
#include "ChromeSnippet.h"
#include "ChromeWidget.h"
+//space left between MVP and toolbar
+const int KSpaceToolbarMVP = 5;
+
namespace WRT {
class WrtBrowserContainer;
}
namespace GVA {
+class ExternalEventCharm;
class LinearFlowSnippet;
class MostVisitedPagesWidget : public ChromeItem
@@ -69,5 +73,6 @@
GVA::LinearFlowSnippet *m_flowInterface;
int m_selectIndex;
bool m_hideOnClose;
+ ExternalEventCharm *m_externalEventCharm;
};
}
--- a/ginebra2/mostvisitedsnippet.cpp Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/mostvisitedsnippet.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -72,7 +72,8 @@
if (visibleSnippet)
toolBarHeight = visibleSnippet->widget()->rect().height();
- mostVisitedPagesWidget->resize(m_chrome->layout()->size().toSize());
+ //Resizing the widget to exclude the toolbar area so that it can handle events on toolbar as external event
+ mostVisitedPagesWidget->resize(QSize(m_chrome->layout()->size().width(),(m_chrome->layout()->size().height()- toolBarHeight - KSpaceToolbarMVP)));
mostVisitedPagesWidget->updatePos(QPointF(0, 0), toolBarHeight);
}
Binary file ginebra2/translations/Browser.xls has changed
Binary file ginebra2/translations/browserLoc.qm has changed
--- a/ginebra2/translations/browserLoc.ts Fri Sep 17 08:27:10 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,656 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="3.0" sourcelanguage="en_GB">
-<context>
-<message numerus="no" id="txt_browser_tag_error_tag_file_could_not_be_downloaded">
- <comment>Info note for when there is a download error and item is not downloaded, %1 is the name of the item</comment>
- <source>Error: %1 could not be downloaded</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_downloading_file</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Downloads_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_browser">
- <comment>Title of Content View.</comment>
- <source>Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Title_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_windows">
- <comment>Title of Windows View</comment>
- <source>Windows</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Windows_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_this_month">
- <comment>Subheading Label in History List</comment>
- <source>This Month</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_history_today</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_cancel">
- <comment>Button text when adding/editing a bookmark</comment>
- <source>Cancel</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_bookmarks_done</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Bookmarks_001a</extra-loc-viewid>
- <extra-loc-positionid>button</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_error_page_load_failed">
- <comment>Layout ID parent. Error info notification message</comment>
- <source>Unable to load page</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_error_page_load_failed</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Error_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_page_allow_popups">
- <comment>Layout ID parent. Content View Context Menu Page tab Allow Pop-ups menu item</comment>
- <source>Allow Pop-ups</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_page_allow_popups</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001b</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings">
- <comment>Subheader in Settings View for General Settings</comment>
- <source>General Settings</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_new_window">
- <comment>Layout ID parent. Title displayed above a new, blank window in the Windows view.</comment>
- <source>New Window</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_windows_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Windows_001 </extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_nav_exit">
- <comment>Content View Context Menu Navigation tab Exit menu item</comment>
- <source>Exit Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_nav_bookmarks</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_short_caption_browser">
- <comment>Caption for Application Library - grid view</comment>
- <source>Web Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>qtl_grid_applications_sec</extra-loc-layout_id>
- <extra-loc-viewid>browser</extra-loc-viewid>
- <extra-loc-positionid>grid</extra-loc-positionid>
- <extra-loc-feature>br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_chrome_suggests_search_for">
- <comment>Displayed in the URL bar search suggestions drop-down menu, %1 is the search string</comment>
- <source>Search for %1</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_chrome_suggests_search_for</extra-loc-layout_id>
- <extra-loc-viewid>Browser_URLbar_001</extra-loc-viewid>
- <extra-loc-positionid>opt</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_nav_settings">
- <comment>Content View Context Menu Navigation tab Settings menu item</comment>
- <source>Settings</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_nav_bookmarks</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_tab_link">
- <comment>Content View Context Menu Link tab</comment>
- <source>Link</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_tab_navigation</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001c</extra-loc-viewid>
- <extra-loc-positionid>tab</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_nav_bookmarks">
- <comment>Layout ID parent. Content View Context Menu Navigation tab Bookmarks menu item</comment>
- <source>Bookmarks</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_nav_bookmarks</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_tab_link_image">
- <comment>Content View Context Menu Link/Image tab - this tab is for images that are also links. So under it are: "open link in new window", "share link", "save image"</comment>
- <source>Link/Image</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_tab_navigation</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001</extra-loc-viewid>
- <extra-loc-positionid>tab</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data">
- <comment>Layout ID parent. Subheader in Settings View for Clear Data</comment>
- <source>Clear Data</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_cache">
- <comment>Layout ID parent. In the Browser Settings, for clearing cache</comment>
- <source>Cache</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_bookmarks">
- <comment>Page title in Bookmarks View</comment>
- <source>Bookmarks</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Bookmarks_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_new_window">
- <comment>Layout ID parent. Title of New Window in Content View</comment>
- <source>New Window</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Title_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_history">
- <comment>Title of History View</comment>
- <source>History</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_windows_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_settings">
- <comment>Title of Settings View</comment>
- <source>Settings</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_new_window</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_today">
- <comment>Layout ID parent. Subheading Label in History List</comment>
- <source>Today</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_history_today</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_most_visited_title_most_visited">
- <comment>Layout ID parent. For the title of the Most Visited pages grid</comment>
- <source>Most Visited</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_most_visited_title_most_visited</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Most_Visited_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_no">
- <comment>In the Browser Settings, for setting an option to No</comment>
- <source>No</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_yes</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>setlabel_1_2_val</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_page_add_bookmark">
- <comment>Content View Context Menu Page tab Add Bookmark menu item</comment>
- <source>Add Bookmark</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_page_allow_popups</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001b</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_downloading_file">
- <comment>Layout ID parent. Info note for when a new item starts downloading, %1 is the name of the item that is downloading</comment>
- <source>Downloading %1</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_downloading_file</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Downloads_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_page_block_popups">
- <comment>Content View Context Menu Page tab Block Pop-ups menu item</comment>
- <source>Block Popups</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_page_allow_popups</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001b</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_tab_page">
- <comment>Content View Context Menu label for Page tab</comment>
- <source>Page</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_tab_navigation</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001b</extra-loc-viewid>
- <extra-loc-positionid>tab</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_form_data">
- <comment>In the Browser Settings, for clearing form data</comment>
- <source>Form Data</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_error_dialog_close_some">
- <comment>Error dialog shown when device is running out of memory.</comment>
- <source>Close some browser windows or applications.</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_error_dialog_device_low</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Memory_Low_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_nav_history">
- <comment>Content View Context Menu Navigation tab History menu item</comment>
- <source>History</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_nav_bookmarks</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_image_save_image">
- <comment>Content View Context Menu Image tab Save Image menu item</comment>
- <source>Save Image</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_image_save_image</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001d</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_network_switch_connection">
- <comment>Prompt shown when a new network is available to use as the browser's network connection, %1 is the network name</comment>
- <source>%1 is now in range. Switch connection?</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_network_switch_connection</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Network_001</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_tab_navigation">
- <comment>Layout ID parent. Content View Context Menu label for Navigation tab</comment>
- <source>Navigation</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_tab_navigation</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>tab</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_link_open_link">
- <comment>Layout ID parent. Content View Context Menu Link tab Open Link in New Window menu item</comment>
- <source>Open Link in New Window</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_link_open_link</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001c</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_cookies">
- <comment>In the Browser Settings, for clearing cookies</comment>
- <source>Cookies</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_nav_windows">
- <comment>Content View Context Menu Navigation tab Windows menu item</comment>
- <source>Windows</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_nav_bookmarks</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001a</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_all">
- <comment>In the Browser Settings, for clearing all at once</comment>
- <source>Clear All</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_page_share">
- <comment>Content View Context Menu Page tab Share menu item</comment>
- <source>Share</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_page_allow_popups</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001b</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_save_browser_history">
- <comment>Layout ID parent. In the Browser Settings, for saving history</comment>
- <source>Save Browser History</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_save_browser_history</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>setlabel_1</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_long_caption_browser">
- <comment>Caption for Application Library - list view</comment>
- <source>Web Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>
- <extra-loc-viewid>browser</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_error_generic_error_msg">
- <comment>Generic error message in dialog when the network does not send an error.</comment>
- <source>Network error</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_error_page_load_failed</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Error_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_network_switch_connection_yes">
- <comment>Layout ID parent. In the Browser Network switch connection dialog</comment>
- <source>Yes</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_network_switch_connection_yes</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Network_001</extra-loc-viewid>
- <extra-loc-positionid>button</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_link_share_link">
- <comment>Content View Context Menu Link tab Share Link menu item</comment>
- <source>Share Link</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_link_open_link</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001c</extra-loc-viewid>
- <extra-loc-positionid>menu</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_tab_image">
- <comment>Content View Context Menu Image tab</comment>
- <source>Image</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_content_view_menu_tab_navigation</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Context_Menu_001d</extra-loc-viewid>
- <extra-loc-positionid>tab</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_offline">
- <comment>Status of browser connection, shown next to Page Title in Browser status bar in Content View</comment>
- <source>Offline</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_offline</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Content_Title_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_file_has_finished_downloading">
- <comment>Info note for when an item has finished downloading, %1 is the name of the item that has been downloaded</comment>
- <source>%1 has finished downloading</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_downloading_file</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Downloads_001</extra-loc-viewid>
- <extra-loc-positionid>dpopinfo</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_yes">
- <comment>Layout ID parent. In the Browser Settings, for setting an option to Yes</comment>
- <source>Yes</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_yes</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>setlabel_1_2_val</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_character_encoding">
- <comment>In the Browser Settings, for character encoding</comment>
- <source>Character Encoding</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_save_browser_history</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>formlabel_1</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_done">
- <comment>Layout ID parent. Button text when adding/editing a bookmark</comment>
- <source>Done</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_bookmarks_done</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Bookmarks_001a</extra-loc-viewid>
- <extra-loc-positionid>button</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_network_switch_connection_no">
- <comment>In the Browser Network switch connection dialog</comment>
- <source>No</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_network_switch_connection_yes</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Network_001</extra-loc-viewid>
- <extra-loc-positionid>button</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_save_forms_passwords">
- <comment>In the Browser Settings, for saving forms and passwords</comment>
- <source>Save Forms/Passwords</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_save_browser_history</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>setlabel_2</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_delete_are_you_sure">
- <comment>Dialog displayed in the History View when a user clears their History</comment>
- <source>Are you sure you want to permanently delete your history?</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_history_delete_are_you_sure</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_history">
- <comment>In the Browser Settings, for clearing history</comment>
- <source>History</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_about">
- <comment>In the Browser Settings, for info about the browser (version info etc)</comment>
- <source>About Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_save_browser_history</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_error_dialog_device_low">
- <comment>Layout ID parent. Error dialog shown when device is running out of memory.</comment>
- <source>Device Low On Memory</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_error_dialog_device_low</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Memory_Low_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>dpophead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_data_bookmarks">
- <comment>In the Browser Settings, for clearing bookmarks</comment>
- <source>Bookmarks</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_clear_data_cache</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001a</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_yesterday">
- <comment>Subheading Label in History List</comment>
- <source>Yesterday</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_history_today</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_character_encoding_automatic">
- <comment>Layout ID parent. In the Browser Settings, drop-down menu item for character encoding. Automatic is the default item.</comment>
- <source>Automatic</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_character_encoding_automatic</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>formlabel_1_val</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_input_dial_add_bm">
- <comment>Layout ID parent. Title for bookmarks dialog for adding a bm</comment>
- <source>Add Bookmark</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_input_dial_add_bm</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Bookmark_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_history_this_week">
- <comment>Subheading Label in History List</comment>
- <source>This Week</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_history_today</extra-loc-layout_id>
- <extra-loc-viewid>Browser_History_001</extra-loc-viewid>
- <extra-loc-positionid>subhead</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_tsw_caption_browser">
- <comment>Caption for Task Switcher</comment>
- <source>Web Browser</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_tsw_caption_browser</extra-loc-layout_id>
- <extra-loc-viewid>tsw_01</extra-loc-viewid>
- <extra-loc-positionid>caption</extra-loc-positionid>
- <extra-loc-feature>ts</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_input_dial_edit_bm">
- <comment>Title for bookmarks dialog for editing a bm</comment>
- <source>Edit Bookmark</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_input_dial_add_bm</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Bookmark_Dialog_001</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_general_settings_character_encoding_unicode">
- <comment>In the Browser Settings, drop-down menu item for character encoding</comment>
- <source>Unicode</source>
- <translation variants="no" type="unfinished"></translation>
- <extra-loc-layout_id>txt_browser_settings_general_settings_character_encoding_automatic</extra-loc-layout_id>
- <extra-loc-viewid>Browser_Settings_001b</extra-loc-viewid>
- <extra-loc-positionid>formlabel_1_val</extra-loc-positionid>
- <extra-loc-feature>Br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-</context>
-</TS>
Binary file ginebra2/translations/browserLoc_zh.qm has changed
--- a/ginebra2/translations/browserLoc_zh.ts Fri Sep 17 08:27:10 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="3.0" language="zh" sourcelanguage="en_GB">
-<context>
-<message numerus="no" id="txt_browser_tag_error_tag_file_could_not_be_downloaded">
- <comment>Info note for when there is a download error and item is not downloaded.</comment>
- <source>Error: <file name> could not be downloaded</source>
- <translation variants="no">Error: <file name> could not be downloaded</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_max_number_open_ok">
- <comment>Text on button to dismiss warning</comment>
- <source>OK</source>
- <translation variants="no">OK</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_network_switch_connection">
- <comment>Prompt shown when a new network is available to use as the browser's network connection</comment>
- <source><Network name> is now in range. Switch connection?</source>
- <translation variants="no"><Network name> is now in range. Switch connection?</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_browser">
- <comment>Title of Content View. We may not need this string, so this is a placeholder for now, just in case</comment>
- <source>Browser</source>
- <translation variants="no">浏览</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_windows">
- <comment>Title of Windows View</comment>
- <source>Windows</source>
- <translation variants="no">窗口标题</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_last_week">
- <comment>Label in History List</comment>
- <source>Last Week</source>
- <translation variants="no">上星期</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_most_visited">
- <comment>For the title of the Most Visited filmstrip</comment>
- <source>Most Visited</source>
- <translation variants="no">访问次数最多的</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_cancel">
- <comment>Button text when adding/editing a bookmark</comment>
- <source>Cancel</source>
- <translation variants="no">取消</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_last_month">
- <comment>Label in History List</comment>
- <source>Last Month</source>
- <translation variants="no">上个月</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_older">
- <comment>Label in History List</comment>
- <source>Older</source>
- <translation variants="no">旧历史</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_error_page_load_failed">
- <comment>Error info notification message</comment>
- <source>Page load failed</source>
- <translation variants="no">页面加载失败</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_three_weeks_ago">
- <comment>Label in History List</comment>
- <source>Three Weeks Ago</source>
- <translation variants="no">三个星期前</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_exit">
- <comment>Exit Item in Content View Menu</comment>
- <source>Exit</source>
- <translation variants="no">退出</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_bookmarks">
- <comment>Bookmarks Item in Content View Menu</comment>
- <source>Bookmarks</source>
- <translation variants="no">书签</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_new_window">
- <comment>Title of New Window before a page is loaded</comment>
- <source>New Window</source>
- <translation variants="no">新视窗</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_yesterday">
- <comment>Label in History List</comment>
- <source>Yesterday</source>
- <translation variants="no">昨天</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_short_caption_browser">
- <comment>Caption for Application Library - grid view</comment>
- <source>Web Browser</source>
- <translation variants="no">浏览器</translation>
- <extra-loc-layout_id>qtl_grid_applications_sec</extra-loc-layout_id>
- <extra-loc-viewid>browser</extra-loc-viewid>
- <extra-loc-positionid>grid</extra-loc-positionid>
- <extra-loc-feature>br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_long_caption_browser">
- <comment>Caption for Application Library - list view</comment>
- <source>Web Browser</source>
- <translation variants="no">浏览器</translation>
- <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>
- <extra-loc-viewid>browser</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>br</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_back">
- <comment>Possible tooltip for the Back icon</comment>
- <source>Back</source>
- <translation variants="no">以前</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_cache">
- <comment>In the Browser Settings, for clearing cache</comment>
- <source>Clear Cache</source>
- <translation variants="no">清除缓存</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_cookies">
- <comment>In the Browser Settings, for clearing cookies</comment>
- <source>Clear Cookies</source>
- <translation variants="no">清除Cookies</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_all">
- <comment>In the Browser Settings, for clearing all</comment>
- <source>Clear All</source>
- <translation variants="no">全部清除</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_file_has_finished_downloading">
- <comment>Info note for when an item has finished downloading.</comment>
- <source><File name> has finished downloading</source>
- <translation variants="no"><File name> has finished downloading</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_two_weeks_ago">
- <comment>Label in History List</comment>
- <source>Two Weeks Ago</source>
- <translation variants="no">两星期前</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_status_bar_go">
- <comment>This is an icon now, but we may need a tooltip in the future.</comment>
- <source>Go</source>
- <translation variants="no">进行</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_done">
- <comment>Button text when adding/editing a bookmark</comment>
- <source>Done</source>
- <translation variants="no">完成</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_add_new_window">
- <comment>Possible tooltip for adding a new window</comment>
- <source>Add New Window</source>
- <translation variants="no">添加新视窗</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_status_bar_stop">
- <comment>This is an icon now, but we may need a tooltip in the future.</comment>
- <source>Stop</source>
- <translation variants="no">停止</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_menu_history">
- <comment>History Item in Content View Menu</comment>
- <source>History</source>
- <translation variants="no">History</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_windows_max_number_open">
- <comment>Warning text that appears when a user tries to open greater than the maximum number of windows allowed.</comment>
- <source>Maximum number of windows is already open. Close a window and try again.</source>
- <translation variants="no">Maximum number of windows is already open. Close a window and try again.</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_today">
- <comment>Label in History List</comment>
- <source>Today</source>
- <translation variants="no">Today</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_bookmarks_bookmarks">
- <comment>Page title in Bookmarks View</comment>
- <source>Bookmarks</source>
- <translation variants="no">书签</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_settings">
- <comment>Title of Settings View</comment>
- <source>Settings</source>
- <translation variants="no">设置</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_content_view_most_visited_pages">
- <comment>Alternate for the title of the Most Visited filmstrip</comment>
- <source>Most Visited Pages</source>
- <translation variants="no">访问次数最多的页面</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_earlier_this_month">
- <comment>Label in History List</comment>
- <source>Earlier This Month</source>
- <translation variants="no">本月</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_status_bar_reload">
- <comment>This is an icon now, but we may need a tooltip in the future.</comment>
- <source>Reload</source>
- <translation variants="no">刷新</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_settings_clear_history">
- <comment>In the Browser Settings, for clearing history</comment>
- <source>Clear History</source>
- <translation variants="no">Clear History</translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_browser_downloading_file">
- <comment>Info note for when a new item starts downloading</comment>
- <source>Downloading <file name></source>
- <translation variants="no">Downloading <file name></translation>
- <extra-loc-layout_id></extra-loc-layout_id>
- <extra-loc-viewid></extra-loc-viewid>
- <extra-loc-positionid></extra-loc-positionid>
- <extra-loc-feature></extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_tsw_caption_browser">
- <comment>Caption for Task Switcher</comment>
- <source>Web Browser</source>
- <translation variants="no">Web Browser</translation>
- <extra-loc-layout_id>txt_tsw_caption_browser</extra-loc-layout_id>
- <extra-loc-viewid>tsw_01</extra-loc-viewid>
- <extra-loc-positionid>caption</extra-loc-positionid>
- <extra-loc-feature>ts</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-</context>
-</TS>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/homescreen.pro Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,27 @@
+#
+# 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
+CONFIG += ordered
+
+# APP subdirs
+SUBDIRS += widgetplugins
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/hsbookmarkwidgetplugin.pro Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Homescreen bookmark plugin widget
+#
+
+TEMPLATE = lib
+CONFIG += plugin mobility hb
+MOBILITY = serviceframework
+
+HB += hbfeedback
+
+HEADERS += ./inc/*.h
+SOURCES += ./src/*.cpp
+
+INCLUDEPATH += ./inc
+
+RESOURCES += hsbookmarkwidgetplugin.qrc
+
+symbian: {
+
+ DESTDIR = /private/20022F35/import/widgetregistry/200267BE
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+ TARGET.UID3 = 0x200267BE
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = ALL -TCB
+
+ plugins.path = $${DESTDIR}
+ plugins.sources = $${TARGET}.dll
+
+ widgetResources.path = $${DESTDIR}
+ widgetResources.sources += resource/$${TARGET}.xml
+ widgetResources.sources += resource/$${TARGET}.manifest
+ widgetResources.sources += resource/nokiabrowser-bm-icon_70x70_ico.png
+ widgetResources.sources += resource/nokiabrowser-bm-icon_70x70_no_ico.png
+ widgetResources.sources += resource/nokiabrowser-bm-icon_50x50.png
+
+ DEPLOYMENT += plugins \
+ widgetResources
+}
+
+win32: {
+
+ CONFIG(debug, debug|release) {
+ SUBDIRPART = debug
+ } else {
+ SUBDIRPART = release
+ }
+
+ PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20102F7E
+
+ DESTDIR = $$PWD/../../../../bin/$${SUBDIRPART}/$${PLUGIN_SUBDIR}
+
+ manifest.path = $${DESTDIR}
+ manifest.files = ./resource/*.manifest ./resource/*.xml ./resource/*.png ./resource/*.svg
+
+ INSTALLS += manifest
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/hsbookmarkwidgetplugin.qrc Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource>
+ <file alias="hsbookmarkwidget.css">resource/hsbookmarkwidget.css</file>
+ <file alias="hsbookmarkwidget.widgetml">resource/hsbookmarkwidget.widgetml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/inc/hsbookmarkwidget.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark widget
+*
+*/
+
+#ifndef HSBOOKMARKWIDGET_H
+#define HSBOOKMARKWIDGET_H
+
+#include <HbWidget>
+
+class HbFrameItem;
+class HbIconItem;
+class HbTextItem;
+class HbTouchArea;
+
+class HsBookmarkWidget : public HbWidget
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString rootPath READ rootPath WRITE setRootPath)
+
+ // Persistent property of the homescreen bookmark widget. They are stored in homescreen
+ // WidgetProperty of homescreen.db.
+ Q_PROPERTY(QString bookmarkTitle READ bookmarkTitle WRITE setBookmarkTitle)
+ Q_PROPERTY(QString bookmarkUrl READ bookmarkUrl WRITE setBookmarkUrl)
+ Q_PROPERTY(QString faviconFileName READ faviconFileName WRITE setFaviconFileName)
+ Q_PROPERTY(QString faviconPath READ faviconPath WRITE setFaviconPath)
+
+public:
+ HsBookmarkWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+ ~HsBookmarkWidget();
+
+ enum {
+ maxDisplayLen = 6
+ };
+
+ enum {
+ faviconPoint = 37
+ };
+
+ enum {
+ faviconSize = 35
+ };
+
+ void setRootPath(const QString &rootPath);
+ QString rootPath()const;
+
+ void setBookmarkTitle(const QString &bookmarkTitle);
+ QString bookmarkTitle() const;
+ void setBookmarkUrl(const QString &bookmarkUrl);
+ QString bookmarkUrl() const;
+ void setFaviconFileName(const QString &faviconFileName);
+ QString faviconFileName() const;
+ void setFaviconPath(const QString &faviconPath);
+ QString faviconPath() const;
+
+ bool eventFilter(QObject *watched, QEvent *event);
+
+public slots:
+
+ void onInitialize();
+ void onShow();
+ void onHide();
+
+private:
+
+ void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+
+ void createPrimitives();
+
+ void setBackgroundToNormal();
+ void setBackgroundToPressed();
+
+ void updateContent(const QString title, const HbIcon& icon);
+
+ QImage createImageWithOverlay(const QImage& baseImage, const QPoint& point, const QImage& overlayImage);
+ HbIcon createIconWithOverlay(HbIcon& baseIcon, const QPoint& point, HbIcon& overlayIcon);
+
+ void removeFavicon();
+
+private:
+ Q_DISABLE_COPY(HsBookmarkWidget)
+
+ HbFrameItem *mBackground;
+ HbIconItem *mIcon;
+ HbTextItem *mText;
+ HbTouchArea *mTouchArea;
+
+ QString mRootPath;
+ QString mBookmarkTitle;
+ QString mBookmarkUrl;
+ QString mFaviconFileName;
+ QString mFaviconPath;
+};
+
+#endif // HSBOOKMARKWIDGET_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/inc/hsbookmarkwidgetplugin.h Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark widget
+*
+*/
+
+#ifndef HSBOOKMARKWIDGETPLUGIN_H
+#define HSBOOKMARKWIDGETPLUGIN_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+class HsBookmarkWidgetPlugin : public QObject, public QServicePluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+ QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session);
+};
+
+#endif // HSBOOKMARKWIDGETPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/hsbookmarkwidget.css Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,60 @@
+HsBookmarkWidget {
+ layout: icon_bookmark;
+}
+
+HsBookmarkWidget[bookmarkTitle] {
+ layout: icon_text_bookmark;
+}
+
+HsBookmarkWidget[!bookmarkTitle] {
+ layout: icon_bookmark;
+}
+
+HsBookmarkWidget::background {
+ border-width: 0.0un;
+ fixed-width: 12un;
+ fixed-height: 12un;
+ zvalue: 0;
+}
+
+HsBookmarkWidget[bookmarkTitle]::background {
+ border-width: 0.0un;
+ fixed-width: 12un;
+ fixed-height: expr(12.5un + var(hb-param-text-height-tiny));
+ zvalue: 0;
+}
+
+HsBookmarkWidget[!bookmarkTitle]::background {
+ border-width: 0.0un;
+ fixed-width: 12un;
+ fixed-height: 12un;
+ zvalue: 0;
+}
+
+HsBookmarkWidget::icon{
+ left: -0.5un;
+ right: 0.5un;
+ top: -0.5un;
+ bottom: 0.5un;
+ fixed-width: 11.0un;
+ fixed-height: 11.0un;
+ zvalue: 1;
+}
+
+HsBookmarkWidget::bookmarkTitle{
+ left: -0.5un;
+ right: 0.5un;
+ top: 0.0un;
+ bottom: 0.5un;
+ fixed-width: 11.0un;
+ font-variant: secondary;
+ text-align: center center;
+ text-height: var(hb-param-text-height-tiny);
+ text-line-count-max: 1;
+ color: var(qtc_hs_list_item_title_normal);
+ zvalue: 2;
+}
+
+HsBookmarkWidget::toucharea {
+ zvalue: 3;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/hsbookmarkwidget.widgetml Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,36 @@
+<hbwidget version="0.1" type="HsBookmarkWidget">
+
+ <layout name="icon_text_bookmark" type="mesh">
+ <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+ <meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="icon" srcEdge="CENTERH" dst="" dstEdge="CENTERH" />
+
+ <meshitem src="text" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ <meshitem src="text" srcEdge="CENTERH" dst="" dstEdge="CENTERH" />
+
+ <meshitem src="toucharea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="toucharea" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+ <meshitem src="toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ </layout>
+
+ <layout name="icon_bookmark" type="mesh">
+ <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+ <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" />
+ <meshitem src="icon" srcEdge="CENTERH" dst="" dstEdge="CENTERH" />
+
+ <meshitem src="toucharea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="toucharea" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+ <meshitem src="toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ </layout>
+
+</hbwidget>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/hsbookmarkwidgetplugin.manifest Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<hswidgetmanifest>
+ <uri>hsbookmarkwidgetplugin</uri>
+ <title>Bookmark</title>
+ <description>Homescreen bookmark widget</description>
+ <icon>nokiabrowser-bm-icon_50x50.png</icon>
+ <hidden>false</hidden>
+ <servicexml>hsbookmarkwidgetplugin.xml</servicexml>
+</hswidgetmanifest>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/hsbookmarkwidgetplugin.xml Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>hsbookmarkwidgetplugin</name>
+ <filepath>hsbookmarkwidgetplugin</filepath>
+ <description>homescreen bookmarkwidget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>homescreen bookmark widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">nokiabrowser-bm-icon_50x50.png</customproperty>
+ <customproperty key="title">Bookmark</customproperty>
+ </interface>
+</service>
Binary file homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/nokiabrowser-bm-icon_50x50.png has changed
Binary file homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/nokiabrowser-bm-icon_60x60.png has changed
Binary file homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/nokiabrowser-bm-icon_70x70_ico.png has changed
Binary file homescreen/widgetplugins/hsbookmarkwidgetplugin/resource/nokiabrowser-bm-icon_70x70_no_ico.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/src/hsbookmarkwidget.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,357 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark widget
+*
+*/
+#include <QGraphicsSceneMouseEvent>
+#include <QPainter>
+
+#include <HbStyleLoader>
+#include <HbFrameItem>
+#include <HbFrameDrawer>
+#include <HbIconItem>
+#include <HbTextItem>
+#include <HbTouchArea>
+#include <HbInstantFeedback>
+
+#include <QDir>
+#include <qdesktopservices.h>
+#include <qurl.h>
+#include <qdebug.h>
+#include "hsbookmarkwidget.h"
+
+/*!
+ \ingroup group_hsbookmark_widget
+ \class HsBookmarkWidget
+ \brief Implementation for homescreen bookmark widget.
+
+ HsBookmarkWidget derived from the HbWidget and implements
+ needed functions for the homescreen bookmark widget.
+*/
+
+/*!
+ Constructs a widget which is a child of \a parent, with widget flags set to \a flags.
+*/
+HsBookmarkWidget::HsBookmarkWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+ : HbWidget(parent, flags),
+ mBackground(0), mIcon(0), mText(0), mTouchArea(0)
+{
+ HbStyleLoader::registerFilePath(":/hsbookmarkwidget.widgetml");
+ HbStyleLoader::registerFilePath(":/hsbookmarkwidget.css");
+
+ createPrimitives();
+}
+
+/*!
+ Destructor
+*/
+HsBookmarkWidget::~HsBookmarkWidget()
+{
+ HbStyleLoader::unregisterFilePath(":/hsbookmarkwidget.widgetml");
+ HbStyleLoader::unregisterFilePath(":/hsbookmarkwidget.css");
+}
+
+/*!
+ Set's widget root path as \a rootPath
+*/
+void HsBookmarkWidget::setRootPath(const QString &rootPath)
+{
+ mRootPath = rootPath;
+}
+
+/*!
+ Root path for widget's resources
+*/
+QString HsBookmarkWidget::rootPath()const
+{
+ return mRootPath;
+}
+
+/*!
+ Set the bookmarkTitle property. This property is needed by css selector.
+*/
+void HsBookmarkWidget::setBookmarkTitle(const QString &bookmarkTitle)
+{
+ mBookmarkTitle = bookmarkTitle;
+}
+
+/*!
+ Return the bookmarkTitle property. This property is needed by css selector.
+*/
+QString HsBookmarkWidget::bookmarkTitle() const
+{
+ return mBookmarkTitle;
+}
+
+/*!
+ Set the bookmarkUrl property. This property is needed by QDestopService
+ to launch into browser.
+*/
+void HsBookmarkWidget::setBookmarkUrl(const QString &bookmarkUrl)
+{
+ mBookmarkUrl = bookmarkUrl;
+}
+
+/*!
+ Return the bookmarkUrl property. This property is needed by QDestopService
+ to launch into browser.
+*/
+QString HsBookmarkWidget::bookmarkUrl() const
+{
+ return mBookmarkUrl;
+}
+
+/*!
+ Set the iconFileName property. This property is to load the favison icon.
+*/
+void HsBookmarkWidget::setFaviconFileName(const QString &faviconFileName)
+{
+ mFaviconFileName = faviconFileName;
+}
+
+/*!
+ Return the iconFileName property. This property is to load the favison icon.
+*/
+QString HsBookmarkWidget::faviconFileName() const
+{
+ return mFaviconFileName;
+}
+
+/*!
+ Set the iconFileName property. This property is to load the favison icon.
+*/
+void HsBookmarkWidget::setFaviconPath(const QString &faviconPath)
+{
+ mFaviconPath = faviconPath;
+}
+
+/*!
+ Return the iconFileName property. This property is to load the favison icon.
+*/
+QString HsBookmarkWidget::faviconPath() const
+{
+ return mFaviconPath;
+}
+
+/*!
+ Filters touch area events.
+*/
+bool HsBookmarkWidget::eventFilter(QObject *watched, QEvent *event)
+{
+ Q_UNUSED(watched)
+
+ switch (event->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ handleMousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
+ return true;
+ case QEvent::GraphicsSceneMouseMove:
+ handleMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
+ return true;
+ case QEvent::GraphicsSceneMouseRelease:
+ handleMouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
+ return true;
+ case QEvent::UngrabMouse:
+ setBackgroundToNormal();
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+}
+
+void HsBookmarkWidget::onInitialize()
+{
+ if (mFaviconFileName.isNull())
+ {
+ // get default icon, rootPath is set thus we can use it
+ QString iconPath = QDir::toNativeSeparators(mRootPath + "/nokiabrowser-bm-icon_70x70_no_ico.png");
+ HbIcon icon = HbIcon(iconPath);
+ updateContent(mBookmarkTitle, icon);
+ }
+ else
+ {
+ // get favicon first
+ QString faviconPath = QDir::toNativeSeparators(mFaviconPath + mFaviconFileName);
+
+ HbIcon favicon = HbIcon(faviconPath);
+ favicon.setSize(QSize(HsBookmarkWidget::faviconSize, HsBookmarkWidget::faviconSize));
+
+ QString iconPath = QDir::toNativeSeparators(mRootPath + "/nokiabrowser-bm-icon_70x70_ico.png");
+ HbIcon icon = HbIcon(iconPath);
+
+ updateContent(mBookmarkTitle,
+ createIconWithOverlay(icon,
+ QPoint(HsBookmarkWidget::faviconPoint, HsBookmarkWidget::faviconPoint),
+ favicon));
+ }
+}
+
+/*!
+ Called when widget is shown in the home screen
+*/
+void HsBookmarkWidget::onShow()
+{
+ setVisible(true);
+}
+
+/*!
+ Called when widget is hidden from the home screen
+*/
+
+void HsBookmarkWidget::onHide()
+{
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_UNUSED(event)
+ setBackgroundToPressed();
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ if (contains(event->pos())) {
+ setBackgroundToPressed();
+ } else {
+ setBackgroundToNormal();
+ }
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ setBackgroundToNormal();
+
+ if (!contains(event->pos())) {
+ return;
+ }
+
+ //HbInstantFeedback::play(HSCONFIGURATION_GET(bookmarkWidgetTapFeedbackEffect));
+
+ QUrl url = QUrl(mBookmarkUrl);
+ qDebug() << "hsBookmarkWidget - opening url - " << url << ", " << stat;
+ bool stat = QDesktopServices::openUrl(url);
+ qDebug() << "hsBookmarkWidget - opened url - " << url << ", " << stat;
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::createPrimitives()
+{
+ // Background
+ if (!mBackground) {
+ HbFrameDrawer *drawer = new HbFrameDrawer(
+ QLatin1String("qtg_fr_hsshortcut_normal"), HbFrameDrawer::NinePieces);
+ mBackground = new HbFrameItem(drawer, this);
+ HbStyle::setItemName(mBackground, QLatin1String("background"));
+ }
+
+ // Icon
+ if (!mIcon) {
+ mIcon = new HbIconItem(this);
+ HbStyle::setItemName(mIcon, QLatin1String("icon"));
+ }
+
+ // Text
+ if (!mText) {
+ mText = new HbTextItem(this);
+ HbStyle::setItemName(mText, QLatin1String("text"));
+ }
+
+ // Touch AreaOK
+ if (!mTouchArea) {
+ mTouchArea = new HbTouchArea(this);
+ mTouchArea->installEventFilter(this);
+ HbStyle::setItemName(mTouchArea, QLatin1String("toucharea"));
+ }
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::setBackgroundToNormal()
+{
+ mBackground->frameDrawer().
+ setFrameGraphicsName(QLatin1String("qtg_fr_hsshortcut_normal"));
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::setBackgroundToPressed()
+{
+ mBackground->frameDrawer().
+ setFrameGraphicsName(QLatin1String("qtg_fr_hsitems_pressed"));
+}
+
+/*!
+ \internal
+*/
+void HsBookmarkWidget::updateContent(const QString title, const HbIcon& icon)
+{
+ mIcon->setIcon(icon);
+
+ if (title != "") {
+ mText->setText(title.left(HsBookmarkWidget::maxDisplayLen));
+ }
+}
+
+QImage HsBookmarkWidget::createImageWithOverlay(const QImage& baseImage, const QPoint& point, const QImage& overlayImage)
+{
+ QImage imageWithOverlay = QImage(baseImage.size(), QImage::Format_ARGB32_Premultiplied);
+ QPainter painter(&imageWithOverlay);
+
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(imageWithOverlay.rect(), Qt::transparent);
+
+ painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ painter.drawImage(0, 0, baseImage);
+
+ painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ painter.drawImage(point, overlayImage);
+
+ painter.end();
+
+ return imageWithOverlay;
+}
+
+HbIcon HsBookmarkWidget::createIconWithOverlay(HbIcon& baseIcon, const QPoint& point, HbIcon& overlayIcon)
+{
+
+ // Create overlay image with favicon on top
+ QPixmap basePixmap = baseIcon.pixmap();
+ QPixmap overlayImage = overlayIcon.pixmap();
+
+ QImage imageWithOverlay = createImageWithOverlay(basePixmap.toImage(), point, overlayImage.toImage());
+ QPixmap pixmapWithOverlay = QPixmap::fromImage(imageWithOverlay);
+
+ return HbIcon(QIcon(pixmapWithOverlay));
+}
+
+void HsBookmarkWidget::removeFavicon()
+{
+ QDir faviconDir(mFaviconPath);
+
+ faviconDir.remove(mFaviconFileName);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/hsbookmarkwidgetplugin/src/hsbookmarkwidgetplugin.cpp Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Homescreen bookmark widget
+*
+*/
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "hsbookmarkwidgetplugin.h"
+#include "hsbookmarkwidget.h"
+
+/*!
+ \ingroup group_hsbookmark_widget
+ \class HsBookmarkWidgetPlugin
+ \brief Implementation for homescreen bookmark widget plugin.
+*/
+
+/*!
+ Initialize plugin for bookmark widget. Contains necessary information about
+ the bookmark widget that it can be loaded through QT Service Framework.
+*/
+QObject *HsBookmarkWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session)
+{
+ Q_UNUSED(context);
+ Q_UNUSED(session);
+
+ if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+ return new HsBookmarkWidget();
+ } else {
+ return 0;
+ }
+}
+
+Q_EXPORT_PLUGIN2(hsbookmarkwidgetplugin, HsBookmarkWidgetPlugin)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreen/widgetplugins/widgetplugins.pro Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,27 @@
+#
+# 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
+CONFIG += ordered
+
+# APP subdirs
+SUBDIRS += hsbookmarkwidgetplugin
+
+
--- a/qstmgesturelib/qstmgesturelib.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/qstmgesturelib/qstmgesturelib.pro Mon Oct 04 00:04:54 2010 +0300
@@ -144,3 +144,6 @@
qstmgesturelib.path = /sys/bin
DEPLOYMENT += qstmgesturelib
}
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/rom/browser.iby Fri Sep 17 08:27:10 2010 +0300
+++ b/rom/browser.iby Mon Oct 04 00:04:54 2010 +0300
@@ -57,10 +57,27 @@
data=DATAZ_\private\10008d39\localpages\button_survey.png private\10008d39\localpages\button_survey.png
data=DATAZ_\private\10008d39\localpages\google.png private\10008d39\localpages\google.png
data=DATAZ_\private\10008d39\localpages\nokia_logo.png private\10008d39\localpages\nokia_logo.png
+data=DATAZ_\private\10008d39\backup_registration.xml private\10008d39\backup_registration.xml
/* From sf\mw\browser\bookmarksengine\browsercontentdll\browsercontentdll_template.pkg ***********************/
file=ABI_DIR\BUILD_DIR\browsercontentdll.dll SHARED_LIB_DIR\browsercontentdll.dll
+/* From sf/mw/browser/bookmarks/bookmarksapi_template.pkg ***********************/
+file=ABI_DIR\BUILD_DIR\bookmarksapi.dll SHARED_LIB_DIR\bookmarksapi.dll
+
+/* From \sf\app\browserui\homescreen\widgetplugins\hsbookmarkwidgetplugin\hsbookmarkwidgetplugin_template.pkg ***********************/
+
+file=ABI_DIR\BUILD_DIR\hsbookmarkwidgetplugin.dll SHARED_LIB_DIR\hsbookmarkwidgetplugin.dll
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.qtplugin private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.qtplugin
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.xml private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.xml
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.manifest private\20022F35\import\widgetregistry\200267BE\hsbookmarkwidgetplugin.manifest
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_70x70_ico.png private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_70x70_ico.png
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_70x70_no_ico.png private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_70x70_no_ico.png
+data=DATAZ_\private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_50x50.png private\20022F35\import\widgetregistry\200267BE\nokiabrowser-bm-icon_50x50.png
+
+/* browser rfs plugin */
+data=DATAZ_\RESOURCE_FILES_DIR\browserrfs.txt RESOURCE_FILES_DIR\browserrfs.txt
+ECOM_PLUGIN( browserrfsplugin.dll, browserrfsplugin.rsc )
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/browserresources.iby Mon Oct 04 00:04:54 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __BROWSERRRESOURCES_IBY__
+#define __BROWSERRRESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+//Browser resource file
+data=DATAZ_\QT_TRANSLATIONS_DIR\browserloc.qm QT_TRANSLATIONS_DIR\browserloc.qm
+
+
+#endif
--- a/rom/rom.pro Fri Sep 17 08:27:10 2010 +0300
+++ b/rom/rom.pro Mon Oct 04 00:04:54 2010 +0300
@@ -1,13 +1,16 @@
TEMPLATE = subdirs
SUBDIRS =
+
+# DO NOT auto-generate any deployment files
+
# Generate the rom iby file and the maemo debian install file
# from the template.pkg files already generated by qmake
-symbian {
- exists( $$PWD/../../../../brtools/platform/symbian/install/generate-rom-iby.bat ) {
- system($$PWD/../../../../brtools/platform/symbian/install/generate-rom-iby.bat)
- }
- exists( $$PWD/../../../../brtools/platform/maemo/generate-debian-files.bat ) {
- system($$PWD/../../../../brtools/platform/maemo/generate-debian-files.bat)
- }
-}
+#symbian {
+# exists( $$PWD/../../../../brtools/platform/symbian/install/generate-rom-iby.bat ) {
+# system($$PWD/../../../../brtools/platform/symbian/install/generate-rom-iby.bat)
+# }
+# exists( $$PWD/../../../../brtools/platform/maemo/generate-debian-files.bat ) {
+# system($$PWD/../../../../brtools/platform/maemo/generate-debian-files.bat)
+# }
+#}