1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
20 #include <e32std.h> |
20 #include <e32std.h> |
21 #include <badesca.h> // For MDesCArray |
21 #include <badesca.h> // For MDesCArray |
22 #include <txtmrtsr.h> // For MRichTextStoreResolver |
22 #include <txtmrtsr.h> // For MRichTextStoreResolver |
23 #include <gdi.h> // For MPictureFactory |
23 #include <gdi.h> // For MPictureFactory |
24 #include <d32dbms.h> |
24 #include <d32dbms.h> |
25 |
|
26 // Help model includes |
25 // Help model includes |
27 #include "hlpconstants.h" |
26 #include "hlpconstants.h" |
28 |
27 |
29 // Classes referenced |
28 // Classes referenced |
30 class CRichText; |
29 class CRichText; |
36 class CCharFormatLayer; |
35 class CCharFormatLayer; |
37 class CHlpPicture; |
36 class CHlpPicture; |
38 |
37 |
39 // Typedefs |
38 // Typedefs |
40 /** |
39 /** |
41 @internalComponent |
40 @publishedAll |
42 @released |
41 @released |
43 */ |
42 */ |
44 typedef CArrayPtrFlat<CHlpDatabase> CHlpDatabases; |
43 typedef CArrayPtrFlat<CHlpDatabase> CHlpDatabases; |
45 |
44 |
|
45 /** |
|
46 @publishedAll |
|
47 @released |
|
48 */ |
|
49 typedef CArrayPtrFlat<CHlpFileEntry> CHlpFileList; |
|
50 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
51 /** Maximum Title column. |
|
52 @publishedAll |
|
53 @released |
|
54 */ |
|
55 const TInt KMaxTitleColumn = 120; |
|
56 #endif |
|
57 |
|
58 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
46 /** |
59 /** |
47 @internalComponent |
60 @internalComponent |
48 @released |
61 @released |
49 */ |
62 */ |
50 typedef CArrayPtrFlat<CHlpFileEntry> CHlpFileList; |
63 const TInt KHlpModelDefaultNumberOfImagesForV6Point2Files = 1; |
51 |
64 /** |
|
65 @internalComponent |
|
66 @released |
|
67 */ |
|
68 const TInt KHlpModelMaximumNumberOfImagesForV6Point2Files = 3; |
|
69 // |
|
70 /** Default zoom factor for small zoom size. |
|
71 @internalComponent |
|
72 @released |
|
73 */ |
|
74 const TInt KHlpModelZoomFactorSmall = 750; |
|
75 /** Default zoom factor for medium zoom size. |
|
76 @internalComponent |
|
77 @released |
|
78 */ |
|
79 const TInt KHlpModelZoomFactorMedium = 1000; |
|
80 /** Default zoom factor for large zoom size. |
|
81 @internalComponent |
|
82 @released |
|
83 */ |
|
84 const TInt KHlpModelZoomFactorLarge = 1250; |
|
85 |
|
86 /** Default zoom factor for medium zoom size as real number. |
|
87 @internalComponent |
|
88 @released |
|
89 */ |
|
90 const TReal KHlpModelDefaultZoomFactorAsRealNumber = 1000.0; |
|
91 |
|
92 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
52 |
93 |
53 class MHlpModelObserver |
94 class MHlpModelObserver |
54 /** Client callback inteface to receive events from the help model. |
95 /** Client callback inteface to receive events from the help model. |
55 @publishedAll |
96 @publishedAll |
56 @released |
97 @released |
62 @param aEvent Help model event. Events are listed in the enums that begin |
103 @param aEvent Help model event. Events are listed in the enums that begin |
63 ECategoryListAvailable, and ENoRecordsFound. */ |
104 ECategoryListAvailable, and ENoRecordsFound. */ |
64 virtual void HandleModelEventL(TInt aEvent) = 0; |
105 virtual void HandleModelEventL(TInt aEvent) = 0; |
65 }; |
106 }; |
66 |
107 |
67 // |
108 |
68 // Internal API to handle events reported by the search engine |
|
69 // |
|
70 class MHlpDbObserver |
109 class MHlpDbObserver |
71 /** |
110 /** Internal API to handle events reported by the search engine |
72 @internalComponent |
111 @publishedAll |
73 @released |
112 @released |
74 */ |
113 */ |
75 { |
114 { |
76 public: // TInt aEvent should be a named enum |
115 public: // TInt aEvent should be a named enum |
77 virtual void HandleDbEventL(TInt aEvent) = 0; |
116 virtual void HandleDbEventL(TInt aEvent) = 0; |
78 }; |
117 }; |
79 |
118 |
80 // |
119 // |
81 // Search types (these should be named, but SC cannot be broken until v7.0 |
120 // Search types (these should be named, but SC cannot be broken until v7.0 |
82 // |
121 // |
83 /** Defines the search types for use with CHlpModel::SearchL(). */ |
122 /** Defines the search types for use with CHlpModel::SearchL(). |
|
123 @publishedAll |
|
124 @released |
|
125 */ |
84 enum |
126 enum |
85 { |
127 { |
86 /** Gets a list of index entries for all help files. |
128 /** Gets a list of index entries for all help files. |
87 |
129 |
88 Success is indicated by an EIndexListAvailable event; failure by EIndexListNoneFound. |
130 Success is indicated by an EIndexListAvailable event; failure by EIndexListNoneFound. |
135 |
177 |
136 // |
178 // |
137 // Search progress responses (this should be scoped as members of MHlpModelObserver |
179 // Search progress responses (this should be scoped as members of MHlpModelObserver |
138 // and should also be named, but SC cannot be broken until v7.0 |
180 // and should also be named, but SC cannot be broken until v7.0 |
139 // |
181 // |
|
182 /** Search progress responses |
|
183 @publishedAll |
|
184 @released |
|
185 */ |
140 enum |
186 enum |
141 { |
187 { |
142 ENoRecordsFound, |
188 ENoRecordsFound, |
143 ESearchInProgress, |
189 ESearchInProgress, |
144 ESearchComplete |
190 ESearchComplete |
145 }; |
191 }; |
146 |
192 |
147 // |
193 // |
148 // Search progress responses (ditto for naming and scoping) |
194 // Search progress responses (ditto for naming and scoping) |
149 // |
195 // |
150 /** Help model search result events*/ |
196 /** Help model search result events |
|
197 @publishedAll |
|
198 @released |
|
199 */ |
151 enum |
200 enum |
152 { |
201 { |
153 /** The search returned a category list. |
202 /** The search returned a category list. |
154 |
203 |
155 The list can be retrieved using CHlpModel::CategoryListL(). */ |
204 The list can be retrieved using CHlpModel::CategoryListL(). */ |
189 /** The search is in progress. */ |
238 /** The search is in progress. */ |
190 EModelSearchInProgress, |
239 EModelSearchInProgress, |
191 /** The search has been cancelled. */ |
240 /** The search has been cancelled. */ |
192 EHlpSearchCancelled |
241 EHlpSearchCancelled |
193 }; |
242 }; |
194 |
243 |
195 /** Defines help model zoom sizes. */ |
244 // Constants |
|
245 |
|
246 /** Defines help model zoom sizes. |
|
247 @publishedAll |
|
248 @released |
|
249 */ |
196 enum THlpZoomState |
250 enum THlpZoomState |
197 { |
251 { |
198 /** Small zoom. */ |
252 /** Small zoom. */ |
199 EHlpZoomStateSmall = 0, |
253 EHlpZoomStateSmall = 0, |
200 /** Medium zoom. */ |
254 /** Medium zoom. */ |
201 EHlpZoomStateMedium = 1, |
255 EHlpZoomStateMedium = 1, |
202 /** Large zoom. */ |
256 /** Large zoom. */ |
203 EHlpZoomStateLarge = 2 |
257 EHlpZoomStateLarge = 2 |
204 }; |
258 }; |
205 |
259 |
206 // Constants |
|
207 const TInt KHlpModelDefaultNumberOfImagesForV6Point2Files = 1; |
|
208 const TInt KHlpModelMaximumNumberOfImagesForV6Point2Files = 3; |
|
209 // |
|
210 /** Default zoom factor for small zoom size. */ |
|
211 const TInt KHlpModelZoomFactorSmall = 750; |
|
212 /** Default zoom factor for medium zoom size. */ |
|
213 const TInt KHlpModelZoomFactorMedium = 1000; |
|
214 /** Default zoom factor for large zoom size. */ |
|
215 const TInt KHlpModelZoomFactorLarge = 1250; |
|
216 // |
|
217 /** Default zoom factor for medium zoom size as real number. */ |
|
218 const TReal KHlpModelDefaultZoomFactorAsRealNumber = 1000.0; |
|
219 |
|
220 |
260 |
221 class CHlpItem : public CBase |
261 class CHlpItem : public CBase |
222 /** Encapsulates an individual item in a help file. |
262 /** Encapsulates an individual item in a help file. |
223 |
263 |
224 Note that item IDs are assigned in increasing numerical order by the help |
264 Note that item IDs are assigned in increasing numerical order by the help |
294 virtual TUint32 At(TInt aIndex) const = 0; |
334 virtual TUint32 At(TInt aIndex) const = 0; |
295 }; |
335 }; |
296 |
336 |
297 |
337 |
298 |
338 |
299 /////////////////////////////////////////////////////////////////////////////////////// |
339 // |
300 // ----> CHlpList |
340 // ----> CHlpList |
301 /////////////////////////////////////////////////////////////////////////////////////// |
341 // |
302 class CHlpList : public CBase, public MHlpTitleArray |
342 class CHlpList : public CBase, public MHlpTitleArray |
303 /** A list of help items (CHlpItem objects). |
343 /** A list of help items (CHlpItem objects). |
304 @publishedAll |
344 @publishedAll |
305 @released |
345 @released |
306 */ |
346 */ |
334 CArrayPtr<CHlpItem>* iList; |
374 CArrayPtr<CHlpItem>* iList; |
335 }; |
375 }; |
336 |
376 |
337 |
377 |
338 |
378 |
339 /////////////////////////////////////////////////////////////////////////////////////// |
379 // |
340 // ----> CHlpTopic |
380 // ----> CHlpTopic |
341 /////////////////////////////////////////////////////////////////////////////////////// |
381 // |
342 class CHlpTopic : public CBase |
382 class CHlpTopic : public CBase |
343 /** Encapsulates a help topic. |
383 /** Encapsulates a help topic. |
344 |
384 |
345 A help topic has text, a title, a category, and paragraph and character formatting. |
385 A help topic has text, a title, a category, and paragraph and character formatting. |
346 @publishedAll |
386 @publishedAll |
390 }; |
430 }; |
391 |
431 |
392 |
432 |
393 |
433 |
394 |
434 |
395 /////////////////////////////////////////////////////////////////////////////////////// |
435 // |
396 // ----> CHlpModel |
436 // ----> CHlpModel |
397 /////////////////////////////////////////////////////////////////////////////////////// |
437 // |
398 class CHlpModel : public CBase, public MHlpDbObserver, public MPictureFactory, public MRichTextStoreResolver |
438 class CHlpModel : public CBase, public MHlpDbObserver, public MPictureFactory, public MRichTextStoreResolver |
399 /** Help model interface. |
439 /** Help model interface. |
400 |
440 |
401 It provides functions to search help files in various ways. |
441 It provides functions to search help files in various ways. |
402 |
442 |
526 |
566 |
527 // Array to hold the zoom factors that correspond to each zoom size |
567 // Array to hold the zoom factors that correspond to each zoom size |
528 CArrayFix<TInt>* iZoomFactors; |
568 CArrayFix<TInt>* iZoomFactors; |
529 }; |
569 }; |
530 |
570 |
531 |
571 // |
532 |
|
533 |
|
534 |
|
535 /////////////////////////////////////////////////////////////////////////////////////// |
|
536 // ----> CHlpModel (inlines) |
572 // ----> CHlpModel (inlines) |
537 /////////////////////////////////////////////////////////////////////////////////////// |
573 // |
538 inline TInt CHlpModel::DatabaseCount() const |
574 inline TInt CHlpModel::DatabaseCount() const |
539 { |
575 { |
540 return iDatabases->Count(); |
576 return iDatabases->Count(); |
541 } |
577 } |
542 inline void CHlpModel::SetSearchType(TInt aSearchType) |
578 inline void CHlpModel::SetSearchType(TInt aSearchType) |