# HG changeset patch # User hgs # Date 1277202984 -28800 # Node ID 0a93cba9d57a1710b2b74115ba56b47d9be12aa7 # Parent 97d7f0705d0aa4e29f62b08b41e610bc537416fa 201025 diff -r 97d7f0705d0a -r 0a93cba9d57a helps_info/helps_metadata/helps_metadata.mrp --- a/helps_info/helps_metadata/helps_metadata.mrp Tue Jun 08 18:34:07 2010 +0800 +++ /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 97d7f0705d0a -r 0a93cba9d57a package_definition.xml --- a/package_definition.xml Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff -r 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.tmp Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ - - - - - 0x10006000 - - \work\help\ - \epoc32\wins\c\system\help\ - \work\help\ - \work\help\temp\ - - - - agen-hlp.rtf - bomb-hlp.rtf - calc-hlp.rtf - comm-hlp.rtf - cont-hlp.rtf - data-hlp.rtf - dial-hlp.rtf - dict-hlp.rtf - gen--hlp.rtf - hard-hlp.rtf - jott-hlp.rtf - prog-hlp.rtf - rec--hlp.rtf - shet-hlp.rtf - sket-hlp.rtf - spel-hlp.rtf - syst-hlp.rtf - time-hlp.rtf - word-hlp.rtf - xtra-hlp.rtf - - EPOCHlp - \work\help\uk.alc.xml - - diff -r 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.xml.bak --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.alp.xml.bak Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - 0x10006000 - - H:\aleppo\work\help\ - H:\epoc32\wins\c\system\help\ - H:\aleppo\work\help\ - H:\aleppo\work\help\temp\ - - - - sket-hlp.rtf - - EPOCHlp - H:\aleppo\work\help\uk.alc.xml - - diff -r 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/TestData/Source/ER5Help/epochlp.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/epochlp.tmp Tue Jun 08 18:34:07 2010 +0800 +++ /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 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/TestData/Source/ER5Help/uk.alc.tmp --- a/symhelp/helpmodel/TestData/Source/ER5Help/uk.alc.tmp Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - -Tip: -Note: -Important: - diff -r 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/group/BLD.INF --- a/symhelp/helpmodel/group/BLD.INF Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -// Copyright (c) 1999-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: -// Help application engine -// -// - -PRJ_PLATFORMS -DEFAULT WINC - - -PRJ_EXPORTS -// specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// to the same name in \epoc32\include -../dbwriter/DBWRITER.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(dbwriter.h) -// -../inc/HLPMODEL.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlpmodel.h) -../inc/HLPLCH.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlplch.h) -../inc/hlpconstants.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(hlpconstants.h) -../inc/HlpZoom.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlpzoom.h) - -../group/hlpmodel.iby /epoc32/rom/include/hlpmodel.iby - - -PRJ_MMPFILES -../dbwriter/DBWRITER.MMP -#ifndef WINC -../group/HLPMODEL.MMP -../lch/HLPLCH.MMP -#endif - -PRJ_TESTMMPFILES -../tsrc/tlch.mmp manual -../tsrc/TSearch.mmp -../tsrc/tstore.mmp -../tsrc/THelpView.mmp manual -../tsrc/tdumper.mmp manual -../tsrc/TLoader.mmp - -PRJ_TESTEXPORTS -../group/hlpmodelTest.iby /epoc32/rom/include/hlpmodeltest.iby - -../TestData/Boss-1.hlp /epoc32/winscw/c/resource/help/boss-1.hlp -../TestData/Boss-2.hlp /epoc32/winscw/c/resource/help/boss-2.hlp -../TestData/ER5Help_Part1.hlp /epoc32/winscw/c/resource/help/er5help_part1.hlp -../TestData/newfile.hlp /epoc32/winscw/c/resource/help/newfile.hlp -../TestData/french.hlp /epoc32/winscw/c/resource/help/french.hlp -../TestData/PlatSecSearchTestZ.hlp z:/resource/help/platsecsearchtest.hlp -../TestData/PlatSecSearchTestC.hlp z:/system/data/thlpmodel/platsecsearchtestc.hlp -../TestData/PlatSecSearchTestF.hlp z:/system/data/thlpmodel/platsecsearchtestf.hlp - diff -r 97d7f0705d0a -r 0a93cba9d57a symhelp/helpmodel/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/symhelp/helpmodel/group/bld.inf Tue Jun 22 18:36:24 2010 +0800 @@ -0,0 +1,63 @@ +// Copyright (c) 1999-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: +// Help application engine +// +// + +PRJ_PLATFORMS +DEFAULT WINC + + +PRJ_EXPORTS +// specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in \epoc32\include +../dbwriter/DBWRITER.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(dbwriter.h) +// +../inc/HLPMODEL.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlpmodel.h) +../inc/HLPLCH.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlplch.h) +../inc/hlpconstants.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(hlpconstants.h) +../inc/HlpZoom.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(hlpzoom.h) + +../group/hlpmodel.iby /epoc32/rom/include/hlpmodel.iby + + +PRJ_MMPFILES +../dbwriter/DBWRITER.MMP +#ifndef WINC +../group/HLPMODEL.MMP +../lch/HLPLCH.MMP +#endif + +PRJ_TESTMMPFILES +../tsrc/tlch.mmp manual +../tsrc/TSearch.mmp +../tsrc/tstore.mmp +../tsrc/THelpView.mmp manual +../tsrc/tdumper.mmp manual +../tsrc/TLoader.mmp + +PRJ_TESTEXPORTS +../group/hlpmodelTest.iby /epoc32/rom/include/hlpmodeltest.iby + +../TestData/Boss-1.hlp /epoc32/winscw/c/resource/help/boss-1.hlp +../TestData/Boss-2.hlp /epoc32/winscw/c/resource/help/boss-2.hlp +../TestData/ER5Help_Part1.hlp /epoc32/winscw/c/resource/help/er5help_part1.hlp +../TestData/newfile.hlp /epoc32/winscw/c/resource/help/newfile.hlp +../TestData/french.hlp /epoc32/winscw/c/resource/help/french.hlp +../TestData/PlatSecSearchTestZ.hlp z:/resource/help/platsecsearchtest.hlp +../TestData/PlatSecSearchTestC.hlp z:/system/data/thlpmodel/platsecsearchtestc.hlp +../TestData/PlatSecSearchTestF.hlp z:/system/data/thlpmodel/platsecsearchtestf.hlp + diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/Userguide.pro --- a/userguide/Userguide.pro Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/Userguide.pro Tue Jun 22 18:36:24 2010 +0800 @@ -62,9 +62,9 @@ MOBILITY = systeminfo LIBS += -lezip -lxqservice -lxqserviceutil include(rom/userguide.pri) + SKINICON = qtg_large_help } - -ICON = resources/qtg_large_help.svg + RESOURCES += resources/Userguide.qrc debug: DESTDIR = ./debug diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/inc/HelpBaseView.h --- a/userguide/inc/HelpBaseView.h Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/inc/HelpBaseView.h Tue Jun 22 18:36:24 2010 +0800 @@ -45,18 +45,12 @@ void onToolbarFind() { emit showFindList(); }; void onToolbarOnlineSupport(); -protected slots: - virtual void onOrientationChanged(Qt::Orientation orientation); - protected: void initBaseDocMl(); protected: HelpUIBuilder mBuilder; HbToolBar* mToolBar; - -private: - void RefreshToolbarText(Qt::Orientation orientation); }; #endif //HELPBATHVIEW_H diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/inc/HelpCategoryView.h --- a/userguide/inc/HelpCategoryView.h Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/inc/HelpCategoryView.h Tue Jun 22 18:36:24 2010 +0800 @@ -18,19 +18,14 @@ #ifndef HELPCATEGORYVIEW_H #define HELPCATEGORYVIEW_H -#include +#include -#include "HelpCommon.h" #include "HelpDocumentLoader.h" class HbTreeView; -class HbListView; -class HbSearchPanel; class QStandardItem; -class HbStaticVkbHost; -class HbGroupBox; -class HelpCategoryView : public HbView +class HelpCategoryView : public HelpBaseView { Q_OBJECT @@ -42,64 +37,20 @@ private: void initDocMl(); void initAllList(); - void initSearchList(); - void initSearchPanel(); - void initBackAction(); - void initEmptyLabel(); - void initVirtualKeyboard(); - -private: - HbGroupBox* groupBox(); - -public: - enum ViewMode - { - ViewModeNull = 0, - ViewModeAll, - ViewModeSearch - }; - void switchViewMode(ViewMode viewMode); - -signals: - void activateView(HelpViewName viewName); - -private: - void updateVisibleItems(bool visible); - void ResetSearchPanel(); private: void expandCollapseAllList(QStandardItem* item, bool expand); - -private slots: // handle system event - void onCurrentViewChanged(HbView *view); - -private slots: // handle button action - void onBackAction(); + void updateExpandCollapseAction(bool expand); 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 slots: - void onExpandAll(); - void onCollapseAll(); - -private slots: // handle virtual keyboard event - void onHandleKeypadOpen(); - void onHandleKeypadClose(); +private slots: // handle menu event + void onExpandOrCollapseAll(); private: - ViewMode mViewMode; - HbTreeView* mListAll; - HbListView* mListSearch; - HbSearchPanel* mSearchPanel; - HbAction* mSoftKeyAction; - HbStaticVkbHost* mVirtualKeyboard; - HelpUIBuilder mBuilder; + HbTreeView* mListAll; + int mExpandCount; }; #endif //HELPCATEGORYVIEW_H diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/inc/HelpDataProvider.h --- a/userguide/inc/HelpDataProvider.h Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/inc/HelpDataProvider.h Tue Jun 22 18:36:24 2010 +0800 @@ -35,14 +35,13 @@ 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(); - //construct 1st category void constructCategory(); //construct help category in rom diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/inc/HelpKeywordView.h --- a/userguide/inc/HelpKeywordView.h Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/inc/HelpKeywordView.h Tue Jun 22 18:36:24 2010 +0800 @@ -45,15 +45,16 @@ void initVirtualKeyboard(); private: - void onOrientationChanged(Qt::Orientation orientation); - -private: 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 onViewReady(); diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/resources/Userguide.qrc --- a/userguide/resources/Userguide.qrc Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/resources/Userguide.qrc Tue Jun 22 18:36:24 2010 +0800 @@ -2,13 +2,8 @@ xml/categoryView.docml + xml/keywordView.docml xml/contentsView.docml - xml/toolbar.docml + xml/baseView.docml - - - images/qtg_mono_show_all.svg - images/qtg_mono_link_nokia.svg - - \ No newline at end of file diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/resources/qtg_large_help.svg --- a/userguide/resources/qtg_large_help.svg Tue Jun 08 18:34:07 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/resources/xml/categoryView.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/xml/categoryView.docml Tue Jun 22 18:36:24 2010 +0800 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/resources/xml/contentsView.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/resources/xml/contentsView.docml Tue Jun 22 18:36:24 2010 +0800 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userguide/src/HelpBaseView.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -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: +* +*/ + +#include +#include +#include + +#include "HelpBaseView.h" + +////////////////////////////////////////////////////////////////////////////////////////////// + +HelpBaseView::HelpBaseView() +{ +} + +HelpBaseView::~HelpBaseView() +{ +} + + +//////////////////////////////////////////////////////////////////////////////////////////// + +void HelpBaseView::initBaseDocMl() +{ + // Create widget hierarchy + setObjectName( DOCML_VIEW_NAME ); + + // List existing root elements - this allows us to refer to objects in the XML + // which are created outside the document. + QObjectList roots; + roots.append( this ); + + mBuilder.setObjectTree(roots); + + mBuilder.load(QRC_DOCML_BASE); +} + +void HelpBaseView::onToolbarOnlineSupport() +{ + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setParent(this); + notificationDialog->setTitle(URL_LINK_SUPPORT); + notificationDialog->show(); +} + + +// end of file diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpCategoryView.cpp --- a/userguide/src/HelpCategoryView.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpCategoryView.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -21,20 +21,13 @@ #include #include #include -#include -#include #include -#include -#include #include -#include #include -#include -#include +#include #include "HelpDataProvider.h" -#include "HelpProxyModel.h" #include "HelpCategoryView.h" @@ -42,10 +35,8 @@ ////////////////////////////////////////////////////////////////////////////////////////////// HelpCategoryView::HelpCategoryView() : -mViewMode(ViewModeNull), -mListAll(NULL), -mListSearch(NULL), -mSearchPanel(NULL) +mListAll(NULL), +mExpandCount(0) { } @@ -59,39 +50,15 @@ void HelpCategoryView::init() { initDocMl(); - initBackAction(); initAllList(); - initSearchList(); - initSearchPanel(); - initVirtualKeyboard(); - initEmptyLabel(); - - switchViewMode(ViewModeAll); - - connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*))); } void HelpCategoryView::initDocMl() { - // Create widget hierarchy - setObjectName( DOCML_VIEW_CATEGORY ); - - // List existing root elements - this allows us to refer to objects in the XML - // which are created outside the document. - QObjectList roots; - roots.append( this ); - - mBuilder.setObjectTree(roots); - + initBaseDocMl(); mBuilder.load(QRC_DOCML_CATEGORY); } -void HelpCategoryView::initBackAction() -{ - mSoftKeyAction = new HbAction(Hb::BackAction); - connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction())); -} - void HelpCategoryView::initAllList() { mListAll = mBuilder.findWidget(DOCML_LIST_CATEGORY_ALL); @@ -100,57 +67,6 @@ connect(mListAll, SIGNAL(activated(const QModelIndex&)), this, SLOT(onAllListActivated(const QModelIndex&))); } -void HelpCategoryView::initSearchList() -{ - mListSearch = mBuilder.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 = mBuilder.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::initVirtualKeyboard() -{ - mVirtualKeyboard = new HbStaticVkbHost(this); - connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(onHandleKeypadOpen())); - connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(onHandleKeypadClose())); -} - -void HelpCategoryView::initEmptyLabel() -{ - HbLabel* label = mBuilder.findWidget(DOCML_NO_MATCH_LABEL); - label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); -} - -HbGroupBox* HelpCategoryView::groupBox() -{ - return mBuilder.findWidget(DOCML_GROUPBOX); -} - -//////////////////////////////////////////////////////////////////////////////////////////// - -void HelpCategoryView::switchViewMode(ViewMode viewMode) -{ - if(ViewModeNull == viewMode) return; - - mViewMode = viewMode; - if(ViewModeAll == viewMode) - { - mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_ALL); - toolBar()->show(); - } - else if(ViewModeSearch == viewMode) - { -// mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH); - ResetSearchPanel(); - } -} - //////////////////////////////////////////////////////////////////////////////////////////// void HelpCategoryView::expandCollapseAllList(QStandardItem* item, bool expand) @@ -166,66 +82,13 @@ } } -//////////////////////////////////////////////////////////////////////////////////////////// - -void HelpCategoryView::updateVisibleItems(bool visible) -{ - static Hb::SceneItems items = Hb::TitleBarItem | Hb::StatusBarItem; - if(visible) - { - showItems(items); - } - else - { - hideItems(items); - } -} - -void HelpCategoryView::ResetSearchPanel() +void HelpCategoryView::updateExpandCollapseAction(bool expand) { - 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; - } - } - } + HbAction* allAction = mBuilder.findObject(DOCML_ACTION_EXPAND_COLLAPSE_ALL); + allAction->setText(expand ? hbTrId(TXT_EXPAND_ALL) : hbTrId(TXT_COLLAPSE_ALL)); } //////////////////////////////////////////////////////////////////////////////////////////// -// handle system event - -void HelpCategoryView::onCurrentViewChanged(HbView *view) -{ - if(this == view) - { - setNavigationAction(mSoftKeyAction); - } -} - -/////////////////////////////////////////////////////////////////////////////////////// -// handle button back action - -void HelpCategoryView::onBackAction() -{ - if(ViewModeSearch == mViewMode) - { - switchViewMode(ViewModeAll); - } - else - { - HbApplication::exit(); - } -} - - -//////////////////////////////////////////////////////////////////////////////////////////// // handle list event void HelpCategoryView::onAllListActivated(const QModelIndex& index) @@ -233,6 +96,20 @@ if(!index.isValid() || // invalid index.child(0,0).isValid()) // this is a node { + if(index.parent().isValid()) + { + return; + } + + if(mListAll->isExpanded(index)) + { + mExpandCount++; + } + else + { + mExpandCount--; + } + updateExpandCollapseAction(mExpandCount == 0); return; } @@ -242,96 +119,15 @@ emit activateView(HelpViewContents); } -void HelpCategoryView::onSearchListActivated(const QModelIndex& index) +//////////////////////////////////////////////////////////////////////////////////////////// +// handle menu event +void HelpCategoryView::onExpandOrCollapseAll() { - 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() -{ - if(mListSearch->model()->rowCount() == 0) - { - mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH_NO_SRHPAL_NO_MATCH); - } - else - { - mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH_NO_SRHPAL); - } - toolBar()->show(); + bool needExpand = (mExpandCount == 0); + QStandardItemModel* model = (QStandardItemModel*)(mListAll->model()); + expandCollapseAllList(model->invisibleRootItem(),needExpand); + mExpandCount = needExpand ? model->invisibleRootItem()->rowCount() : 0; + updateExpandCollapseAction(mExpandCount == 0); } -void HelpCategoryView::onSearchPanelCriteriaChanged(const QString &criteria) -{ - HelpDataProvider::instance()->getSearchData(criteria); - if(mListSearch->model()->rowCount() == 0) - { - mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_SEARCH_NO_MATCH); - } - else - { - mBuilder.load(QRC_DOCML_CATEGORY, DOCML_LAYOUT_CATEGORY_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); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////// -// handle virtual keyboard event - -void HelpCategoryView::onHandleKeypadOpen() -{ - updateVisibleItems(false); - qreal heightToSet = mainWindow()->layoutRect().height() - mVirtualKeyboard->keyboardArea().height(); - this->setMaximumHeight(heightToSet); -} - -void HelpCategoryView::onHandleKeypadClose() -{ - updateVisibleItems(true); - qreal mainHeight = mainWindow()->layoutRect().height(); - qreal toolbarHeight = toolBar()->size().height(); - qreal height = mainHeight - (toolBar()->isVisible() ? toolbarHeight : 0); - this->setMaximumHeight(height); -} - -//////////////////////////////////////////////////////////////////////////////////////////// -// handle menu event -void HelpCategoryView::onExpandAll() -{ - QStandardItemModel* model = (QStandardItemModel*)(mListAll->model()); - expandCollapseAllList(model->invisibleRootItem(),true); -} - -void HelpCategoryView::onCollapseAll() -{ - QStandardItemModel* model = (QStandardItemModel*)(mListAll->model()); - expandCollapseAllList(model->invisibleRootItem(),false); -} - - // end of file diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpDataProvider.cpp --- a/userguide/src/HelpDataProvider.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpDataProvider.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -72,11 +72,6 @@ QAbstractItemModel* HelpDataProvider::getCategoryData() { - if(!mHelpModel->rowCount()) - { - createHelpCategory(); - } - return mHelpModel; } @@ -89,6 +84,7 @@ mLastSrhKey = key; mSearhResultModel->setFilterRegExp(key); + return mSearhResultModel; } @@ -187,7 +183,6 @@ void HelpDataProvider::constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList) { -// constructCategory2(title, uid); if(uidList.count() != titleList.count()) { //ToDo @@ -363,7 +358,7 @@ return; } - for(int i = featureIdLst.count() - 1; i <= 0; i--) + for(int i = featureIdLst.count() - 1; i >= 0; i--) { int featureID = featureIdLst.at(i).toInt(); if(!HelpUtils::suppportFeatureID(featureID)) @@ -426,7 +421,7 @@ return; } - for(int i = featureIdLst.count() - 1; i <= 0; i--) + for(int i = featureIdLst.count() - 1; i >= 0; i--) { int featureID = featureIdLst.at(i).toInt(); if(!HelpUtils::suppportFeatureID(featureID)) diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpDocumentLoader.cpp --- a/userguide/src/HelpDocumentLoader.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpDocumentLoader.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -32,7 +32,7 @@ object->setObjectName(name); return object; } - + return HbDocumentLoader::createObject(type, name); } diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpKeywordView.cpp --- a/userguide/src/HelpKeywordView.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpKeywordView.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -104,7 +104,7 @@ void HelpKeywordView::loadAllContent() { - toolBar()->hide(); + showToolBar(false); mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH); ResetSearchPanel(); @@ -172,6 +172,19 @@ } } +void HelpKeywordView::showToolBar(bool visible) +{ + Hb::SceneItems items = Hb::ToolBarItem; + if(visible) + { + showItems(items); + } + else + { + hideItems(items); + } +} + //////////////////////////////////////////////////////////////////////////////////////////// // handle system event @@ -223,7 +236,7 @@ { mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH_NO_SRHPAL); } - toolBar()->show(); + showToolBar(true); } void HelpKeywordView::onSearchPanelCriteriaChanged(const QString &criteria) @@ -237,8 +250,7 @@ { mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH); } - - toolBar()->hide(); + showToolBar(false); } //////////////////////////////////////////////////////////////////////////////////////////// @@ -257,14 +269,14 @@ 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) { - HelpBaseView::onOrientationChanged(orientation); + Q_UNUSED(orientation); updateLabelPos(); } diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpMainWindow.cpp --- a/userguide/src/HelpMainWindow.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpMainWindow.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -35,6 +35,7 @@ mContentsView(NULL) { QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity())); + HelpDataProvider::instance()->createHelpCategory(); activateCategoryView(); } @@ -62,6 +63,7 @@ } break; default: + HbApplication::exit(); break; } } @@ -134,30 +136,29 @@ void HelpMainWindow::saveActivity() { - HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); + HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); - // clean up any previous versions of this activity from the activity manager. - bool ok = activityManager->removeActivity("UserGuideMainView"); - if ( !ok ) - { - //qFatal("Remove failed" ); - } + // 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())); + // 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); - stream << "whatever data you need to save the state adequately"; + // 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" ); - } + // add the activity to the activity manager + ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata); + if ( !ok ) + { + qFatal("Add failed" ); + } } // end of file diff -r 97d7f0705d0a -r 0a93cba9d57a userguide/src/HelpUtils.cpp --- a/userguide/src/HelpUtils.cpp Tue Jun 08 18:34:07 2010 +0800 +++ b/userguide/src/HelpUtils.cpp Tue Jun 22 18:36:24 2010 +0800 @@ -232,9 +232,6 @@ QString uriStr("appto://"); uriStr.append(appUid); - /* uriStr.append("?"); - uriStr.append("activityname"); - uriStr.append("=MainView&key1=data1&key2=data2");*/ QUrl uri(uriStr); XQApplicationManager appmgr;