# HG changeset patch # User William Roberts <williamr@symbian.org> # Date 1279812658 -3600 # Node ID 3ae60d69bf222caf1c819876925251551b1e7932 # Parent e70b37c1a9d5efe28f399489ad64a5a909c9511f# Parent 4533d75b8d4e5b3e8ed45d48cd7d486012ba74f1 Catchup to latest Symbian^4 diff -r e70b37c1a9d5 -r 3ae60d69bf22 helps_info/helps_metadata/helps_metadata.mrp --- a/helps_info/helps_metadata/helps_metadata.mrp Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -# -# 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: -# - -component helps_metadata -source \sf\app\helps\helps_info\helps_metadata -source \sf\app\helps\package_definition.xml -source \sf\app\helps\distribution.policy.s60 -notes_source \component_defs\release.src -ipr T diff -r e70b37c1a9d5 -r 3ae60d69bf22 layers.sysdef.xml --- a/layers.sysdef.xml Fri Jun 11 16:23:42 2010 +0100 +++ b/layers.sysdef.xml Thu Jul 22 16:30:58 2010 +0100 @@ -9,6 +9,9 @@ <module name="helps"> <unit name="helps" unitID="abs.helps" bldFile="&layer_real_source_path;/userguide" mrp="" proFile="Userguide.pro" /> </module> + <module name="symhelp"> + <unit name="symhelp" unitID="abs.symhelp" bldFile="&layer_real_source_path;/symhelp/helpmodel/group" mrp="" /> + </module> </layer> </systemModel> </SystemDefinition> diff -r e70b37c1a9d5 -r 3ae60d69bf22 package_definition.xml --- a/package_definition.xml Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<SystemDefinition schema="3.0.0"> - <package id="helps" name="Help Apps" levels="eng tools if ui"> - <collection id="csxhelp" name="Context Sensitive Extended Help" level="if"> - <component id="aiwhelpprovider" filter="s60" name="AIW Help Provider" class="plugin"> - <!-- <unit bldFile="csxhelp/aiwhelpprovider/group"/> --> - </component> - <component id="csxhelp_build" filter="s60" name="Context Sensitive Extended Help Build"> - <unit bldFile="csxhelp/group"/> - </component> - </collection> - <collection id="symhelp" name="Symbian Help" level="eng"> - <component id="helpmodel" name="Help" introduced="6.0" purpose="optional"> - <unit bldFile="symhelp/helpmodel/group" mrp="symhelp/helpmodel/group/app-services_hlpmodel.mrp"/> - </component> - </collection> - <collection id="helps_info" name="Help Apps Info" level="ui"> - <component id="helps_metadata" name="Help Apps Metadata" class="config" introduced="^2" purpose="development" target="desktop"> - <unit mrp="helps_info/helps_metadata/helps_metadata.mrp"/> - </component> - </collection> - </package> -</SystemDefinition> diff -r e70b37c1a9d5 -r 3ae60d69bf22 symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.tmp Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE cshproj PUBLIC "/EPOC32/tools/cshlpcmp/dtd/CSHproj.dtd" "SYSTEM"> -<?xml:stylesheet href="/EPOC32/tools/cshlpcmp/xsl/CSHproj.xsl" title="CS-Help project" type="text/xsl"?> -<cshproj> - <helpfileUID>0x10006000</helpfileUID> - <directories> - <input>\work\help\</input> - <output>\epoc32\wins\c\system\help\</output> - <graphics>\work\help\</graphics> - <working>\work\help\temp\</working> - </directories> - <files> - <source> - <file>agen-hlp.rtf</file> - <file>bomb-hlp.rtf</file> - <file>calc-hlp.rtf</file> - <file>comm-hlp.rtf</file> - <file>cont-hlp.rtf</file> - <file>data-hlp.rtf</file> - <file>dial-hlp.rtf</file> - <file>dict-hlp.rtf</file> - <file>gen--hlp.rtf</file> - <file>hard-hlp.rtf</file> - <file>jott-hlp.rtf</file> - <file>prog-hlp.rtf</file> - <file>rec--hlp.rtf</file> - <file>shet-hlp.rtf</file> - <file>sket-hlp.rtf</file> - <file>spel-hlp.rtf</file> - <file>syst-hlp.rtf</file> - <file>time-hlp.rtf</file> - <file>word-hlp.rtf</file> - <file>xtra-hlp.rtf</file> - </source> - <destination>EPOCHlp</destination> - <customization>\work\help\uk.alc.xml</customization> - </files> -</cshproj> diff -r e70b37c1a9d5 -r 3ae60d69bf22 symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.xml.bak --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.xml.bak Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE cshproj PUBLIC "/EPOC32/tools/cshlpcmp/dtd/CSHproj.dtd" "SYSTEM"> -<?xml:stylesheet href="/EPOC32/tools/cshlpcmp/xsl/CSHproj.xsl" title="CS-Help project" type="text/xsl"?> -<cshproj> - <helpfileUID>0x10006000</helpfileUID> - <directories> - <input>H:\aleppo\work\help\</input> - <output>H:\epoc32\wins\c\system\help\</output> - <graphics>H:\aleppo\work\help\</graphics> - <working>H:\aleppo\work\help\temp\</working> - </directories> - <files> - <source> - <file>sket-hlp.rtf</file> - </source> - <destination>EPOCHlp</destination> - <customization>H:\aleppo\work\help\uk.alc.xml</customization> - </files> -</cshproj> diff -r e70b37c1a9d5 -r 3ae60d69bf22 symhelp/helpmodel/TestData/Source/ER5Help/epochlp.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.tmp Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -inputdirectory c:\aleppo\work\help\ -outputdirectory c:\epoc32\wins\c\documents\ -outputfile EPOCHlp -sourcefile agen-hlp bomb-hlp calc-hlp comm-hlp cont-hlp data-hlp dial-hlp dict-hlp gen--hlp hard-hlp jott-hlp prog-hlp rec--hlp shet-hlp sket-hlp spel-hlp syst-hlp time-hlp word-hlp xtra-hlp -orderfile EPOCHlp.order -graphicsdirectory c:\aleppo\work\help\ -workingdirectory c:\aleppo\work\help\temp\ -customizationfile c:\aleppo\work\help\uk.alc diff -r e70b37c1a9d5 -r 3ae60d69bf22 symhelp/helpmodel/TestData/Source/ER5Help/uk.alc.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/uk.alc.tmp Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE cshcust PUBLIC "/EPOC32/tools/cshlpcmp/dtd/CSHcush.dtd" "SYSTEM"> -<?xml:stylesheet href="/EPOC32/tools/cshlpcmp/xsl/CSHcust.xsl" title="CS-Help customisation" type="text/xsl"?> -<cshcust> -<bodystyle fontstyle="sansserif" size="10"/> -<titlestyle fontstyle="sansserif" size="14"/> -<listbullet1style bulletchar="149"></listbullet1style> -<listbullet2style bulletchar="45"></listbullet2style> -<tipeffects leftindent="36"><b>Tip:</b></tipeffects> -<noteeffects leftindent="36"><b>Note:</b></noteeffects> -<importanteffects leftindent="60"><b>Important:</b></importanteffects> -</cshcust> diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/Userguide.pro --- a/userguide/Userguide.pro Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/Userguide.pro Thu Jul 22 16:30:58 2010 +0100 @@ -58,11 +58,13 @@ TARGET.CAPABILITY = CAP_APPLICATION TARGET.EPOCHEAPSIZE = 0x020000 0x1000000 - LIBS += -lezip -lxqservice -lxqserviceutil + CONFIG += mobility + MOBILITY = systeminfo + LIBS += -lezip -lxqservice -lxqserviceutil -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lavkon -lefsrv -lcharconv -lws32 -lhal -lgdi -lapgrfx include(rom/userguide.pri) + SKINICON = qtg_large_help } - -ICON = resources/qtg_large_help.svg + RESOURCES += resources/Userguide.qrc debug: DESTDIR = ./debug diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/BrowserWrapper.h --- a/userguide/inc/BrowserWrapper.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/BrowserWrapper.h Thu Jul 22 16:30:58 2010 +0100 @@ -35,7 +35,7 @@ void init(); public: - void setHtml(const QString& html, const QUrl& baseUrl); + void setHtml(const QString& html, const QUrl& url); void clearHistory(); bool canGoBack(); void back(); diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpBaseView.h --- a/userguide/inc/HelpBaseView.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpBaseView.h Thu Jul 22 16:30:58 2010 +0100 @@ -45,18 +45,12 @@ void onToolbarFind() { emit showFindList(); }; void onToolbarOnlineSupport(); -private slots: - void onOrientationChanged(Qt::Orientation orientation); - protected: void initBaseDocMl(); protected: HelpUIBuilder mBuilder; HbToolBar* mToolBar; - -private: - void RefreshToolbarText(Qt::Orientation orientation); }; #endif //HELPBATHVIEW_H diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpCommon.h --- a/userguide/inc/HelpCommon.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpCommon.h Thu Jul 22 16:30:58 2010 +0100 @@ -20,6 +20,8 @@ #include <Qt> +//const +const int APPPRIORITY = 2001; // words const char* const BACKSLASH = "/"; const char* const SPECIALCHAR = "+"; @@ -92,6 +94,7 @@ enum HelpItemRole { UidRole = Qt::UserRole + 1, + PriorityRole, HrefRole, KeywordRole }; diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpContentsView.h --- a/userguide/inc/HelpContentsView.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpContentsView.h Thu Jul 22 16:30:58 2010 +0100 @@ -47,7 +47,7 @@ void openHelpContent(const QUrl& url=QUrl()); private slots: // handle system event - void onCurrentViewChanged(HbView *view); + void onViewReady(); private slots: // handle button action void onBackAction(); diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpDataProvider.h --- a/userguide/inc/HelpDataProvider.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpDataProvider.h Thu Jul 22 16:30:58 2010 +0100 @@ -35,27 +35,42 @@ static void destroyInstance(); public: + void createHelpCategory(); 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); + //construct 1st category + void constructCategory(); + //construct help category in rom + void constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList); + //construct help category for 3rd party application + void constructAppCategory(const QString& path, QStringList& uidList); + void constructBuiltInCategoryItem(const QString& uid, const QString& title); + + //construct 2nd category + void constructCategory2(HelpStandardItem* itemParent); + void constructCategory2Item(HelpStandardItem* itemParent); + + //construct keyword list void constructKeywordModel(const QString& title, const QString& uid, const QString& href); -// void searchInAllData(HelpStandardItem* item, const QString& key=QString()); -// void searchInResult(const QString& key=QString()); - HelpStandardItem* constructCategory2(const QString& title, const QString& uid); - HelpStandardItem* findItemWithHref(HelpStandardItem* itemParent, const QString& href); + + //parse xml + void parseCategoryIndexXml(const QString& path, QStringList& uidList, QStringList& titleList); + void parseCategory2IndexXml(const QString& path, QStringList& hrefList, QStringList& titleList); + void parseBuiltInMetaxml(const QString& path, int& priority); + void parseAppMetaxml(const QString& path, QString& title); private: QStandardItemModel* mHelpModel; //category tree model QStandardItemModel* mKeywordModel; //keyword list model - HelpProxyModel* mSearhResultModel; //search result proxy model of keyword model + HelpProxyModel* mSearhResultModel; //search result proxy model of keyword model + HelpStandardItem* mAppItem; QString mHelpContentRoot; QString mLastSrhKey; + QStringList mUpdateUidList; }; diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpKeywordView.h --- a/userguide/inc/HelpKeywordView.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpKeywordView.h Thu Jul 22 16:30:58 2010 +0100 @@ -25,7 +25,7 @@ class HbListView; class HbSearchPanel; class HbStaticVkbHost; -class HbGroupBox; +class HbLabel; class HelpKeywordView : public HelpBaseView { @@ -42,18 +42,22 @@ void initSearchList(); void initSearchPanel(); void initBackAction(); - void initEmptyLabel(); void initVirtualKeyboard(); - + private: - HbGroupBox* groupBox(); + HbLabel* label(); private: void updateVisibleItems(bool visible); void ResetSearchPanel(); + void updateLabelPos(); + void showToolBar(bool visible); + +private slots: + void onOrientationChanged(Qt::Orientation orientation); private slots: // handle system event - void onCurrentViewChanged(HbView *view); + void onViewReady(); private slots: // handle button action void onBackAction(); diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpMainWindow.h --- a/userguide/inc/HelpMainWindow.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpMainWindow.h Thu Jul 22 16:30:58 2010 +0100 @@ -38,6 +38,7 @@ private slots: void onActivateView(HelpViewName viewName); + void saveActivity(); private: // activate views void activateCategoryView(); diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/inc/HelpUtils.h --- a/userguide/inc/HelpUtils.h Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/inc/HelpUtils.h Thu Jul 22 16:30:58 2010 +0100 @@ -25,6 +25,7 @@ public: static void loadHtmlFromZipFile(const QString& path, const QString& htmlFile, QString& htmlContent); static int launchApplication(const QString& appUid); + static bool suppportFeatureID(int featureID); static QString rootPath(); static QString UILocaleFromQtToSymbian(); static Qt::Orientation defaultOrientation(); diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/resources/Userguide.qrc --- a/userguide/resources/Userguide.qrc Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/resources/Userguide.qrc Thu Jul 22 16:30:58 2010 +0100 @@ -6,10 +6,4 @@ <file alias="contentsView.docml">xml/contentsView.docml</file> <file alias="baseView.docml">xml/baseView.docml</file> </qresource> - - <qresource prefix= "/images"> - <file alias="show_all.svg">images/qtg_mono_show_all.svg</file> - <file alias="link_nokia.svg">images/qtg_mono_link_nokia.svg</file> - </qresource> - </RCC> \ No newline at end of file diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/resources/qtg_large_help.svg --- a/userguide/resources/qtg_large_help.svg Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> -<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<rect fill="none" height="60" width="60"/> -<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1" x1="30" x2="30" y1="8.16" y2="51.02"> -<stop offset="0" stop-color="#E5FFB2"/> -<stop offset="0.39" stop-color="#6AAB18"/> -<stop offset="0.68" stop-color="#247307"/> -<stop offset="1" stop-color="#C2FF4A"/> -</linearGradient> -<circle cx="29.998" cy="29.385" fill="url(#SVGID_1)" r="21.427"/> -<radialGradient cx="30.2" cy="10.41" gradientUnits="userSpaceOnUse" id="SVGID_2" r="39.38"> -<stop offset="0" stop-color="#AFED23"/> -<stop offset="0.81" stop-color="#358C0C"/> -<stop offset="1" stop-color="#67AD1A"/> -</radialGradient> -<path d="M29.998,50.2c-11.478,0-20.815-9.337-20.815-20.814S18.521,8.571,29.998,8.571 c11.477,0,20.814,9.337,20.814,20.815S41.475,50.2,29.998,50.2L29.998,50.2z" fill="url(#SVGID_2)"/> -<path d="M23.264,21.626v-3.515c2.128-0.49,4.146-0.735,6.06-0.735 c2.821,0,4.986,0.547,6.492,1.642c1.507,1.093,2.26,2.697,2.26,4.815c0,1.231-0.291,2.274-0.869,3.129 c-0.581,0.854-4.583,4.875-4.978,5.425c-0.396,0.55-0.592,1.201-0.592,1.955v0.752h-5.615V34.09c0-1.22,0.267-2.25,0.799-3.094 c0.532-0.843,1.461-1.887,2.789-3.13c1.041-0.969,2.332-3.217,2.332-3.695c0-2.163-1.303-3.245-3.91-3.245 C26.562,20.927,24.974,21.16,23.264,21.626z M28.803,44.69c-0.944,0-1.757-0.335-2.439-1.005c-0.68-0.67-1.021-1.488-1.021-2.457 c0-0.957,0.338-1.775,1.013-2.457c0.676-0.682,1.491-1.022,2.447-1.022c0.957,0,1.775,0.341,2.458,1.022s1.022,1.5,1.022,2.457 c0,0.969-0.341,1.787-1.022,2.457C30.58,44.355,29.76,44.69,28.803,44.69z" fill-opacity="0.2" stroke-opacity="0.2"/> -<path d="M23.264,20.78v-3.515c2.128-0.49,4.146-0.735,6.06-0.735 c2.821,0,4.986,0.547,6.492,1.642c1.507,1.093,2.26,2.697,2.26,4.815c0,1.231-0.291,2.274-0.869,3.129 c-0.581,0.854-4.583,4.875-4.978,5.425c-0.396,0.55-0.592,1.202-0.592,1.954v0.754h-5.615v-1.005c0-1.22,0.267-2.251,0.799-3.094 c0.532-0.843,1.461-1.887,2.789-3.13c1.041-0.969,2.332-3.217,2.332-3.695c0-2.163-1.303-3.245-3.91-3.245 C26.562,20.081,24.974,20.314,23.264,20.78z M28.803,43.844c-0.944,0-1.757-0.334-2.439-1.004c-0.68-0.67-1.021-1.489-1.021-2.458 c0-0.956,0.338-1.775,1.013-2.457c0.676-0.682,1.491-1.022,2.447-1.022c0.957,0,1.775,0.341,2.458,1.022 c0.683,0.681,1.022,1.501,1.022,2.457c0,0.969-0.341,1.788-1.022,2.458C30.58,43.51,29.76,43.844,28.803,43.844z" fill-opacity="0.2" stroke-opacity="0.2"/> -<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3" x1="30.67" x2="30.67" y1="15.45" y2="42.99"> -<stop offset="0" stop-color="#F6FDFF"/> -<stop offset="1" stop-color="#ADB3B5"/> -</linearGradient> -<path d="M23.264,19.79v-3.515c2.128-0.491,4.146-0.735,6.06-0.735c2.821,0,4.986,0.546,6.492,1.642 c1.507,1.093,2.26,2.697,2.26,4.814c0,1.232-0.291,2.274-0.869,3.129C36.625,25.98,32.623,30,32.229,30.55 c-0.396,0.55-0.592,1.202-0.592,1.955v0.753h-5.615v-1.005c0-1.22,0.267-2.25,0.799-3.093c0.532-0.843,1.461-1.887,2.789-3.13 c1.041-0.968,2.332-3.216,2.332-3.694c0-2.163-1.303-3.245-3.91-3.245C26.562,19.091,24.974,19.323,23.264,19.79z M28.803,42.854 c-0.944,0-1.757-0.334-2.439-1.004c-0.68-0.67-1.021-1.489-1.021-2.457c0-0.957,0.338-1.775,1.013-2.458 c0.676-0.681,1.491-1.022,2.447-1.022c0.957,0,1.775,0.342,2.458,1.022c0.683,0.682,1.022,1.501,1.022,2.458 c0,0.968-0.341,1.787-1.022,2.457C30.58,42.52,29.76,42.854,28.803,42.854z" fill="url(#SVGID_3)"/> -<rect fill="none" height="59.996" width="59.996"/> -</svg> diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/resources/xml/baseView.docml --- a/userguide/resources/xml/baseView.docml Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/resources/xml/baseView.docml Thu Jul 22 16:30:58 2010 +0100 @@ -2,13 +2,13 @@ <hbdocument version="0.9"> <object name="help_config" type="QObject"> <object name="action_all" type="HbAction"> - <icon name="icon" iconName=":/images/show_all.svg" /> + <icon name="icon" iconName="qtg_mono_help_all" /> </object> <object name="action_find" type="HbAction"> <icon name="icon" iconName="qtg_mono_search" /> </object> <object name="action_online_support" type="HbAction"> - <icon name="icon" iconName=":/images/link_nokia.svg" /> + <icon name="icon" iconName="qtg_mono_online_support" /> </object> </object> diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/resources/xml/keywordView.docml --- a/userguide/resources/xml/keywordView.docml Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/resources/xml/keywordView.docml Thu Jul 22 16:30:58 2010 +0100 @@ -1,126 +1,99 @@ <?xml version="1.0" encoding="UTF-8"?> -<hbdocument version="1.0"> - +<hbdocument version="1.1"> <widget name="view_help" type="HbView"> <widget name="content" role="HbView:widget" type="HbWidget"> - <widget name="no_match_label" type="HbLabel"> - <rect height="83.33582un" name="geometry" width="51.04478un" x="1.34328un" y="1.34328un"/> - <string locid="txt_user_guide_list_no_match_found" name="plainText" value="Label"/> - <enums name="alignment" value="AlignVCenter|AlignHCenter"/> - <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/> - </widget> - <widget name="groupBox" type="HbGroupBox"> - <bool name="collapsable" value="FALSE"/> - <string locid="txt_user_guide_setlabel_search" name="heading" value="Group Box"/> - </widget> <widget name="list_search" type="HbListView"> <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/> + <sizehint height="85.52239un" type="PREFERRED" width="45.8209un"/> + <rect height="63.20149un" name="geometry" width="51.04478un" x="1.64179un" y="11.79105un"/> + <bool name="visible" value="FALSE"/> </widget> - <widget name="search_panel" type="HbSearchPanel"/> + <widget name="search_panel" type="HbSearchPanel"> + <rect height="9.3806un" name="geometry" width="51.04478un" x="1.79104un" y="75.22388un"/> + <bool name="visible" value="FALSE"/> + </widget> + <widget name="no_match_label" type="HbLabel"> + <real name="z" value="1"/> + <string locid="txt_user_guide_list_no_match_found" name="plainText" value="Label"/> + <enums name="alignment" value="AlignTop|AlignHCenter"/> + <fontspec name="fontSpec" role="Primary" textheight="26.8"/> + <bool name="visible" value="FALSE"/> + </widget> </widget> <string locid="txt_user_guide_title_user_guide" name="title" value="View"/> </widget> - <section name="layout_find"> - <widget name="view_help" type="HbView"> - <widget name="content" role="HbView:widget" type="HbWidget"> - <widget name="groupBox" type="HbGroupBox"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="no_match_label" type="HbLabel"> - <bool name="visible" value="FALSE"/> - </widget> - <widget name="list_search" type="HbListView"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="search_panel" type="HbSearchPanel"> - <bool name="visible" value="TRUE"/> - </widget> - <real name="z" value="0"/> - <layout orientation="Vertical" type="linear"> - <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/> - <linearitem itemname="groupBox"/> - <linearitem itemname="list_search"/> - <linearitem itemname="search_panel"/> - </layout> - </widget> + <widget name="list_search" type="HbListView"> + <bool name="visible" value="TRUE"/> + </widget> + <widget name="content" role="HbView:widget" type="HbWidget"> + <layout orientation="Vertical" type="linear"> + <linearitem itemname="list_search"/> + <linearitem itemname="search_panel"/> + </layout> + </widget> + <widget name="search_panel" type="HbSearchPanel"> + <bool name="visible" value="TRUE"/> + </widget> + <widget name="no_match_label" type="HbLabel"> + <bool name="visible" value="FALSE"/> </widget> </section> - <section name="layout_find_no_searchpanel"> - <widget name="view_help" type="HbView"> - <widget name="content" role="HbView:widget" type="HbWidget"> - <widget name="groupBox" type="HbGroupBox"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="no_match_label" type="HbLabel"> - <bool name="visible" value="FALSE"/> - </widget> - <widget name="list_search" type="HbListView"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="search_panel" type="HbSearchPanel"> - <bool name="visible" value="FALSE"/> - </widget> - <real name="z" value="0"/> - <layout orientation="Vertical" type="linear"> - <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/> - <linearitem itemname="groupBox"/> - <linearitem itemname="list_search"/> - </layout> - </widget> + <widget name="list_search" type="HbListView"> + <bool name="visible" value="TRUE"/> + </widget> + <widget name="content" role="HbView:widget" type="HbWidget"> + <layout orientation="Vertical" type="linear"> + <linearitem itemname="list_search"/> + </layout> + </widget> + <widget name="search_panel" type="HbSearchPanel"> + <bool name="visible" value="FALSE"/> + </widget> + <widget name="no_match_label" type="HbLabel"> + <bool name="visible" value="FALSE"/> </widget> </section> - <section name="layout_find_no_match"> - <widget name="view_help" type="HbView"> - <widget name="content" role="HbView:widget" type="HbWidget"> - <widget name="groupBox" type="HbGroupBox"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="no_match_label" type="HbLabel"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="list_search" type="HbListView"> - <bool name="visible" value="FALSE"/> - </widget> - <widget name="search_panel" type="HbSearchPanel"> - <bool name="visible" value="TRUE"/> - </widget> - <real name="z" value="0"/> - <layout orientation="Vertical" type="linear"> - <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/> - <linearitem itemname="groupBox"/> - <linearitem itemname="no_match_label"/> - <linearitem itemname="search_panel"/> - </layout> - </widget> + <widget name="list_search" type="HbListView"> + <bool name="visible" value="FALSE"/> + </widget> + <widget name="content" role="HbView:widget" type="HbWidget"> + <layout orientation="Vertical" type="linear"> + <linearitem itemname="no_match_label"/> + <linearitem itemname="search_panel"/> + </layout> + </widget> + <widget name="search_panel" type="HbSearchPanel"> + <bool name="visible" value="TRUE"/> + </widget> + <widget name="no_match_label" type="HbLabel"> + <bool name="visible" value="TRUE"/> </widget> </section> - <section name="layout_find_no_searchpanel_no_match"> - <widget name="view_help" type="HbView"> - <widget name="content" role="HbView:widget" type="HbWidget"> - <widget name="groupBox" type="HbGroupBox"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="no_match_label" type="HbLabel"> - <bool name="visible" value="TRUE"/> - </widget> - <widget name="list_search" type="HbListView"> - <bool name="visible" value="FALSE"/> - </widget> - <widget name="search_panel" type="HbSearchPanel"> - <bool name="visible" value="FALSE"/> - </widget> - <real name="z" value="0"/> - <layout orientation="Vertical" type="linear"> - <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/> - <linearitem itemname="groupBox"/> - <linearitem itemname="no_match_label"/> - </layout> - </widget> + <widget name="list_search" type="HbListView"> + <bool name="visible" value="FALSE"/> + </widget> + <widget name="content" role="HbView:widget" type="HbWidget"> + <layout orientation="Vertical" type="linear"> + <linearitem itemname="no_match_label"/> + </layout> + </widget> + <widget name="search_panel" type="HbSearchPanel"> + <bool name="visible" value="FALSE"/> + </widget> + <widget name="no_match_label" type="HbLabel"> + <bool name="visible" value="TRUE"/> </widget> </section> - + <metadata activeUIState="search_no_match_no_panel" display="NHD-3.2-inch_portrait" unit="un"> + <uistate name="Common ui state" sections="#common"/> + <uistate name="search" sections="#common layout_find"/> + <uistate name="search_no_panel" sections="#common layout_find_no_searchpanel"/> + <uistate name="search_no_match" sections="#common layout_find_no_match"/> + <uistate name="search_no_match_no_panel" sections="#common layout_find_no_searchpanel_no_match"/> + <dummydata objectName="list_search" section="#common" value="app_list_template5"/> + </metadata> </hbdocument> diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/resources/xml/toolbar.docml --- a/userguide/resources/xml/toolbar.docml Fri Jun 11 16:23:42 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<hbdocument version="0.9"> - <object name="help_config" type="QObject"> - <object name="action_all" type="HbAction"> - <icon name="icon" iconName=":/images/show_all.svg" /> - </object> - <object name="action_find" type="HbAction"> - <icon name="icon" iconName="qtg_mono_search" /> - </object> - <object name="action_online_support" type="HbAction"> - <icon name="icon" iconName=":/images/link_nokia.svg" /> - </object> - </object> - - <widget name="toolbar" type="HbToolBar"> - <ref object="action_all" role="HbToolBar:addAction" /> - <ref object="action_find" role="HbToolBar:addAction" /> - <ref object="action_online_support" role="HbToolBar:addAction" /> - </widget> - -</hbdocument> \ No newline at end of file diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/rom/userguide.iby --- a/userguide/rom/userguide.iby Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/rom/userguide.iby Thu Jul 22 16:30:58 2010 +0100 @@ -1,19 +1,19 @@ -# 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 -# +/* +* 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 __HELP_IBY__ #define __HELP_IBY__ @@ -25,8 +25,11 @@ file=ABI_DIR\BUILD_DIR\Userguide.exe SHARED_LIB_DIR\Userguide.exe data = DATAZ_\APP_RESOURCE_DIR\Userguide.mif APP_RESOURCE_DIR\Userguide.mif + + + + HB_UPGRADABLE_APP_REG_RSC(Userguide) -S60_APP_RESOURCE(Userguide) #endif diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/rom/userguide.pri --- a/userguide/rom/userguide.pri Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/rom/userguide.pri Thu Jul 22 16:30:58 2010 +0100 @@ -17,13 +17,7 @@ symbian { HELP_IBY_DIR = $$section(PWD, ":", 1) - - exists(/epoc32/include/platform_paths.hrh) { - BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" - } else { - BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <domain\osextensions\platform_paths.hrh>" - } - + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" 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 e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/BrowserWrapper.cpp --- a/userguide/src/BrowserWrapper.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/BrowserWrapper.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -49,13 +49,13 @@ setLayout(vLayout); } -void BrowserWrapper::setHtml(const QString& html, const QUrl& baseUrl) +void BrowserWrapper::setHtml(const QString& html, const QUrl& url) { - mWebView->setHtml(html, baseUrl); + mWebView->setHtml(html, url); - if(!mHistory.count() || mHistory.top()!=baseUrl) + if(!mHistory.count() || mHistory.top()!=url) { - mHistory.append(baseUrl); + mHistory.append(url); } } diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpBaseView.cpp --- a/userguide/src/HelpBaseView.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpBaseView.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -57,22 +57,5 @@ notificationDialog->show(); } -void HelpBaseView::onOrientationChanged(Qt::Orientation orientation) -{ - RefreshToolbarText(orientation); -} - -void HelpBaseView::RefreshToolbarText(Qt::Orientation orientation) -{ - bool isLandscape = (Qt::Horizontal==orientation); - HbAction* tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_ALL); - tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_ALL) : QString()); - - tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_SEARCH); - tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_FIND) : QString()); - - tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_LINK_NOKIA); - tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_LINK_SUPPORT) : QString()); -} // end of file diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpCategoryView.cpp --- a/userguide/src/HelpCategoryView.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpCategoryView.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -25,6 +25,7 @@ #include <hbtreeview.h> #include <hbscrollbar.h> #include <hbmenu.h> +#include <hbtoolbar.h> #include "HelpDataProvider.h" diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpContentsView.cpp --- a/userguide/src/HelpContentsView.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpContentsView.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -46,7 +46,7 @@ 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*))); + connect(mainWindow(), SIGNAL(viewReady()), this, SLOT(onViewReady())); } void HelpContentsView::initDocMl() @@ -101,18 +101,17 @@ void HelpContentsView::openHelpContent(const QUrl& url) { QString html; - QString baseUrl = url.toString(); - HelpDataProvider::instance()->getHelpContentData(html, baseUrl); - mBrowser->setHtml(html, baseUrl); + QString urlStr = url.toString(); + HelpDataProvider::instance()->getHelpContentData(html, urlStr); + mBrowser->setHtml(html, urlStr); } //////////////////////////////////////////////////////////////////////////////////////////// -void HelpContentsView::onCurrentViewChanged(HbView *view) +void HelpContentsView::onViewReady() { - if(this == view) + if(isVisible()) { - setVisible(true); setNavigationAction(mSoftKeyAction); openHelpContent(); } diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpDataProvider.cpp --- a/userguide/src/HelpDataProvider.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpDataProvider.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -36,6 +36,7 @@ mKeywordModel = new QStandardItemModel(); mSearhResultModel = new HelpProxyModel(); mSearhResultModel->setSourceModel(mKeywordModel); + mAppItem = NULL; } HelpDataProvider::~HelpDataProvider() @@ -71,35 +72,15 @@ QAbstractItemModel* HelpDataProvider::getCategoryData() { - if(!mHelpModel->rowCount()) - { - createHelpCategory(); - } - return mHelpModel; } QAbstractItemModel* HelpDataProvider::getSearchData(const QString& key) { -/* if(key.isEmpty()) - { - return mKeywordModel; - }*/ - if(key == mLastSrhKey) { return mSearhResultModel; } -/* - if(!mLastSrhKey.isEmpty() && HelpUtils::findStr(key, mLastSrhKey) != -1) - { - searchInResult(key); - } - else - { - mSearhResultModel->removeRows(0, mSearhResultModel->rowCount()); - searchInAllData((HelpStandardItem*)mKeywordModel->invisibleRootItem(), key); - }*/ mLastSrhKey = key; mSearhResultModel->setFilterRegExp(key); @@ -146,6 +127,24 @@ void HelpDataProvider::createHelpCategory() { + constructCategory(); + + mHelpModel->setSortRole(Qt::DisplayRole); + + constructCategory2((HelpStandardItem*)mHelpModel->invisibleRootItem()); + + if(mAppItem) + { + mHelpModel->appendRow(mAppItem); + mAppItem->sortChildren(0, HelpUtils::sortOrder()); + constructCategory2(mAppItem); + } + + mKeywordModel->sort(0, HelpUtils::sortOrder()); +} + +void HelpDataProvider::constructCategory() +{ QFileInfoList driveList = QDir::drives(); QDir dir; QString lang = HelpUtils::UILocaleFromQtToSymbian(); @@ -154,8 +153,9 @@ path.append(XHTMLPATH); path.append(lang); - //construct help in rom - createBuiltInCategory(path); + QStringList uidList; + QStringList titleList; + parseCategoryIndexXml(path, uidList, titleList); //scan other root path and construct 3rd party help foreach(QFileInfo fi, driveList) @@ -171,13 +171,142 @@ { continue; } - constructAppHelp(path); + constructAppCategory(path, uidList); } } - mKeywordModel->sort(0, HelpUtils::sortOrder()); + + constructBuiltInCategory(path, uidList, titleList); + + mHelpModel->setSortRole(PriorityRole); + mHelpModel->sort(0, HelpUtils::sortOrder()); +} + +void HelpDataProvider::constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList) +{ + if(uidList.count() != titleList.count()) + { + //ToDo + return; + } + + for(int i = 0; i < uidList.count(); i++) + { + if(mUpdateUidList.contains(uidList[i])) + { + continue; + } + + QString uid(path); + uid.append(BACKSLASH); + uid.append(uidList[i]); + + constructBuiltInCategoryItem(uid, titleList[i]); + } } -void HelpDataProvider::createBuiltInCategory(const QString& path) +void HelpDataProvider::constructAppCategory(const QString& path, QStringList& uidList) +{ + QDir dir(path); + if(!dir.exists()) + { + return; + } + + QStringList uidDirList = dir.entryList(); + QString pathUid; + foreach(QString uid, uidDirList) + { + pathUid.clear(); + pathUid.append(path); + pathUid.append(BACKSLASH); + pathUid.append(uid); + + QString titleStr; + parseAppMetaxml(pathUid, titleStr); + if(titleStr.isEmpty()) + { + continue; + } + + if(uidList.contains(uid)) + { + mUpdateUidList.append(uid); + constructBuiltInCategoryItem(pathUid, titleStr); + continue; + } + + HelpStandardItem* item = NULL; + item = new HelpStandardItem(titleStr); + item->setData(pathUid, UidRole); + + if(!mAppItem) + { + mAppItem = new HelpStandardItem(qtTrId(TXT_APPLICATIONS)); + mAppItem->setData(APPPRIORITY, PriorityRole); + } + mAppItem->appendRow(item); + } +} + +void HelpDataProvider::constructBuiltInCategoryItem(const QString& uid, const QString& title) +{ + int priority; + parseBuiltInMetaxml(uid, priority); + + HelpStandardItem* item = NULL; + item = new HelpStandardItem(title); + item->setData(uid, UidRole); + + if(item) + { + item->setData(priority, PriorityRole); + mHelpModel->appendRow(item); + } +} + +void HelpDataProvider::constructCategory2(HelpStandardItem* itemParent) +{ + int count = itemParent->rowCount(); + for(int i =0; i < count; i++) + { + HelpStandardItem* item = (HelpStandardItem*)itemParent->child(i); + constructCategory2Item(item); + } +} + +void HelpDataProvider::constructCategory2Item(HelpStandardItem* itemParent) +{ + QStringList hrefList; + QStringList titleList; + + QString uid = itemParent->data(UidRole).toString(); + parseCategory2IndexXml(uid, hrefList, titleList); + + if(hrefList.count() == 0 || hrefList.count() != titleList.count()) + { + return; + } + + for(int i = 0; i < hrefList.count(); i++) + { + HelpStandardItem* item = new HelpStandardItem(titleList[i]); + item->setData(hrefList[i], HrefRole); + itemParent->appendRow(item); + constructKeywordModel(titleList[i], uid, hrefList[i]); + } + + itemParent->sortChildren(0, HelpUtils::sortOrder()); +} + +void HelpDataProvider::constructKeywordModel(const QString& title, const QString& uid, const QString& href) +{ + HelpStandardItem* itemTemp = new HelpStandardItem(title); + itemTemp->setData(uid, UidRole); + itemTemp->setData(href, HrefRole); + mKeywordModel->appendRow(itemTemp); +} + +void HelpDataProvider::parseCategoryIndexXml(const QString& path, QStringList& uidList, QStringList& titleList) { QString pathIndex(path); pathIndex.append(BACKSLASH); @@ -191,204 +320,164 @@ //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)"); + query.setQuery("doc($inputdoc)/collections/collection/xs:string(@id)"); if(!query.isValid()) { return; } - QStringList strLst; - if(!query.evaluateTo(&strLst)) + if(!query.evaluateTo(&uidList)) + { + return; + } + + query.setQuery("doc($inputdoc)/collections/collection/xs:string(@navtitle)"); + if(!query.isValid()) + { + return; + } + if(!query.evaluateTo(&titleList)) { return; } - foreach(QString str, strLst) + QStringList featureIdLst; + + query.setQuery("doc($inputdoc)/collections/collection/number(@FeatureId)"); + if(!query.isValid()) + { + return; + } + if(!query.evaluateTo(&featureIdLst)) { - QStringList temp; - temp = str.split(SPECIALCHAR); - QString uid(path); - uid.append(BACKSLASH); - uid.append(temp[0]); - HelpStandardItem* item = constructCategory2(temp[1], uid); - if(item) + return; + } + + if(featureIdLst.count() != uidList.count()) + { + return; + } + + for(int i = featureIdLst.count() - 1; i >= 0; i--) + { + int featureID = featureIdLst.at(i).toInt(); + if(!HelpUtils::suppportFeatureID(featureID)) { - mHelpModel->appendRow(item); + uidList.removeAt(i); + titleList.removeAt(i); } } - file.close(); - mHelpModel->sort(0, HelpUtils::sortOrder()); } -HelpStandardItem* HelpDataProvider::constructCategory2(const QString& title, const QString& uid) +void HelpDataProvider::parseCategory2IndexXml(const QString& path, QStringList& hrefList, QStringList& titleList) { - QString pathIndex(uid); + QString pathIndex(path); pathIndex.append(BACKSLASH); pathIndex.append(INDEXXML); QFile file(pathIndex); if (!file.open(QIODevice::ReadOnly)) { - return NULL; + return; } //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)"); + + query.setQuery("doc($inputdoc)/topics/topicref/xs:string(@href)"); if(!query.isValid()) { - return NULL; + return; } - - QStringList strLst; - if(!query.evaluateTo(&strLst)) + if(!query.evaluateTo(&hrefList)) { - return NULL; + return; } - if(strLst.count() <= 0) + + query.setQuery("doc($inputdoc)/topics/topicref/xs:string(@navtitle)"); + if(!query.isValid()) { - return NULL; + return; + } + if(!query.evaluateTo(&titleList)) + { + return; } - HelpStandardItem* itemParent = NULL; - itemParent = new HelpStandardItem(title); - itemParent->setData(uid, UidRole); - foreach(QString str, strLst) + QStringList featureIdLst; + + query.setQuery("doc($inputdoc)/topics/topicref/number(@FeatureId)"); + if(!query.isValid()) { - QStringList temp; - temp = str.split(SPECIALCHAR); - HelpStandardItem* item = new HelpStandardItem(temp[1]); - item->setData(temp[0], HrefRole); - itemParent->appendRow(item); - constructKeywordModel(temp[1], uid, temp[0]); + return; + } + if(!query.evaluateTo(&featureIdLst)) + { + return; } - file.close(); - itemParent->sortChildren(0, HelpUtils::sortOrder()); - return itemParent; -} - -void HelpDataProvider::constructAppHelp(const QString& path) -{ - QDir dir(path); - if(!dir.exists()) + if(featureIdLst.count() != hrefList.count()) { return; } - QStringList uidList = dir.entryList(); - HelpStandardItem* itemApp = NULL; - QString pathTemp; - foreach(QString uid, uidList) + for(int i = featureIdLst.count() - 1; i >= 0; i--) { - 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)) + int featureID = featureIdLst.at(i).toInt(); + if(!HelpUtils::suppportFeatureID(featureID)) { - continue; - } - - pathTemp.clear(); - pathTemp.append(path); - pathTemp.append(BACKSLASH); - pathTemp.append(uid); - HelpStandardItem* item = constructCategory2(titleStr, pathTemp); - if(item) - { - if(!itemApp) - { - itemApp = new HelpStandardItem(qtTrId(TXT_APPLICATIONS)); - } - itemApp->appendRow(item); - } - file.close(); - } - - if(itemApp) - { - itemApp->sortChildren(0, HelpUtils::sortOrder()); - mHelpModel->appendRow(itemApp); - } -} - -/* -void HelpDataProvider::searchInAllData(HelpStandardItem* item, const QString& key) -{ - if(item->rowCount() > 0) - { - for(int i = 0; i < item->rowCount(); i++) - { - searchInAllData((HelpStandardItem*)item->child(i),key); - } - } - else - { - if(HelpUtils::findStr(item->text(), key) != -1) - { - HelpStandardItem* itemSearch = new HelpStandardItem(item->text()); - itemSearch->setData(item->data(UidRole), UidRole); - itemSearch->setData(item->data(HrefRole), HrefRole); - mSearhResultModel->appendRow(itemSearch); + hrefList.removeAt(i); + titleList.removeAt(i); } } } -void HelpDataProvider::searchInResult(const QString& key) +void HelpDataProvider::parseBuiltInMetaxml(const QString& path, int& priority) { - for(int i = 0; i < mSearhResultModel->rowCount();) + QString pathMetaxml(path); + pathMetaxml.append(BACKSLASH); + pathMetaxml.append(METAXML); + + priority = -1; + + QFile file(pathMetaxml); + if (!file.open(QIODevice::ReadOnly)) { - QStandardItem* item = mSearhResultModel->item(i); - if(HelpUtils::findStr(item->text(), key) == -1) - { - mSearhResultModel->removeRow(i); - } - else - { - i++; - } + return; + } + + QXmlQuery query; + QString str; + query.bindVariable("inputdoc", &file); + + query.setQuery("doc($inputdoc)/meta/number(priority)"); + if(query.isValid() && query.evaluateTo(&str)) + { + priority = str.toInt(); } } -*/ -void HelpDataProvider::constructKeywordModel(const QString& title, const QString& uid, const QString& href) + +void HelpDataProvider::parseAppMetaxml(const QString& path, QString& title) { - HelpStandardItem* itemTemp = new HelpStandardItem(title); - itemTemp->setData(uid, UidRole); - itemTemp->setData(href, HrefRole); - mKeywordModel->appendRow(itemTemp); -} + QString pathMetaxml(path); + pathMetaxml.append(BACKSLASH); + pathMetaxml.append(METAXML); + QFile file(pathMetaxml); + if (!file.open(QIODevice::ReadOnly)) { + return; + } -HelpStandardItem* HelpDataProvider::findItemWithHref(HelpStandardItem* itemParent, const QString& href) -{ - for(int i = 0; i < itemParent->rowCount(); i++) + //parse meta xml, get the title string + QXmlQuery query; + query.bindVariable("inputdoc", &file); + query.setQuery("doc($inputdoc)/meta/string(title)"); + if(!query.isValid()) { - if(QString::compare(itemParent->child(i)->data(HrefRole).toString(), href, Qt::CaseInsensitive) == 0) - { - return (HelpStandardItem *)(itemParent->child(i)); - } + return; } - return NULL; + + if(!query.evaluateTo(&title)) + { + return; + } } diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpKeywordView.cpp --- a/userguide/src/HelpKeywordView.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpKeywordView.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -31,7 +31,6 @@ #include <hblineedit.h> #include <hbmenu.h> #include <hbstaticvkbhost.h> -#include <hbgroupbox.h> #include "HelpDataProvider.h" #include "HelpProxyModel.h" @@ -61,9 +60,8 @@ initSearchList(); initSearchPanel(); initVirtualKeyboard(); - initEmptyLabel(); - connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*))); + connect(mainWindow(), SIGNAL(viewReady()), this, SLOT(onViewReady())); } void HelpKeywordView::initDocMl() @@ -99,22 +97,17 @@ connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(onHandleKeypadClose())); } -void HelpKeywordView::initEmptyLabel() +HbLabel* HelpKeywordView::label() { - HbLabel* label = mBuilder.findWidget<HbLabel*>(DOCML_NO_MATCH_LABEL); - label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + return mBuilder.findWidget<HbLabel*>(DOCML_NO_MATCH_LABEL); } void HelpKeywordView::loadAllContent() { + showToolBar(false); mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH); ResetSearchPanel(); - toolBar()->hide(); -} - -HbGroupBox* HelpKeywordView::groupBox() -{ - return mBuilder.findWidget<HbGroupBox*>(DOCML_GROUPBOX); + } //////////////////////////////////////////////////////////////////////////////////////////// @@ -143,20 +136,62 @@ if(lineEdit != NULL) { lineEdit->setText(""); + lineEdit->setFocus(); break; } } } } +void HelpKeywordView::updateLabelPos() +{ + HbDeviceProfile profile = HbDeviceProfile::profile(mainWindow()); + qreal unValue = profile.unitValue(); + if(mainWindow()->orientation() == Qt::Vertical) + { + if(mVirtualKeyboard->keypadStatus() == HbVkbHost::HbVkbStatusClosed) + { + label()->setContentsMargins(0,30 * unValue,0,0); + } + else + { + label()->setContentsMargins(0,10 * unValue,0,0); + } + } + else + { + if(mVirtualKeyboard->keypadStatus() == HbVkbHost::HbVkbStatusClosed) + { + label()->setContentsMargins(0,10 * unValue,0,0); + } + else + { + label()->setContentsMargins(0,0,0,0); + label()->setAlignment(label()->alignment() | Qt::AlignVCenter); + } + } +} + +void HelpKeywordView::showToolBar(bool visible) +{ + Hb::SceneItems items = Hb::ToolBarItem; + if(visible) + { + showItems(items); + } + else + { + hideItems(items); + } +} + //////////////////////////////////////////////////////////////////////////////////////////// // handle system event -void HelpKeywordView::onCurrentViewChanged(HbView *view) +void HelpKeywordView::onViewReady() { - if(this == view) - { - setVisible(true); + if(isVisible()) + { setNavigationAction(mSoftKeyAction); } } @@ -201,7 +236,7 @@ { mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH_NO_SRHPAL); } - toolBar()->show(); + showToolBar(true); } void HelpKeywordView::onSearchPanelCriteriaChanged(const QString &criteria) @@ -215,20 +250,7 @@ { mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH); } - - toolBar()->hide(); - - if(criteria.isEmpty()) - { - groupBox()->setHeading(hbTrId(TXT_SETLABEL_SEARCH)); - } - else - { - QString heading = qtTrId(TXT_SETLABEL_SEARCH_RESULTS); - heading.append(COLON); - heading.append(criteria); - groupBox()->setHeading(heading); - } + showToolBar(false); } //////////////////////////////////////////////////////////////////////////////////////////// @@ -239,6 +261,7 @@ updateVisibleItems(false); qreal heightToSet = mainWindow()->layoutRect().height() - mVirtualKeyboard->keyboardArea().height(); this->setMaximumHeight(heightToSet); + updateLabelPos(); } void HelpKeywordView::onHandleKeypadClose() @@ -246,8 +269,15 @@ updateVisibleItems(true); qreal mainHeight = mainWindow()->layoutRect().height(); qreal toolbarHeight = toolBar()->size().height(); - qreal height = mainHeight - (toolBar()->isVisible() ? toolbarHeight : 0); + qreal height = mainHeight - ( toolBar()->isVisible() ? toolbarHeight : 0); this->setMaximumHeight(height); + updateLabelPos(); +} + +void HelpKeywordView::onOrientationChanged(Qt::Orientation orientation) +{ + Q_UNUSED(orientation); + updateLabelPos(); } // end of file diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpMainWindow.cpp --- a/userguide/src/HelpMainWindow.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpMainWindow.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -18,6 +18,8 @@ #include <hbtoolbar.h> #include <hbnotificationdialog.h> #include <hbaction.h> +#include <hbapplication.h> +#include <hbactivitymanager.h> #include "HelpBaseView.h" #include "HelpCategoryView.h" @@ -32,6 +34,8 @@ mKeywordView(NULL), mContentsView(NULL) { + QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity())); + HelpDataProvider::instance()->createHelpCategory(); activateCategoryView(); } @@ -59,6 +63,7 @@ } break; default: + HbApplication::exit(); break; } } @@ -129,5 +134,32 @@ mKeywordView->loadAllContent(); } +void HelpMainWindow::saveActivity() +{ + HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager(); + + // clean up any previous versions of this activity from the activity manager. + bool ok = activityManager->removeActivity("UserGuideMainView"); + if ( !ok ) + { + //qFatal("Remove failed" ); + } + + // get a screenshot for saving to the activity manager + QVariantHash metadata; + metadata.insert("screenshot", QPixmap::grabWidget(this, rect())); + + // save any data necessary to save the state + QByteArray serializedActivity; + QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append); + + // add the activity to the activity manager + ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata); + if ( !ok ) + { + qFatal("Add failed" ); + } +} + // end of file diff -r e70b37c1a9d5 -r 3ae60d69bf22 userguide/src/HelpUtils.cpp --- a/userguide/src/HelpUtils.cpp Fri Jun 11 16:23:42 2010 +0100 +++ b/userguide/src/HelpUtils.cpp Thu Jul 22 16:30:58 2010 +0100 @@ -28,8 +28,10 @@ #ifdef Q_OS_SYMBIAN +#include <qsysteminfo.h> +#include <xqappmgr.h> + #include <e32const.h> -#include <xqappmgr.h> #include <eikenv.h> #include <zipfile.h> @@ -249,6 +251,21 @@ return 0; } +bool HelpUtils::suppportFeatureID(int featureID) +{ +#ifdef Q_OS_SYMBIAN + if(featureID == -1) + { + return true; + } + QtMobility::QSystemInfo sysInfo; + return sysInfo.hasFeatureSupported((QtMobility::QSystemInfo::Feature)featureID); +#else + Q_UNUSED(featureID); + return true; +#endif +} + Qt::Orientation HelpUtils::defaultOrientation() { return Qt::Vertical;