userguide/inc/HelpDataProvider.h
branchRCL_3
changeset 17 12f60d9a73b3
equal deleted inserted replaced
16:0d1adf67ec1b 17:12f60d9a73b3
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HELPDATAPROVIDER_H
       
    19 #define HELPDATAPROVIDER_H
       
    20 
       
    21 class HelpModel;
       
    22 class HelpItems;
       
    23 class HelpProxyModel;
       
    24 class QStandardItemModel;
       
    25 class HelpStandardItem;
       
    26 
       
    27 class HelpDataProvider
       
    28 {	
       
    29 private:
       
    30     HelpDataProvider();
       
    31     ~HelpDataProvider();
       
    32     
       
    33 public:
       
    34     static HelpDataProvider* instance();
       
    35     static void destroyInstance();
       
    36 
       
    37 public:
       
    38 	void createHelpCategory();
       
    39 	QAbstractItemModel* getCategoryData();
       
    40 	QAbstractItemModel* getSearchData(const QString& key=QString());
       
    41 	void setHelpContentUrl(const QString& uid, const QString& href);
       
    42 	void getHelpContentData(QString& content, QString& url);
       
    43 
       
    44 private:
       
    45 	//construct 1st category
       
    46 	void constructCategory();
       
    47 	//construct help category in rom
       
    48 	void constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList);
       
    49 	//construct help category for 3rd party application
       
    50 	void constructAppCategory(const QString& path, QStringList& uidList);
       
    51 	void constructBuiltInCategoryItem(const QString& uid, const QString& title);
       
    52 
       
    53 	//construct 2nd category
       
    54 	void constructCategory2(HelpStandardItem* itemParent);
       
    55 	void constructCategory2Item(HelpStandardItem* itemParent);
       
    56 
       
    57 	//construct keyword list
       
    58 	void constructKeywordModel(const QString& title, const QString& uid, const QString& href);
       
    59 
       
    60 	//parse xml
       
    61 	void parseCategoryIndexXml(const QString& path, QStringList& uidList, QStringList& titleList);
       
    62 	void parseCategory2IndexXml(const QString& path, QStringList& hrefList, QStringList& titleList);
       
    63 	void parseBuiltInMetaxml(const QString& path, int& priority);
       
    64 	void parseAppMetaxml(const QString& path, QString& title);	
       
    65 
       
    66 private:
       
    67 	QStandardItemModel*		mHelpModel;         //category tree model
       
    68 	QStandardItemModel*		mKeywordModel;      //keyword list model
       
    69 	HelpProxyModel*			mSearhResultModel;  //search result proxy model of keyword model	
       
    70 	HelpStandardItem*		mAppItem;
       
    71 	QString					mHelpContentRoot;
       
    72 	QString					mLastSrhKey;
       
    73 	QStringList				mUpdateUidList;
       
    74 
       
    75 };
       
    76 
       
    77 #endif //HELPDATAPROVIDER_H