|
1 /* |
|
2 * Copyright (c) 2010 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 #ifndef INPSEARCHDOCUMENT_H_ |
|
18 #define INPSEARCHDOCUMENT_H_ |
|
19 |
|
20 struct NPDocumentFieldObject; |
|
21 |
|
22 /** |
|
23 * CSearchDocument represents one entity in index database, e.g. it can appear in search result. |
|
24 * Each document may have multiple fields, which values may or may not be indexed and stored to database. |
|
25 * See CDocumentField for details. |
|
26 */ |
|
27 class MNPSearchDocument |
|
28 { |
|
29 public: |
|
30 |
|
31 /** |
|
32 * FIXME: Add L to mark leaving |
|
33 * |
|
34 * Find field by name. Returns NULL, if field is not found with given name. |
|
35 * @param aName Name of the field. |
|
36 * @return First field with given name or NULL if no field is found. |
|
37 */ |
|
38 virtual NPDocumentFieldObject* FieldL(const TDesC& aName) = 0; |
|
39 |
|
40 /** |
|
41 * Id of this document. |
|
42 * @return Id of this document. |
|
43 */ |
|
44 virtual const TDesC& Id() const = 0; |
|
45 |
|
46 /** |
|
47 * Application class of this document. |
|
48 * @return Id of this document. |
|
49 */ |
|
50 virtual const TDesC& AppClass() const = 0; |
|
51 |
|
52 /** |
|
53 * Excerpt of this document. |
|
54 * @return Id of this document. |
|
55 */ |
|
56 virtual const TDesC& Excerpt() const = 0; |
|
57 |
|
58 /** |
|
59 * Number of fields in this document. |
|
60 * @return Number of fields in this document. |
|
61 */ |
|
62 virtual TInt FieldCount() const = 0; |
|
63 |
|
64 /** |
|
65 * FIXME: Add L to mark leaving |
|
66 * |
|
67 * Returns a field specified by the index. |
|
68 * Returns NULL if index is negative or greater than the number of fields currently in document. |
|
69 * @param aIndex Index of a field to be returned. |
|
70 * @return Field pointed by the index, or NULL, if index is out of bounds |
|
71 */ |
|
72 virtual NPDocumentFieldObject* FieldL( const TInt aIndex ) = 0; |
|
73 }; |
|
74 |
|
75 #endif /*INPSEARCHDOCUMENT_H_*/ |