# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271418825 -10800 # Node ID 1eb8015a8491b0aa60ba7f3deae395e240308735 # Parent 2cd891dccbbe05cdcce03d32fa748a51cdf4d13f Revision: 201011 Kit: 201015 diff -r 2cd891dccbbe -r 1eb8015a8491 layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + diff -r 2cd891dccbbe -r 1eb8015a8491 symhelp/helpmodel/TestData/Source/ER5Help/General/Symbols page.mbm Binary file symhelp/helpmodel/TestData/Source/ER5Help/General/Symbols page.mbm has changed diff -r 2cd891dccbbe -r 1eb8015a8491 symhelp/helpmodel/documentation/HLPMODEL test code.rtf Binary file symhelp/helpmodel/documentation/HLPMODEL test code.rtf has changed diff -r 2cd891dccbbe -r 1eb8015a8491 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/Userguide.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/Userguide.pro Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,68 @@ +# +# 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 "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: +# + +TEMPLATE = app +QT += webkit xmlpatterns +CONFIG += hb +TRANSLATIONS = userguide.ts common.ts +#add "precompile_header" to CONFIG + +TARGET = Userguide +DEPENDPATH += . +INCLUDEPATH += ./inc + +# PRECOMPILED_HEADER = pch.h + +# Input +HEADERS += inc/HelpMainWindow.h \ + inc/BrowserWrapper.h \ + inc/HelpContentsView.h \ + inc/HelpCategoryView.h \ + inc/HelpDocumentLoader.h \ + inc/HelpCommon.h \ + inc/HelpDataProvider.h \ + inc/HelpUtils.h \ + inc/HelpProxyModel.h \ + inc/HelpStandardItem.h + +SOURCES += src/main.cpp \ + src/HelpMainWindow.cpp \ + src/BrowserWrapper.cpp \ + src/HelpContentsView.cpp \ + src/HelpCategoryView.cpp \ + src/HelpDocumentLoader.cpp \ + src/HelpDataProvider.cpp \ + src/HelpUtils.cpp \ + src/HelpProxyModel.cpp \ + src/HelpStandardItem.cpp + +win32 { + SOURCES += src/HelpUtils_win.cpp +} + +symbian { + TARGET.UID3 = 0x10005234 + TARGET.CAPABILITY = CAP_APPLICATION + TARGET.EPOCHEAPSIZE = 0x020000 0x1000000 + + LIBS += -lezip -lxqservice -lxqserviceutil + include(rom/userguide.pri) +} + +RESOURCES += resources/Userguide.qrc + +debug: DESTDIR = ./debug +release: DESTDIR = ./release diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/BrowserWrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/BrowserWrapper.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,53 @@ +/* +* 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 "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 BROWSERWRAPPER_H +#define BROWSERWRAPPER_H + +#include +#include + +#include + +class BrowserWrapper : public HbWidget +{ + Q_OBJECT + +public: + BrowserWrapper(); + ~BrowserWrapper(); + +public: + void init(); + +public: + void setHtml(const QString& html, const QUrl& baseUrl); + void clearHistory(); + bool canGoBack(); + void back(); + +signals: + void linkClicked(const QUrl &url); + void urlChanged(const QUrl&); + +private: + QGraphicsWebView* mWebView; + QStack mHistory; + +}; + +#endif //MYTEXTBROWSER_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpCategoryView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpCategoryView.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,96 @@ +/* +* 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 "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 HELPCATEGORYVIEW_H +#define HELPCATEGORYVIEW_H + +#include + +#include "HelpCommon.h" + +class HbTreeView; +class HbToolBar; +class HbSearchPanel; + +class HelpCategoryView : public HbView +{ + Q_OBJECT + +public: + HelpCategoryView(); + ~HelpCategoryView(); + void init(); + +private: + void initAllList(); + void initSearchList(); + void initSearchPanel(); + void initToolbar(); + void initBackAction(); + +public: + enum ViewMode + { + ViewModeNull = 0, + ViewModeAll, + ViewModeSearch + }; + void switchViewMode(ViewMode viewMode); + +signals: + void activateView(HelpViewName viewName); + +signals: // from tollbar event + void showAllList(); + void showFindList(); + void showOnlineSupport(); + +private: + void RefreshToolbarText(bool isLandscape); + void RefreshTitlebarVisibility(); + void ResetSearchPanel(); + +private slots: // handle system event + void onCurrentViewChanged(HbView *view); + void onOrientationChanged(Qt::Orientation orientation); + +private slots: // handle button action + void onBackAction(); + +private slots: // handle tollbar event + void onToolbarAll() { emit showAllList(); }; + void onToolbarFind() { emit showFindList(); }; + void onToolbarOnlineSupport() { emit showOnlineSupport(); }; + +private slots: // handle list event + void onAllListActivated(const QModelIndex& index); + void onSearchListActivated(const QModelIndex& index); + +private slots: // handle search panel event + void onSearchPanelExitClicked(); + void onSearchPanelCriteriaChanged(const QString &criteria); + +private: + ViewMode mViewMode; + HbTreeView* mListAll; + HbTreeView* mListSearch; + HbSearchPanel* mSearchPanel; + HbToolBar* mToolBar; + HbAction* mSoftKeyAction; +}; + +#endif //HELPCATEGORYVIEW_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpCommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpCommon.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,88 @@ +/* +* 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 "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 HELPCOMMON_H +#define HELPCOMMON_H + +#include + +// words +const char* const BACKSLASH = "/"; +const char* const SPECIALCHAR = "+"; +const char* const HASHMARK = "#"; + +// help content file name +const char* const XHTMLPATH = "resource/xhtml/"; +const char* const CONTENTSZIP = "contents.zip"; +const char* const INDEXXML = "index.xml"; +const char* const KEYWORDXML = "keywords.xml"; +const char* const METAXML = "meta.xml"; + +// path +const char* const PATH_ROOT = "z:/"; +const char* const PATH_TRANSLATIONS = "Z:/resource/qt/translations/"; + +// URL +const char* const URL_HEADER_APP = "app://"; +const char* const URL_HEADER_HTTP = "http://"; +const char* const URL_HEADER_HTTPS = "https://"; +const char* const URL_HEADER_FTP = "ftp://"; +const char* const URL_HEADER_LOCAL = "file:///"; +const char* const URL_LINK_SUPPORT= "Link to Nokia.com/support"; + +// text +const char* const TXT_TITLE = "txt_user_guide_title_user_guide"; +const char* const TXT_BUTTON_ALL = "txt_common_button_all"; +const char* const TXT_BUTTON_FIND = "txt_common_button_find"; +const char* const TXT_BUTTON_LINK_SUPPORT = "txt_user_guide_button_link_to_nokiacomsupport"; + +// docml +const char* const QRC_DOCML_CATEGORY = ":/xml/categoryView.docml"; +const char* const QRC_DOCML_CONTENTS = ":/xml/contentsView.docml"; +const char* const DOCML_ACTION_ALL = "action_all"; +const char* const DOCML_ACTION_SEARCH = "action_find"; +const char* const DOCML_ACTION_LINK_NOKIA = "action_online_support"; +const char* const DOCML_VIEW_CATEGORY = "view_category"; +const char* const DOCML_VIEW_CONTENTS = "view_contents"; +const char* const DOCML_LIST_CATEGORY_ALL = "list_category_all"; +const char* const DOCML_LIST_CATEGORY_SEARCH = "list_category_search"; +const char* const DOCML_SEARCH_PANEL_CATEGORY = "search_panel_category"; +const char* const DOCML_TOOLBAR = "toolbar"; +const char* const DOCML_BROWSER_CONTENTS = "browser_contents"; +const char* const DOCML_BROWSER = "browser"; +const char* const DOCML_LAYOUT_CATEGORY_ALL = "layout_category_all"; +const char* const DOCML_LAYOUT_CATEGORY_SEARCH = "layout_category_find"; +const char* const DOCML_LAYOUT_CATEGORY_SEARCH_NO_SRHPAL = "layout_category_find_no_searchpanel"; + + +// enum + +enum HelpViewName +{ + HelpViewCategory = 0, + HelpViewContents +}; + +enum HelpItemRole +{ + UidRole = Qt::UserRole + 1, + HrefRole, + KeywordRole +}; + +#endif //HELPCOMMON_H + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpContentsView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpContentsView.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,76 @@ +/* +* 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 "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 HELPCONTENTSVIEW_H +#define HELPCONTENTSVIEW_H + +#include + +#include + +#include "HelpCommon.h" + +class BrowserWrapper; + +class HelpContentsView : public HbView +{ + Q_OBJECT + +public: + HelpContentsView(); + ~HelpContentsView(); + +public: + void init(); + +private: + void initBackAction(); + +signals: + void activateView(HelpViewName viewName); + +signals: // from tollbar event + void showAllList(); + void showFindList(); + void showOnlineSupport(); + +private: + bool openApplication(const QUrl& url); + bool openExternalLink(const QUrl& url); + void openHelpContent(const QUrl& url=QUrl()); + +private slots: // handle system event + void onCurrentViewChanged(HbView *view); + +private slots: // handle button action + void onBackAction(); + +private slots: // handle tollbar event + void onToolbarAll() { emit showAllList(); }; + void onToolbarFind() { emit showFindList(); }; + void onToolbarOnlineSupport() { emit showOnlineSupport(); }; + +private slots: // handle browser event + void onLinkClicked(const QUrl& url); + void onUrlChanged(const QUrl& url); + +private: + BrowserWrapper* mBrowser; + HbAction* mSoftKeyAction; +}; + +#endif //HELPCONTENTSVIEW_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpDataProvider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpDataProvider.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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 "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 HELPDATAPROVIDER_H +#define HELPDATAPROVIDER_H + +class HelpModel; +class HelpItems; +class HelpProxyModel; +class QStandardItemModel; +class HelpStandardItem; + +class HelpDataProvider +{ +private: + HelpDataProvider(); + ~HelpDataProvider(); + +public: + static HelpDataProvider* instance(); + static void destroyInstance(); + +public: + QAbstractItemModel* getCategoryData(); + QAbstractItemModel* getSearchData(const QString& key=QString()); + void setHelpContentUrl(const QString& uid, const QString& href); + void getHelpContentData(QString& content, QString& url); + +private: + void createHelpCategory(); + void createBuiltInCategory(const QString& path); + void constructAppHelp(const QString& path); + void constructKeywordModel(const QString& path); + HelpStandardItem* constructCategory2(const QString& title, const QString& uid); + HelpStandardItem* findItemWithHref(HelpStandardItem* itemParent, const QString& href); + +private: + QStandardItemModel* mHelpModel; //category tree model + QStandardItemModel* mKeywordModel; //keyword list model + HelpProxyModel* mSearhResultModel; //search result proxy model of keyword model + + QString mHelpContentRoot; + +}; + +#endif //HELPDATAPROVIDER_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpDocumentLoader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpDocumentLoader.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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 "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 HELPDOCUMENTLOADER_H +#define HELPDOCUMENTLOADER_H + +#include + +class HelpUIBuilder +{ +public: + static void destroyInstance(); + static QObjectList load(const QString& fileName); + static QObjectList load(const QString& fileName, const QString& section); + static QGraphicsWidget* findWidget(const QString& name); + static QObject* findObject(const QString& name); + +public: + template static T findWidget(const QString& name) { return qobject_cast(findWidget(name)); } + template static T findObject(const QString& name) { return qobject_cast(findObject(name)); } + +private: + static HbDocumentLoader* instance(); +}; + + +#endif //HELPDOCUMENTLOADER_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpMainWindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpMainWindow.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,61 @@ +/* +* 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 "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 HELPMAINWINDOW_H +#define HELPMAINWINDOW_H + +#include + +#include "HelpCommon.h" + +class HelpCategoryView; +class HelpContentsView; + +class HelpMainWindow : public HbMainWindow +{ + Q_OBJECT + +public: + HelpMainWindow(); + ~HelpMainWindow(); + +private slots: + void onActivateView(HelpViewName viewName); + +private: // activate views + void activateCategoryView(); + void activateContentsView(); + void initBackAction(); + +private: + void connectViewSignal(const QObject *object); + +signals: + void backActionSignal(); + +private slots: // handle view event + void onShowAllList(); + void onShowFindList(); + void onShowOnlineSupport(); + +private: + HelpCategoryView* mCategoryView; + HelpContentsView* mContentsView; + +}; + +#endif //HELPMAINWINDOW_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpProxyModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpProxyModel.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 "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 HELPPROXYMODEL_H +#define HELPPROXYMODEL_H + +#include + +class HelpProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + HelpProxyModel(QObject * parent = 0); + ~HelpProxyModel(); + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; +}; + +#endif //HELPPROXYMODEL_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpStandardItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpStandardItem.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,32 @@ +/* +* 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 "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 HELPSTANDARDITEM_H +#define HELPSTANDARDITEM_H + +#include + +class HelpStandardItem : public QStandardItem +{ +public: + HelpStandardItem(const QString& text); + ~HelpStandardItem(); + bool operator<(const QStandardItem & other) const; +}; + +#endif //HELPSTANDARDITEM_H + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/inc/HelpUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/inc/HelpUtils.h Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 "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 HELPUTILS_H +#define HELPUTILS_H + +#include + +class HelpUtils +{ +public: + static void loadHtmlFromZipFile(const QString& path, const QString& htmlFile, QString& htmlContent); + static int launchApplication(const QString& appUid); + static QString rootPath(); + static QString UILocaleFromQtToSymbian(); + static Qt::Orientation defaultOrientation(); + static Qt::SortOrder sortOrder(); +}; + +#endif //HELPUTILS_H diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/resources/Userguide.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/Userguide.qrc Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,14 @@ + + + + xml/categoryView.docml + xml/contentsView.docml + + + + images/qtg_mono_show_all.svg + images/qtg_mono_search.svg + images/qtg_mono_link_nokia.svg + + + \ No newline at end of file diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/resources/images/qtg_mono_link_nokia.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/images/qtg_mono_link_nokia.svg Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,18 @@ + + + +]> + + + + + + + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/resources/images/qtg_mono_search.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/images/qtg_mono_search.svg Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,7 @@ + + + + + + + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/resources/images/qtg_mono_show_all.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/images/qtg_mono_show_all.svg Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,21 @@ + + + +]> + + + + + + + + + + + + + + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/rom/userguide.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/rom/userguide.iby Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,31 @@ +# 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 "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: +# Rom exports for Help +# + +#ifndef __HELP_IBY__ +#define __HELP_IBY__ + +#include + +#define HB_UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc Private\10003a3f\import\apps\ ## NAME ## _reg.rsc + +file=ABI_DIR\BUILD_DIR\Userguide.exe SHARED_LIB_DIR\Userguide.exe + +HB_UPGRADABLE_APP_REG_RSC(Userguide) +S60_APP_RESOURCE(Userguide) + +#endif + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/rom/userguide.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/rom/userguide.pri Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,29 @@ +# 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 "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: +# Rom exports for Help +# + +symbian { + HELP_IBY_DIR = $$section(PWD, ":", 1) + + exists(/epoc32/include/platform_paths.hrh) { + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + } else { + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + } + + BLD_INF_RULES.prj_exports += "$$HELP_IBY_DIR/userguide.iby CORE_APP_LAYER_IBY_EXPORT_PATH(userguide.iby)" + BLD_INF_RULES.prj_exports += "$$HELP_IBY_DIR/userguide_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(userguide_resources.iby)" +} diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/rom/userguide_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/rom/userguide_resources.iby Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,28 @@ +/* +* 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 "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 USERGUIDE_RESOURCES +#define USERGUIDE_RESOURCES + + +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\userguide.qm QT_TRANSLATIONS_DIR\userguide.qm +data=DATAZ_\APP_RESOURCE_DIR\Userguide.RSC APP_RESOURCE_DIR\Userguide.rsc + + +#endif // USERGUIDE_RESOURCES \ No newline at end of file diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/BrowserWrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/BrowserWrapper.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,80 @@ +/* +* 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 "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: +* +*/ + +#include +#include +#include + +#include "HelpDocumentLoader.h" +#include "HelpCommon.h" +#include "BrowserWrapper.h" + +BrowserWrapper::BrowserWrapper() +{ +} + +BrowserWrapper::~BrowserWrapper() +{ +} + +void BrowserWrapper::init() +{ + mWebView = new QGraphicsWebView(); + mWebView->setZoomFactor(1.5); + mWebView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + connect(mWebView, SIGNAL(linkClicked(const QUrl&)), this, SIGNAL(linkClicked(const QUrl&))); + + QGraphicsLinearLayout* vLayout = new QGraphicsLinearLayout(this); + vLayout->setOrientation(Qt::Vertical); + vLayout->addItem(mWebView); + vLayout->setContentsMargins(0,0,0,0); + setLayout(vLayout); +} + +void BrowserWrapper::setHtml(const QString& html, const QUrl& baseUrl) +{ + mWebView->setHtml(html, baseUrl); + + if(!mHistory.count() || mHistory.top()!=baseUrl) + { + mHistory.append(baseUrl); + } +} + +void BrowserWrapper::clearHistory() +{ + mHistory.clear(); +} + +bool BrowserWrapper::canGoBack() +{ + return (mHistory.count() > 1); +} + +void BrowserWrapper::back() +{ + if(canGoBack()) + { + mHistory.pop(); + QUrl url = mHistory.top(); + emit urlChanged(url); + } +} + + +// end of file + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpCategoryView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpCategoryView.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,245 @@ +/* +* 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 "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: +* +*/ + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "HelpDocumentLoader.h" +#include "HelpDataProvider.h" +#include "HelpProxyModel.h" + +#include "HelpCategoryView.h" + + +////////////////////////////////////////////////////////////////////////////////////////////// + +HelpCategoryView::HelpCategoryView() : +mViewMode(ViewModeNull), +mListAll(NULL), +mListSearch(NULL), +mSearchPanel(NULL), +mToolBar(NULL) +{ +} + +HelpCategoryView::~HelpCategoryView() +{ +} + + +//////////////////////////////////////////////////////////////////////////////////////////// + +void HelpCategoryView::init() +{ + initBackAction(); + initAllList(); + initSearchList(); + initSearchPanel(); + initToolbar(); + + switchViewMode(ViewModeAll); + + connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*))); + connect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(onOrientationChanged(Qt::Orientation))); +} + +void HelpCategoryView::initBackAction() +{ + mSoftKeyAction = new HbAction(Hb::BackAction); + connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction())); +} + +void HelpCategoryView::initAllList() +{ + mListAll = HelpUIBuilder::findWidget(DOCML_LIST_CATEGORY_ALL); + mListAll->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); + mListAll->setModel(HelpDataProvider::instance()->getCategoryData()); + connect(mListAll, SIGNAL(activated(const QModelIndex&)), this, SLOT(onAllListActivated(const QModelIndex&))); +} + +void HelpCategoryView::initSearchList() +{ + mListSearch = HelpUIBuilder::findWidget(DOCML_LIST_CATEGORY_SEARCH); + mListSearch->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); + mListSearch->setModel(HelpDataProvider::instance()->getSearchData()); + connect(mListSearch, SIGNAL(activated(const QModelIndex&)), this, SLOT(onSearchListActivated(const QModelIndex&))); +} +void HelpCategoryView::initSearchPanel() +{ + mSearchPanel = HelpUIBuilder::findWidget(DOCML_SEARCH_PANEL_CATEGORY); + connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(onSearchPanelExitClicked())); + connect(mSearchPanel, SIGNAL(criteriaChanged(const QString&)), this, SLOT(onSearchPanelCriteriaChanged(const QString&))); +} + +void HelpCategoryView::initToolbar() +{ + mToolBar = HelpUIBuilder::findWidget(DOCML_TOOLBAR); + + HbAction* allAction = HelpUIBuilder::findObject(DOCML_ACTION_ALL); + HbAction* findAction = HelpUIBuilder::findObject(DOCML_ACTION_SEARCH); + QActionGroup* toolBarActionGroup = new QActionGroup(mToolBar); + allAction->setActionGroup(toolBarActionGroup); + findAction->setActionGroup(toolBarActionGroup); +} + + +//////////////////////////////////////////////////////////////////////////////////////////// + +void HelpCategoryView::switchViewMode(ViewMode viewMode) +{ + if(ViewModeNull == viewMode) return; + + mViewMode = viewMode; + if(ViewModeAll == viewMode) + { + HelpUIBuilder::load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_ALL); + } + else if(ViewModeSearch == viewMode) + { + HelpUIBuilder::load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH); + } + + RefreshTitlebarVisibility(); +} + + +//////////////////////////////////////////////////////////////////////////////////////////// + +void HelpCategoryView::RefreshToolbarText(bool isLandscape) +{ + HbAction* tollbarAction = HelpUIBuilder::findObject(DOCML_ACTION_ALL); + tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_ALL) : QString()); + + tollbarAction = HelpUIBuilder::findObject(DOCML_ACTION_SEARCH); + tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_FIND) : QString()); + + tollbarAction = HelpUIBuilder::findObject(DOCML_ACTION_LINK_NOKIA); + tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_LINK_SUPPORT) : QString()); +} + +void HelpCategoryView::RefreshTitlebarVisibility() +{ + setTitleBarVisible(!(mSearchPanel->isVisible())); +} + +void HelpCategoryView::ResetSearchPanel() +{ + foreach(QGraphicsItem *obj, mSearchPanel->childItems()) + { + QGraphicsWidget *const widget = static_cast(obj); + if(widget != NULL) + { + HbLineEdit *const lineEdit = qobject_cast(widget); + if(lineEdit != NULL) + { + lineEdit->setText(""); + break; + } + } + } +} + +//////////////////////////////////////////////////////////////////////////////////////////// +// handle system event + +void HelpCategoryView::onCurrentViewChanged(HbView *view) +{ + if(this == view) + { + setNavigationAction(mSoftKeyAction); + } +} + +void HelpCategoryView::onOrientationChanged(Qt::Orientation orientation) +{ + bool isLandscape = (Qt::Horizontal==orientation); + RefreshToolbarText(isLandscape); +} + + +/////////////////////////////////////////////////////////////////////////////////////// +// handle button back action + +void HelpCategoryView::onBackAction() +{ + if(this == mainWindow()->currentView()) + { + HbApplication::exit(); + } +} + + +//////////////////////////////////////////////////////////////////////////////////////////// +// handle list event + +void HelpCategoryView::onAllListActivated(const QModelIndex& index) +{ + if(!index.isValid() || // invalid + index.child(0,0).isValid()) // this is a node + { + return; + } + + QString uid = mListAll->model()->data(index.parent(), UidRole).toString(); + QString href = mListAll->model()->data(index, HrefRole).toString(); + HelpDataProvider::instance()->setHelpContentUrl(uid, href); + emit activateView(HelpViewContents); +} + +void HelpCategoryView::onSearchListActivated(const QModelIndex& index) +{ + if(!index.isValid() || // invalid + index.child(0,0).isValid()) // this is a node + { + return; + } + + QString uid = mListSearch->model()->data(index, UidRole).toString(); + QString href = mListSearch->model()->data(index, HrefRole).toString(); + HelpDataProvider::instance()->setHelpContentUrl(uid, href); + emit activateView(HelpViewContents); +} + + +//////////////////////////////////////////////////////////////////////////////////////////// +// handle search panel event + +void HelpCategoryView::onSearchPanelExitClicked() +{ + setTitleBarVisible(true); + HelpUIBuilder::load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH_NO_SRHPAL); +} + +void HelpCategoryView::onSearchPanelCriteriaChanged(const QString &criteria) +{ + mListSearch->setModel(HelpDataProvider::instance()->getSearchData(criteria)); + mListSearch->update(); +} + + +// end of file diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpContentsView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpContentsView.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,164 @@ +/* +* 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 "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: +* +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "BrowserWrapper.h" +#include "HelpDocumentLoader.h" +#include "HelpDataProvider.h" +#include "HelpUtils.h" +#include "HelpContentsView.h" + +HelpContentsView::HelpContentsView() : mBrowser(NULL) +{ +} + +HelpContentsView::~HelpContentsView() +{ +} + +void HelpContentsView::init() +{ + initBackAction(); + mBrowser = HelpUIBuilder::findWidget(DOCML_BROWSER_CONTENTS); + mBrowser->init(); + + connect(mBrowser, SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&))); + connect(mBrowser, SIGNAL(urlChanged(const QUrl&)), this, SLOT(onUrlChanged(const QUrl&))); + connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*))); +} + +void HelpContentsView::initBackAction() +{ + mSoftKeyAction = new HbAction(Hb::BackAction); + connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction())); +} + +/////////////////////////////////////////////////////////////////////////////////////// + +bool HelpContentsView::openApplication(const QUrl& url) +{ + QString str = url.toString(); + if(str.startsWith(URL_HEADER_APP)) + { + //app://cmd@localhost/APP_NAME/APP_UID + QString appUid = str.section(BACKSLASH, -1,-1); + if(appUid.contains("0x", Qt::CaseInsensitive)) + { + appUid.remove(0,2); + } + int error = HelpUtils::launchApplication(appUid); + if(error != 0) + { + qDebug() << "AIW-ERROR: AppMgrClient:test: Send failed" << error; + } + return true; + } + + return false; +} + +bool HelpContentsView::openExternalLink(const QUrl& url) +{ + QString str = url.toString(); + if(str.startsWith(URL_HEADER_HTTP) || + str.startsWith(URL_HEADER_HTTPS) || + str.startsWith(URL_HEADER_FTP)) + { + return true; + } + + return false; +} + +void HelpContentsView::openHelpContent(const QUrl& url) +{ + QString html; + QString baseUrl = url.toString(); + HelpDataProvider::instance()->getHelpContentData(html, baseUrl); + mBrowser->setHtml(html, baseUrl); +} + +//////////////////////////////////////////////////////////////////////////////////////////// + +void HelpContentsView::onCurrentViewChanged(HbView *view) +{ + if(this == view) + { + setNavigationAction(mSoftKeyAction); + openHelpContent(); + } + else + { + mBrowser->clearHistory(); + } +} + +/////////////////////////////////////////////////////////////////////////////////////// + +void HelpContentsView::onBackAction() +{ + if(this == mainWindow()->currentView()) + { + if(mBrowser->canGoBack()) + { + mBrowser->back(); + } + else + { + emit activateView(HelpViewCategory); + } + } +} + +/////////////////////////////////////////////////////////////////////////////////////// + +void HelpContentsView::onLinkClicked(const QUrl& url) +{ + // try to open as application + if(openApplication(url)) + { + return; + } + + // try to open as remote link + if(openExternalLink(url)) + { + return; + } + + // try to open as local link + { + openHelpContent(url); + return; + } +} + +void HelpContentsView::onUrlChanged(const QUrl& url) +{ + openHelpContent(url); +} + + +// end of file diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpDataProvider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpDataProvider.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,383 @@ +/* +* 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 "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: +* +*/ + +#include +#include +#include +#include +#include +#include + +#include "HelpUtils.h" +#include "HelpCommon.h" +#include "HelpProxyModel.h" +#include "HelpStandardItem.h" + +#include "HelpDataProvider.h" + + +HelpDataProvider::HelpDataProvider() +{ + mHelpModel = new QStandardItemModel(); + mKeywordModel = new QStandardItemModel(); + mSearhResultModel = NULL; +} + +HelpDataProvider::~HelpDataProvider() +{ + delete mHelpModel; + delete mSearhResultModel; + delete mKeywordModel; +} + + +/////////////////////////////////////////////////////////////////////////////////////// + +HelpDataProvider* gHelpDataProviderInstance = NULL; + +HelpDataProvider* HelpDataProvider::instance() +{ + if(!gHelpDataProviderInstance) + { + gHelpDataProviderInstance = new HelpDataProvider(); + } + + return gHelpDataProviderInstance; +} + +void HelpDataProvider::destroyInstance() +{ + delete gHelpDataProviderInstance; + gHelpDataProviderInstance = NULL; +} + + +/////////////////////////////////////////////////////////////////////////////////////// + +QAbstractItemModel* HelpDataProvider::getCategoryData() +{ + if(!mHelpModel->rowCount()) + { + createHelpCategory(); + } + + return mHelpModel; +} + +QAbstractItemModel* HelpDataProvider::getSearchData(const QString& key) +{ + delete mSearhResultModel; + mSearhResultModel = NULL; + + mSearhResultModel = new HelpProxyModel();; + mSearhResultModel->setSourceModel(mKeywordModel); + mSearhResultModel->setFilterRole(KeywordRole); + mSearhResultModel->setFilterRegExp(key); + + return mSearhResultModel; +} + +void HelpDataProvider::setHelpContentUrl(const QString& uid, const QString& href) +{ + QUrl url = QUrl::fromLocalFile(uid+BACKSLASH+href); + mHelpContentRoot = url.toString(); +} + +void HelpDataProvider::getHelpContentData(QString& content, QString& url) +{ + // url + if(url.isEmpty()) + { + url = mHelpContentRoot; + } + url.remove(URL_HEADER_LOCAL); + + // uid + QString uid = url.section(BACKSLASH, 0, -3); + uid.append(BACKSLASH + url.section(BACKSLASH, -2,-2)); + + // href + QString href = url.section(BACKSLASH, -1,-1); + int anchorPos = href.indexOf(HASHMARK); + if(anchorPos != -1) + { + href = href.section(HASHMARK, 0, 0); + } + + QString path(uid); + path.append(BACKSLASH); + path.append(CONTENTSZIP); + HelpUtils::loadHtmlFromZipFile(path , href, content); +} + + +/////////////////////////////////////////////////////////////////////////////////////// + +void HelpDataProvider::createHelpCategory() +{ + QFileInfoList driveList = QDir::drives(); + QDir dir; + QString lang = HelpUtils::UILocaleFromQtToSymbian(); + + QString path(HelpUtils::rootPath()); + path.append(XHTMLPATH); + path.append(lang); + + //construct help in rom + createBuiltInCategory(path); + + //scan other root path and construct 3rd party help + foreach(QFileInfo fi, driveList) + { + path.clear(); + path.append(fi.absolutePath()); + path.append(XHTMLPATH); + path.append(lang); + dir.setPath(path); + if(dir.exists()) + { + if(QString::compare(fi.absolutePath(), HelpUtils::rootPath(), Qt::CaseInsensitive) == 0) + { + continue; + } + constructAppHelp(path); + } + } +} + +void HelpDataProvider::createBuiltInCategory(const QString& path) +{ + QString pathIndex(path); + pathIndex.append(BACKSLASH); + pathIndex.append(INDEXXML); + + QFile file(pathIndex); + if (!file.open(QIODevice::ReadOnly)) { + return; + } + + //parse index xml to a stringlist, each string include id and navtitle and seperate by "specilchar" + QXmlQuery query; + query.bindVariable("inputdoc", &file); + QXmlItem xmlItem(SPECIALCHAR); + query.bindVariable("specilchar", xmlItem); + query.setQuery("doc($inputdoc)/collections/collection/ \ + string-join((xs:string(@id), xs:string(@navtitle)), $specilchar)"); + + if(!query.isValid()) + { + return; + } + QStringList strLst; + if(!query.evaluateTo(&strLst)) + { + return; + } + + foreach(QString str, strLst) + { + QStringList temp; + temp = str.split(SPECIALCHAR); + QString uid(path); + uid.append(BACKSLASH); + uid.append(temp[0]); + HelpStandardItem* item = constructCategory2(temp[1], uid); + if(item) + { + mHelpModel->appendRow(item); + constructKeywordModel(uid); + } + } + file.close(); + mHelpModel->sort(0, HelpUtils::sortOrder()); +} + +HelpStandardItem* HelpDataProvider::constructCategory2(const QString& title, const QString& uid) +{ + QString pathIndex(uid); + pathIndex.append(BACKSLASH); + pathIndex.append(INDEXXML); + + QFile file(pathIndex); + if (!file.open(QIODevice::ReadOnly)) { + return NULL; + } + + //parse index xml to a stringlist, each string include href and navtitle and seperate by "specilchar" + QXmlQuery query; + QXmlItem xmlItem(SPECIALCHAR); + query.bindVariable("inputdoc", &file); + query.bindVariable("specilchar", xmlItem); + query.setQuery("doc($inputdoc)/topics/topicref/ \ + string-join((xs:string(@href), xs:string(@navtitle)), $specilchar)"); + if(!query.isValid()) + { + return NULL; + } + + QStringList strLst; + if(!query.evaluateTo(&strLst)) + { + return NULL; + } + if(strLst.count() <= 0) + { + return NULL; + } + + HelpStandardItem* itemParent = NULL; + itemParent = new HelpStandardItem(title); + itemParent->setData(uid, UidRole); + foreach(QString str, strLst) + { + QStringList temp; + temp = str.split(SPECIALCHAR); + HelpStandardItem* item = new HelpStandardItem(temp[1]); + item->setData(temp[0], HrefRole); + itemParent->appendRow(item); + } + + file.close(); + itemParent->sortChildren(0, HelpUtils::sortOrder()); + return itemParent; +} + +void HelpDataProvider::constructAppHelp(const QString& path) +{ + QDir dir(path); + if(!dir.exists()) + { + return; + } + + QStringList uidList = dir.entryList(); + HelpStandardItem* itemApp = NULL; + QString pathTemp; + foreach(QString uid, uidList) + { + pathTemp.clear(); + pathTemp.append(path); + pathTemp.append(BACKSLASH); + pathTemp.append(uid); + pathTemp.append(BACKSLASH); + pathTemp.append(METAXML); + QFile file(pathTemp); + if (!file.open(QIODevice::ReadOnly)) { + continue; + } + + //parse meta xml, get the title string + QXmlQuery query; + query.bindVariable("inputdoc", &file); + query.setQuery("doc($inputdoc)/meta/string(title)"); + if(!query.isValid()) + { + continue; + } + QString titleStr; + if(!query.evaluateTo(&titleStr)) + { + continue; + } + + pathTemp.clear(); + pathTemp.append(path); + pathTemp.append(BACKSLASH); + pathTemp.append(uid); + HelpStandardItem* item = constructCategory2(titleStr, pathTemp); + if(item) + { + if(!itemApp) + { + itemApp = new HelpStandardItem("Applications"); + } + itemApp->appendRow(item); + constructKeywordModel(pathTemp); + } + file.close(); + } + + if(itemApp) + { + itemApp->sortChildren(0, HelpUtils::sortOrder()); + mHelpModel->appendRow(itemApp); + } +} + +void HelpDataProvider::constructKeywordModel(const QString& path) +{ + QString pathKeyword(path); + pathKeyword.append(BACKSLASH); + pathKeyword.append(KEYWORDXML); + + QFile file(pathKeyword); + if (!file.open(QIODevice::ReadOnly)) { + return; + } + + //construct keyword model, title and keyword is one to more + QXmlStreamReader reader(&file); + QString keyword; + QString title; + + while (!reader.atEnd()) { + if (!reader.readNextStartElement()) + { + continue; + } + if (reader.name() == "text") + { + keyword = reader.readElementText(); + } + else if (reader.name() == "target") + { + QString href = reader.attributes().value("href").toString(); + HelpStandardItem* item = findItemWithHref((HelpStandardItem *)(mKeywordModel->invisibleRootItem()), href); + QStringList keywordLst; + if(item) + { + keywordLst = item->data(KeywordRole).toStringList(); + keywordLst.append(keyword); + item->setData(keywordLst,KeywordRole); + } + else + { + item = new HelpStandardItem(reader.readElementText()); + item->setData(path, UidRole); + item->setData(href, HrefRole); + + keywordLst.append(keyword); + item->setData(keywordLst,KeywordRole); + mKeywordModel->appendRow(item); + } + } + } + file.close(); + mKeywordModel->sort(0, HelpUtils::sortOrder()); +} + +HelpStandardItem* HelpDataProvider::findItemWithHref(HelpStandardItem* itemParent, const QString& href) +{ + for(int i = 0; i < itemParent->rowCount(); i++) + { + if(QString::compare(itemParent->child(i)->data(HrefRole).toString(), href, Qt::CaseInsensitive) == 0) + { + return (HelpStandardItem *)(itemParent->child(i)); + } + } + return NULL; +} diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpDocumentLoader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpDocumentLoader.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,109 @@ +/* +* 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 "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: +* +*/ + +#include "HelpCategoryView.h" +#include "HelpContentsView.h" +#include "BrowserWrapper.h" + +#include "HelpDocumentLoader.h" + + +//////////////////////////////////////////////////////////////////////////////////////////// + +class HelpDocumentLoader : public HbDocumentLoader +{ +private: + virtual QObject* createObject(const QString& type, const QString& name); +}; + +QObject* HelpDocumentLoader::createObject(const QString& type, const QString& name) +{ + if(type == HelpCategoryView::staticMetaObject.className()) + { + QObject* object = new HelpCategoryView; + object->setObjectName(name); + return object; + } + + if(type == HelpContentsView::staticMetaObject.className()) + { + QObject* object = new HelpContentsView; + object->setObjectName(name); + return object; + } + + if(type == BrowserWrapper::staticMetaObject.className()) + { + QObject* object = new BrowserWrapper; + object->setObjectName(name); + return object; + } + + return HbDocumentLoader::createObject(type, name); +} + + +//////////////////////////////////////////////////////////////////////////////////////////// + +HbDocumentLoader* gHelpUIBuilderInstance = NULL; + +HbDocumentLoader* HelpUIBuilder::instance() +{ + if(!gHelpUIBuilderInstance) + { + gHelpUIBuilderInstance = new HelpDocumentLoader(); + } + + return gHelpUIBuilderInstance; +} + +void HelpUIBuilder::destroyInstance() +{ + delete gHelpUIBuilderInstance; + gHelpUIBuilderInstance = NULL; +} + +QObjectList HelpUIBuilder::load(const QString& fileName) +{ + bool ok = false; + QObjectList list = instance()->load(fileName, &ok); + Q_ASSERT_X(ok, "Help", "HelpUIBuilder load file"); + return list; +} + +QObjectList HelpUIBuilder::load(const QString& fileName, const QString& section) +{ + bool ok = false; + QObjectList list = instance()->load(fileName, section, &ok); + Q_ASSERT_X(ok, "Help", "HelpUIBuilder load section"); + return list; +} + +QGraphicsWidget* HelpUIBuilder::findWidget(const QString& name) +{ + return instance()->findWidget(name); +} + +QObject* HelpUIBuilder::findObject(const QString& name) +{ + return instance()->findObject(name); +} + + + +// end of file + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpMainWindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpMainWindow.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,122 @@ +/* +* 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 "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: +* +*/ + +#include +#include + +#include "HelpCategoryView.h" +#include "HelpContentsView.h" + +#include "HelpMainWindow.h" +#include "HelpDocumentLoader.h" +#include "HelpDataProvider.h" + +HelpMainWindow::HelpMainWindow() : +mCategoryView(NULL), +mContentsView(NULL) +{ + activateCategoryView(); +} + +HelpMainWindow::~HelpMainWindow() +{ + HelpUIBuilder::destroyInstance(); + HelpDataProvider::destroyInstance(); +} + +void HelpMainWindow::onActivateView(HelpViewName viewName) +{ + switch(viewName) + { + case HelpViewCategory: + activateCategoryView(); + break; + + case HelpViewContents: + activateContentsView(); + break; + + default: + break; + } +} + +void HelpMainWindow::activateCategoryView() +{ + if(!mCategoryView) + { + HelpUIBuilder::load(QRC_DOCML_CATEGORY); + mCategoryView = HelpUIBuilder::findWidget(DOCML_VIEW_CATEGORY); + addView(mCategoryView); + mCategoryView->init(); + emit currentViewChanged(mCategoryView); + connectViewSignal(mCategoryView); + } + + setCurrentView(mCategoryView); +} + +void HelpMainWindow::activateContentsView() +{ + if(!mContentsView) + { + HelpUIBuilder::load(QRC_DOCML_CONTENTS); + mContentsView = HelpUIBuilder::findWidget(DOCML_VIEW_CONTENTS); + addView(mContentsView); + mContentsView->init(); + + connectViewSignal(mContentsView); + } + + setCurrentView(mContentsView); +} + +void HelpMainWindow::connectViewSignal(const QObject *object) +{ + connect(object, SIGNAL(activateView(HelpViewName)), this, SLOT(onActivateView(HelpViewName))); + + connect(object, SIGNAL(showAllList()), this, SLOT(onShowAllList())); + connect(object, SIGNAL(showFindList()), this, SLOT(onShowFindList())); + connect(object, SIGNAL(showOnlineSupport()), this, SLOT(onShowOnlineSupport())); +} + + +//////////////////////////////////////////////////////////////////////////////////// +// handle view event + +void HelpMainWindow::onShowAllList() +{ + activateCategoryView(); + mCategoryView->switchViewMode(HelpCategoryView::ViewModeAll); +} + +void HelpMainWindow::onShowFindList() +{ + activateCategoryView(); + mCategoryView->switchViewMode(HelpCategoryView::ViewModeSearch); +} + +void HelpMainWindow::onShowOnlineSupport() +{ + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setParent(this); + notificationDialog->setTitle(URL_LINK_SUPPORT); + notificationDialog->show(); +} + +// end of file + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpProxyModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpProxyModel.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 "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: +* +*/ + +#include +#include + +#include + +#include "HelpCommon.h" +#include "HelpProxyModel.h" + +HelpProxyModel::HelpProxyModel(QObject * parent):QSortFilterProxyModel(parent) +{ +} + +HelpProxyModel::~HelpProxyModel() +{ +} + +bool HelpProxyModel::filterAcceptsRow(int sourceRow, + const QModelIndex &sourceParent) const +{ + QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); + + switch(filterRole()) + { + case KeywordRole: + { + QStringList keywordLst = sourceModel()->data(index, KeywordRole).toStringList(); + + foreach(QString str, keywordLst) + { + if(HbStringUtil::findC(str, filterRegExp().pattern()) != -1) + { + return true; + } + } + return false; + } + default: + return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent); + } +} diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpStandardItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpStandardItem.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,49 @@ +/* +* 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 "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: +* +*/ + +#include + +#include "HelpCommon.h" +#include "HelpStandardItem.h" + +HelpStandardItem::HelpStandardItem(const QString& text) : QStandardItem(text) +{ +} + +HelpStandardItem::~HelpStandardItem() +{ +} + +bool HelpStandardItem::operator<(const QStandardItem & other) const +{ + const int role = model() ? model()->sortRole() : Qt::DisplayRole; + switch(role) + { + case Qt::DisplayRole: + if(HbStringUtil::compareC(text(), other.text()) < 0) + { + return true; + } + break; + case UidRole: + case HrefRole: + case KeywordRole: + default: + return QStandardItem::operator<(other); + } + return false; +} diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpUtils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpUtils.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,251 @@ +/* +* 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 "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: +* +*/ + +#include +#include +#include + +#include "HelpUtils.h" + + +///////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef Q_OS_SYMBIAN + +#include +#include +#include +#include + +void LoadFileFromZipL(const TDesC& aZipName, const TDesC& aFileName, QString& desBuffer) + { + + // open the zip file + RFs& fs = CEikonEnv::Static()->FsSession(); + CZipFile* zipFile = CZipFile::NewL(fs, aZipName); + CleanupStack::PushL(zipFile); + TInt err = zipFile->OpenL(); + + if(err == KErrNone) + { + CZipFileMember* member = zipFile->MemberL(aFileName); + if(member) // member exist + { + CleanupStack::PushL(member); + + RZipFileMemberReaderStream* stream; + zipFile->GetInputStreamL(member, stream); + CleanupStack::PushL(stream); + + HBufC8* buffer = HBufC8::NewLC(member->UncompressedSize()); + TPtr8 ptr(buffer->Des()); + User::LeaveIfError(stream->Read(ptr, member->UncompressedSize())); + + QByteArray byteArray((const char*)buffer->Ptr(), buffer->Length()); + desBuffer.append(byteArray); + + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PopAndDestroy(stream); + CleanupStack::PopAndDestroy(member); + } + } + + zipFile->Close(); + CleanupStack::PopAndDestroy(zipFile); + + } + +void FixPathSlash(TDes& aPath) + { + for(TInt i=0; i iso_to_symbian_map; + iso_to_symbian_map.insert("en_GB" ,ELangEnglish); + iso_to_symbian_map.insert("fr_FR" ,ELangFrench); + iso_to_symbian_map.insert("de_DE" ,ELangGerman); + iso_to_symbian_map.insert("es_ES" ,ELangSpanish); + iso_to_symbian_map.insert("it_IT" ,ELangItalian); + iso_to_symbian_map.insert("sv_SE" ,ELangSwedish); + iso_to_symbian_map.insert("da_DK" ,ELangDanish); + iso_to_symbian_map.insert("no_NO" ,ELangNorwegian); + iso_to_symbian_map.insert("fi_FI" ,ELangFinnish); + iso_to_symbian_map.insert("en_US" ,ELangAmerican); + iso_to_symbian_map.insert("fr_CH" ,ELangSwissFrench); + iso_to_symbian_map.insert("de_CH" ,ELangSwissGerman); + iso_to_symbian_map.insert("pt_PT" ,ELangPortuguese); + iso_to_symbian_map.insert("tr_TR" ,ELangTurkish); + iso_to_symbian_map.insert("is_IS" ,ELangIcelandic); + iso_to_symbian_map.insert("ru_RU" ,ELangRussian); + iso_to_symbian_map.insert("hu_HU" ,ELangHungarian); + iso_to_symbian_map.insert("nl_NL" ,ELangDutch); + iso_to_symbian_map.insert("nl_BE" ,ELangBelgianFlemish); + iso_to_symbian_map.insert("en_AU" ,ELangAustralian); + iso_to_symbian_map.insert("fr_BE" ,ELangBelgianFrench); + iso_to_symbian_map.insert("de_AT" ,ELangAustrian); + iso_to_symbian_map.insert("en_NZ" ,ELangNewZealand); + iso_to_symbian_map.insert("fr" ,ELangInternationalFrench); + iso_to_symbian_map.insert("cs_CZ" ,ELangCzech); + iso_to_symbian_map.insert("sk_SK" ,ELangSlovak); + iso_to_symbian_map.insert("pl_PL" ,ELangPolish); + iso_to_symbian_map.insert("sl_SI" ,ELangSlovenian); + iso_to_symbian_map.insert("zh_TW" ,ELangTaiwanChinese); + iso_to_symbian_map.insert("zh_HK" ,ELangHongKongChinese); + iso_to_symbian_map.insert("zh_CN" ,ELangPrcChinese); + iso_to_symbian_map.insert("ja_JP" ,ELangJapanese); + iso_to_symbian_map.insert("th_TH" ,ELangThai); + iso_to_symbian_map.insert("af" ,ELangAfrikaans); + iso_to_symbian_map.insert("sq_AL" ,ELangAlbanian); + iso_to_symbian_map.insert("am_ET" ,ELangAmharic); + iso_to_symbian_map.insert("ar_AE" ,ELangArabic); + iso_to_symbian_map.insert("hy_AM" ,ELangArmenian); + iso_to_symbian_map.insert("tl_PH" ,ELangTagalog); + iso_to_symbian_map.insert("be_BY" ,ELangBelarussian); + iso_to_symbian_map.insert("bn" ,ELangBengali); + iso_to_symbian_map.insert("bg_BG" ,ELangBulgarian); + iso_to_symbian_map.insert("my_MM" ,ELangBurmese); + iso_to_symbian_map.insert("ca_ES" ,ELangCatalan); + iso_to_symbian_map.insert("hr_HR" ,ELangCroatian); + iso_to_symbian_map.insert("en_CA" ,ELangCanadianEnglish); + iso_to_symbian_map.insert( "en" ,ELangInternationalEnglish); + iso_to_symbian_map.insert("en_ZA" ,ELangSouthAfricanEnglish); + iso_to_symbian_map.insert("et_EE" ,ELangEstonian); + iso_to_symbian_map.insert("fa_IR" ,ELangFarsi); + iso_to_symbian_map.insert("fr_CA" ,ELangCanadianFrench); + iso_to_symbian_map.insert("gd_GB" ,ELangScotsGaelic); + iso_to_symbian_map.insert("ka_GE" ,ELangGeorgian); + iso_to_symbian_map.insert("el_GR" ,ELangGreek); + iso_to_symbian_map.insert("el_GR" ,ELangCyprusGreek); + iso_to_symbian_map.insert("gu_IN" ,ELangGujarati); + iso_to_symbian_map.insert("he_IL" ,ELangHebrew); + iso_to_symbian_map.insert("hi_IN" ,ELangHindi); + iso_to_symbian_map.insert("id_ID" ,ELangIndonesian); + iso_to_symbian_map.insert("ga_IE" ,ELangIrish); + iso_to_symbian_map.insert("it_CH" ,ELangSwissItalian); + iso_to_symbian_map.insert("kn_IN" ,ELangKannada); + iso_to_symbian_map.insert("kk_KZ" ,ELangKazakh); + iso_to_symbian_map.insert("km_KH" ,ELangKhmer); + iso_to_symbian_map.insert("ko_KR" ,ELangKorean); + iso_to_symbian_map.insert("lo_LA" ,ELangLao); + iso_to_symbian_map.insert("lv_LV" ,ELangLatvian); + iso_to_symbian_map.insert("lt_LT" ,ELangLithuanian); + iso_to_symbian_map.insert("mk_MK" ,ELangMacedonian); + iso_to_symbian_map.insert("ms_MY" ,ELangMalay); + iso_to_symbian_map.insert("ml_IN" ,ELangMalayalam); + iso_to_symbian_map.insert("mr_IN" ,ELangMarathi); + iso_to_symbian_map.insert("mo_MD" ,ELangMoldavian); + iso_to_symbian_map.insert("mn_MN" ,ELangMongolian); + iso_to_symbian_map.insert("nn_NO" ,ELangNorwegianNynorsk); + iso_to_symbian_map.insert("pt_BR" ,ELangBrazilianPortuguese); + iso_to_symbian_map.insert("pa" ,ELangPunjabi); + iso_to_symbian_map.insert("ro_RO" ,ELangRomanian); + iso_to_symbian_map.insert("sr_YU" ,ELangSerbian); + iso_to_symbian_map.insert("si_LK" ,ELangSinhalese); + iso_to_symbian_map.insert("so_SO" ,ELangSomali); + iso_to_symbian_map.insert( "es" ,ELangInternationalSpanish); + iso_to_symbian_map.insert( "es" ,ELangLatinAmericanSpanish); + iso_to_symbian_map.insert("sw" ,ELangSwahili); + iso_to_symbian_map.insert("sv_FI" ,ELangFinlandSwedish); + iso_to_symbian_map.insert("ta_IN" ,ELangTamil); + iso_to_symbian_map.insert("te_IN" ,ELangTelugu); + iso_to_symbian_map.insert("bo_CN" ,ELangTibetan); + iso_to_symbian_map.insert("ti_ER" ,ELangTigrinya); + iso_to_symbian_map.insert("tr_GR" ,ELangCyprusTurkish); + iso_to_symbian_map.insert("tk_TM" ,ELangTurkmen); + iso_to_symbian_map.insert("uk_UA" ,ELangUkrainian); + iso_to_symbian_map.insert("ur_PK" ,ELangUrdu); + iso_to_symbian_map.insert("vi_VN" ,ELangVietnamese); + iso_to_symbian_map.insert("cy_GB" ,ELangWelsh); + iso_to_symbian_map.insert("zu_ZA" ,ELangZulu); + iso_to_symbian_map.insert("st_LS" ,ELangSouthSotho); + iso_to_symbian_map.insert("eu_ES" ,ELangBasque); + iso_to_symbian_map.insert("gl_ES" ,ELangGalician); + iso_to_symbian_map.insert("en" ,ELangEnglish_Apac); + iso_to_symbian_map.insert("en_TW" ,ELangEnglish_Taiwan); + iso_to_symbian_map.insert("en_HK" ,ELangEnglish_HongKong); + iso_to_symbian_map.insert("en_CN" ,ELangEnglish_Prc); + iso_to_symbian_map.insert("en_JP" ,ELangEnglish_Japan); + iso_to_symbian_map.insert("en_TH" ,ELangEnglish_Thailand); + iso_to_symbian_map.insert("ms" ,ELangMalay_Apac); + + QString langName = QLocale::system().name(); + return QString("%1").arg(iso_to_symbian_map.value(langName),2,10,QChar('0')); +#else + return QString("%1").arg(1,2,10,QChar('0')); +#endif +} + +int HelpUtils::launchApplication(const QString& appUid) +{ +#ifdef Q_OS_SYMBIAN + + QString uriStr("appto://"); + uriStr.append(appUid); + QUrl uri(uriStr); + + XQApplicationManager appmgr; + XQAiwRequest* req5 = appmgr.create(uri, false); + + QList args; + args << uri.encodedQuery(); + req5->setArguments(args); + + if (!req5->send()) + { + return req5->lastError(); + } +#endif + return 0; +} + +Qt::Orientation HelpUtils::defaultOrientation() +{ + return Qt::Vertical; +} + +Qt::SortOrder HelpUtils::sortOrder() +{ + return Qt::AscendingOrder; +} + +// end of file diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/HelpUtils_win.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpUtils_win.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,27 @@ +/* +* 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 "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: +* +*/ + +#include "HelpUtils.h" + +void HelpUtils::loadHtmlFromZipFile(const QString& path, const QString& htmlFile, QString& htmlContent) +{ + Q_UNUSED(path); + Q_UNUSED(htmlFile); + Q_UNUSED(htmlContent); + return; +} + diff -r 2cd891dccbbe -r 1eb8015a8491 userguide/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/main.cpp Fri Apr 16 14:53:45 2010 +0300 @@ -0,0 +1,50 @@ +/* +* 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 "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: +* +*/ + +#include +#include +#include + +#include + +#include "HelpCommon.h" +#include "HelpMainWindow.h" + +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + + QString lang = QLocale::system().name(); + + // init translator with current system language + QTranslator* translatorCommon = new QTranslator(); + translatorCommon->load("common_"+lang, PATH_TRANSLATIONS); + qApp->installTranslator(translatorCommon); + + QTranslator* translatorSelf = new QTranslator(); + translatorSelf->load("userguide_"+lang, PATH_TRANSLATIONS); + qApp->installTranslator(translatorSelf); + + app.setApplicationName(hbTrId(TXT_TITLE)); + + HelpMainWindow mainWindow; + mainWindow.show(); + + return app.exec(); +} + +// end of file