|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Class for document id which uinquely represents a file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_SEARCHDOCUMENTID_H |
|
20 #define C_SEARCHDOCUMENTID_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32def.h> |
|
24 #include <e32cmn.h> |
|
25 #include <s32strm.h> |
|
26 |
|
27 /** |
|
28 * This class references to a unique document matching the search criteria |
|
29 * |
|
30 * @lib searchutilities.lib |
|
31 */ |
|
32 NONSHARABLE_CLASS ( CSearchDocumentId ) : public CBase |
|
33 { |
|
34 |
|
35 public : |
|
36 /** |
|
37 * Two phased constructor |
|
38 * |
|
39 * @param aPluginId - Plugin id of the Document |
|
40 * @param aDocumentType - Document type of the Document |
|
41 * @param aRepositoryId - Repository id of the Document |
|
42 * @param aDocumentId - Document id of the Document |
|
43 * @return The instantiated cSearchDocumentId |
|
44 */ |
|
45 IMPORT_C static CSearchDocumentId* NewL( const TInt aDocumentId, TUid aPluginId ); |
|
46 |
|
47 /** |
|
48 * Two phased constructor |
|
49 * |
|
50 * @param aDocumentId - CSearchDocument from which the CSearchDocument is |
|
51 * to be instantiated |
|
52 * @return The instantiated cSearchDocumentId |
|
53 */ |
|
54 IMPORT_C static CSearchDocumentId* NewL( const CSearchDocumentId& aDocumentId ); |
|
55 |
|
56 |
|
57 /** |
|
58 * Two phased constructor |
|
59 * |
|
60 * @param aStream - Stream from which to construct the CSearchDocumentId object |
|
61 * @return The instantiated cSearchDocumentId |
|
62 */ |
|
63 IMPORT_C static CSearchDocumentId* NewL( RReadStream& aStream ); |
|
64 |
|
65 |
|
66 /** |
|
67 * Destructor |
|
68 */ |
|
69 virtual ~CSearchDocumentId(); |
|
70 |
|
71 /** |
|
72 * Externalizes the CSearchDocumentId class to the stream |
|
73 * @param aStream - Stream to which to write the class data to |
|
74 */ |
|
75 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
76 |
|
77 |
|
78 /** |
|
79 * Getter function for the pluginId of the CSearchDocumentId |
|
80 * @return - Returns the Plugin Id |
|
81 */ |
|
82 IMPORT_C TUid PluginId() const; |
|
83 |
|
84 |
|
85 /** |
|
86 * Getter function for the RepositoryId of the CSearchDocumentId |
|
87 * @return - Returns RepositoryId of the CSearchDocumentId |
|
88 */ |
|
89 IMPORT_C const TInt32 RepositoryId() const; |
|
90 |
|
91 |
|
92 /** |
|
93 * Getter function for the DocumentId of the CSearchDocumentId |
|
94 * @return - Returns DocumentId of the CSearchDocumentId |
|
95 */ |
|
96 IMPORT_C const TInt DocumentId() const; |
|
97 |
|
98 |
|
99 /** |
|
100 * Sets the repository id |
|
101 * @param - aRepositoryId |
|
102 */ |
|
103 IMPORT_C void SetRepositoryIdL( const TInt32 aRepositoryId ); |
|
104 |
|
105 |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * Default Constructor |
|
111 * @param - aPluginId Plugin Id |
|
112 */ |
|
113 CSearchDocumentId( TUid aPluginId ); |
|
114 |
|
115 /** |
|
116 * ConstructL function that sets document id and repository ids that are taken as |
|
117 * args. |
|
118 * @param aDocumentId - Document id |
|
119 */ |
|
120 void ConstructL( const TInt aDocumentId ); |
|
121 |
|
122 /** |
|
123 * ConstructL function that sets document id and repository ids that are taken as |
|
124 * args. |
|
125 * |
|
126 * @param aRepositoryId - Repository id |
|
127 * @param aDocumentId - Document id |
|
128 */ |
|
129 void ConstructL( const TInt32 aRepositoryId, const TInt aDocumentId ); |
|
130 |
|
131 /** |
|
132 * ConstructL function that initializes the RepositoryId and DocumentId of |
|
133 * the class read from aStream which is passed as an argument |
|
134 * |
|
135 * @param aStream - Stream from where to read |
|
136 */ |
|
137 void ConstructL( RReadStream& aStream ); |
|
138 |
|
139 private: //data |
|
140 |
|
141 /** |
|
142 * Plugin Id |
|
143 */ |
|
144 TUid iPluginId; |
|
145 |
|
146 /** |
|
147 * Repository Id |
|
148 */ |
|
149 TInt32 iRepositoryId; |
|
150 |
|
151 /** |
|
152 * Document Id |
|
153 * Own |
|
154 */ |
|
155 TInt iDocumentId; |
|
156 }; |
|
157 |
|
158 #endif //C_SEARCHDOCUMENTID_H |