csxhelp/HelpEngine/inc/CSXHHelpDataBase.h
changeset 0 1f04cf54edd8
child 5 d06b1526f62c
equal deleted inserted replaced
-1:000000000000 0:1f04cf54edd8
       
     1 /*
       
     2 * Copyright (c) 2006 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:  CCSXHHelpDataBase class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef INC_CSXHHELPDATABASE_H_HEADER_INCLUDED_BC054F58
       
    20 #define INC_CSXHHELPDATABASE_H_HEADER_INCLUDED_BC054F58
       
    21 
       
    22 #include "CSXHHelpContentBase.h"
       
    23 #include "CSXHGenericTOC1.h"
       
    24 #include <f32file.h>
       
    25 #include <apadef.h>
       
    26 class 	CAknProgressDialog;
       
    27 
       
    28 class CCSXHHelpDataBase;
       
    29 class CCSXHHTMLContentParser;
       
    30 class CCSXHLegacyContentParser;
       
    31 class CCSXHGenericTOC2;
       
    32 class CCSXHKywdTOC1;
       
    33 class CCSXHHtmlTOC1;
       
    34 class CCoeEnv;
       
    35 class CCSXHMainTopics;
       
    36 class CCSXHKywdTopics;
       
    37 class MCSXHKywdBuilder;
       
    38 
       
    39 /** 
       
    40 * @class CCSXHHelpDataBase
       
    41 * This class has all pointers & used to generate the required data from Application
       
    42 */
       
    43 class CCSXHHelpDataBase : public CBase
       
    44     {
       
    45   public:
       
    46 /** 
       
    47 *  @function NewL
       
    48 *  @since S60 3.2
       
    49 *  Construct a CCSXHHelpDataBase 
       
    50 *  and return a pointer to the created object
       
    51 *  @param aCoeEnv 	- Control Environment
       
    52 *  @return a CCSXHHelpDataBase Pointer 
       
    53 */
       
    54     IMPORT_C static CCSXHHelpDataBase* NewL(CCoeEnv* aCoeEnv,const TApaAppCaption& aAppCaption);
       
    55 /** 
       
    56 *  @function NewLC
       
    57 *  @since S60 3.2
       
    58 *  Construct a CCSXHHelpDataBase 
       
    59 *  and return a pointer to the created object using two phase construction
       
    60 *  @param aCoeEnv 	- Control Environment
       
    61 *  @return a CCSXHHelpDataBase Pointer 
       
    62 */
       
    63     static CCSXHHelpDataBase* NewLC(CCoeEnv *aCoeEnv,const TApaAppCaption& aAppCaption);
       
    64 
       
    65 /** 
       
    66 *  @function GetInstance
       
    67 *  @since S60 3.2
       
    68 *  Get the instance of database class
       
    69 *  @return database pointer 
       
    70 */
       
    71     static CCSXHHelpDataBase* GetInstance();
       
    72 
       
    73  /** 
       
    74  * @function ~CCSXHHelpDataBase
       
    75  * @since S60 3.2
       
    76  * Destroy the object and release all memory objects
       
    77  */ 
       
    78     IMPORT_C ~CCSXHHelpDataBase();
       
    79 /** 
       
    80 *  @function GetMainTopics
       
    81 *  @since S60 3.2
       
    82 *  Get the instance of Main toc1
       
    83 *  @return toc1 pointer 
       
    84 */  
       
    85     IMPORT_C CCSXHGenericTOC1* GetMainTopics();
       
    86 /** 
       
    87 *  @function GetKywdTopics
       
    88 *  @since S60 3.2
       
    89 *  Get the instance of keyword toc1
       
    90 *  @return toc1 pointer 
       
    91 */  
       
    92     IMPORT_C CCSXHGenericTOC1* GetKywdTopics();
       
    93 /** 
       
    94 *  @function ClearAllTOC1Contents
       
    95 *  @since S60 3.2
       
    96 *  Delete all the objects from the Array
       
    97 */   
       
    98     IMPORT_C void ClearAllTOC1Contents();
       
    99 /** 
       
   100 *  @function GetContextTopic
       
   101 *  @since S60 3.2
       
   102 *  Delete all the objects from the Array
       
   103 *  @param aContextMessage - Message Sent by other Application
       
   104 *  @return Database pointer 
       
   105 */ 	
       
   106 	IMPORT_C CCSXHHelpContentBase* GetContextTopic(const TDesC8& aContextMessage);
       
   107 /** 
       
   108 *  @function GetHtmlTopicForUrlL
       
   109 *  @since S60 3.2
       
   110 *  Delete all the objects from the Array
       
   111 *  @param aurl - Html file path
       
   112 *  @return Database pointer 
       
   113 */ 	
       
   114 	IMPORT_C CCSXHHelpContentBase* GetHtmlTopicForUrlL(const TDesC& aurl);
       
   115 	
       
   116 /** 
       
   117 *  @function IncrementProgressBar
       
   118 *  @since S60 3.2
       
   119 *  Increments the progress info 
       
   120 *  @return progress info pointer
       
   121 */ 	
       
   122 	void IncrementKeywordSearchCount(TInt aUnits = 1);
       
   123 /** 
       
   124 *  @function GetLegacyParser
       
   125 *  @since S60 3.2
       
   126 *  Get LegacyContentparser
       
   127 *  @return LegacyContentParser pointer 
       
   128 */	
       
   129 	CCSXHLegacyContentParser* GetLegacyParser();
       
   130 /** 
       
   131 *  @function GetHtmlParser
       
   132 *  @since S60 3.2
       
   133 *  Get htmlContentparser
       
   134 *  @return HtmlContentParser pointer 
       
   135 */	
       
   136 	CCSXHHTMLContentParser* GetHtmlParser();
       
   137 /** 
       
   138 *  @function InsertKeywordL
       
   139 *  @since S60 3.2
       
   140 *  Insert into array
       
   141 *  @param aKywdName - Keyword Name
       
   142 *		  aToc1		- Toc1 Object
       
   143 */	
       
   144 	void InsertKeywordL(const TDesC& aKywdName, CCSXHHtmlTOC1* aToc1);
       
   145 /** 
       
   146 *  @function InsertKeywordL
       
   147 *  @since S60 3.2
       
   148 *  Insert into Array
       
   149 *  @param aKywdName 		- Keyword Name
       
   150 *		  aLegacyKywdIndex	- Position 
       
   151 *		  aCatUid			- Application Uid
       
   152 */	
       
   153 	void InsertKeywordL(const TDesC& aKywdName, TInt aLegacyKywdIndex, const TUid& aCatUid);
       
   154 
       
   155 
       
   156 /** 
       
   157 *  @function InitGenerateKeywordTOC2ListL
       
   158 *  @since S60 3.2
       
   159 *  Initializes the generation of kywd toc2 objects
       
   160 *  @param aKywdToc1 		- Keyword toc1 object
       
   161 */	
       
   162 	IMPORT_C TInt InitGenerateKeywordTOC2ListL(CCSXHKywdTOC1* aKywdToc1);
       
   163 
       
   164 /** 
       
   165 *  @function GenerateKeywordTOC2ListL
       
   166 *  @since S60 3.2
       
   167 *  Generate the toc2 objects,InitGenerateKeywordTOC2ListL has to be called first
       
   168 *  @param aKywdToc1 		- Keyword toc1 object
       
   169 */	
       
   170 	void GenerateKeywordTOC2ListL(CCSXHKywdTOC1* aKywdToc1);
       
   171 
       
   172 /** 
       
   173 *  @function InsertKeywordTopicL
       
   174 *  @since S60 3.2
       
   175 *  The caller should allocate memory for the aTOC2 object, if it is not successfully 
       
   176 *  added to the topic, then this function will free the memory
       
   177 *  @param 
       
   178 *  		  aToc2		- toc2 object
       
   179 */	
       
   180 	CCSXHKywdTOC1* InsertKeywordTopicL(CCSXHGenericTOC2* aToc2);
       
   181 	
       
   182 /** 
       
   183 *  @function InsertKeywordTopic
       
   184 *  @since S60 3.2
       
   185 *  The caller should allocate memory for the aTOC2 object, if it is not successfully 
       
   186 *  added to the topic, then this function will free the memory
       
   187 *  @param aToc1 - toc1 object
       
   188 *  		  aToc2	- toc2 object
       
   189 */	
       
   190 	void InsertKeywordTopic(CCSXHKywdTOC1* aToc1, CCSXHGenericTOC2* aToc2);
       
   191 
       
   192 /** 
       
   193 *  @function FillKeywordTopicsL
       
   194 *  @since S60 3.2
       
   195 *  Fills Keyword objects
       
   196 *  @param aBuilder - MCSXHKywdBuilder object
       
   197 */	
       
   198 	void FillKeywordTopicsL(MCSXHKywdBuilder* aBuilder);
       
   199 
       
   200 /** 
       
   201 *  @function GetCoeEnv
       
   202 *  @since S60 3.2
       
   203 *  Get the Control Environment
       
   204 *  @return pointer to control environment
       
   205 */
       
   206 	CCoeEnv* GetCoeEnv();
       
   207 /** 
       
   208 *  @function GetKeywordSearchCount
       
   209 *  @since S60 3.2
       
   210 *  Gets the current count of keywords for search result view
       
   211 *  @return TInt count
       
   212 */
       
   213 IMPORT_C	TInt GetKeywordSearchCount();
       
   214 	
       
   215   private:
       
   216 /** 
       
   217 *  @function ConstructL
       
   218 *  @since S60 3.2
       
   219 *  perform the second phase construction
       
   220 */
       
   221     void ConstructL();
       
   222 /** 
       
   223 *  @function CCSXHHelpDataBase
       
   224 *  @since S60 3.2
       
   225 *  Construct a CCSXHHelpDataBase
       
   226 *  @param aCoeEnv  - Control Environment
       
   227 */
       
   228     CCSXHHelpDataBase(CCoeEnv* aCoeEnv,const TApaAppCaption& aAppCaption);
       
   229 
       
   230 /** 
       
   231 *  @function GetContextTopicL
       
   232 *  @since S60 3.2
       
   233 *  Get the topic for the Context
       
   234 *  @param aContextMessage  - Message sent by other Application
       
   235 *  @return Database pointer	
       
   236 */    
       
   237     CCSXHHelpContentBase* GetContextTopicL(const TDesC8& aContextMessage);
       
   238     
       
   239     // List of TOC1 entries
       
   240     CCSXHMainTopics *iMainTOC1;
       
   241     // List of keyword entries
       
   242     CCSXHKywdTopics *iKywdTOC1;
       
   243     
       
   244     
       
   245     CCSXHHTMLContentParser *iHTMLContentParser;
       
   246     CCSXHLegacyContentParser *iLegacyContentParser;
       
   247     
       
   248 	CCoeEnv *iCoeEnv;
       
   249 	
       
   250 	CCSXHHelpContentBase *iLastContextTopic;
       
   251 	
       
   252 	MCSXHKywdBuilder *iKwydBuilder;
       
   253 	
       
   254 	TApaAppCaption iAppCaption;
       
   255 	
       
   256 	TInt iKeywordSearchCount;
       
   257 	
       
   258     };
       
   259 
       
   260 
       
   261 
       
   262 #endif /* INC_CSXHHELPDATABASE_H_HEADER_INCLUDED_BC054F58 */