|
1 /* |
|
2 * Copyright (c) 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: MSearchKeysEvent object implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CSEARCHKEYSEVENTIMP_H |
|
19 #define CSEARCHKEYSEVENTIMP_H |
|
20 |
|
21 #include <s32strm.h> |
|
22 #include "ximpapieventbase.h" |
|
23 #include <searchkeysevent.h> |
|
24 #include "searchapiobjbase.h" |
|
25 #include "searchtypehelpers.h" |
|
26 |
|
27 class RReadStream; |
|
28 |
|
29 class CSearchKeyInfoImp; |
|
30 |
|
31 /** |
|
32 * MSearchKeysEvent API object implementation. |
|
33 * |
|
34 * @lib searchdatamodel.dll |
|
35 */ |
|
36 NONSHARABLE_CLASS( CSearchKeysEventImp ): public CXIMPApiEventBase, |
|
37 public MSearchKeysEvent |
|
38 { |
|
39 public: |
|
40 /** The class ID. */ |
|
41 enum { KClassId = IMP_CLSID_CSEARCHKEYSEVENTIMP }; |
|
42 |
|
43 public: |
|
44 /** |
|
45 * Exported instantiation method for initializing |
|
46 * new event object. |
|
47 */ |
|
48 IMPORT_C static CSearchKeysEventImp* NewLC( RSearchKeyInfoImpArray* aKeyInfoArray ); |
|
49 |
|
50 |
|
51 /** |
|
52 * Instantiation method for event automation. |
|
53 * Method signature must be exactly this to work |
|
54 * with event delivery automation system. |
|
55 * |
|
56 * Event implementation must be registered to |
|
57 * SearchEventCodec KApiEventConstructorTable. |
|
58 */ |
|
59 static CXIMPApiEventBase* NewFromStreamLC( RReadStream& aStream ); |
|
60 |
|
61 /** |
|
62 * Destructor |
|
63 */ |
|
64 virtual ~CSearchKeysEventImp(); |
|
65 |
|
66 public: // From MSearchKeysEvent |
|
67 /** |
|
68 * |
|
69 * @see MSearchKeysEvent |
|
70 */ |
|
71 TInt InfoCount() const; |
|
72 /** |
|
73 * |
|
74 * @see MSearchKeysEvent |
|
75 */ |
|
76 const MSearchKeyInfo& SearchKeyInfo( TInt aIndex ) const; |
|
77 |
|
78 |
|
79 private: |
|
80 /** |
|
81 * constructor |
|
82 */ |
|
83 CSearchKeysEventImp(); |
|
84 |
|
85 /** |
|
86 * 2nd phase constructor |
|
87 */ |
|
88 void ConstructL( RSearchKeyInfoImpArray* aKeyInfoArray ); |
|
89 |
|
90 /** |
|
91 * 2nd phase constructor |
|
92 */ |
|
93 void ConstructL( RReadStream& aStream ); |
|
94 |
|
95 |
|
96 /** |
|
97 * internalize method |
|
98 */ |
|
99 void InternalizeL( RReadStream& aStream ) ; |
|
100 |
|
101 /** |
|
102 * Helper for externalize |
|
103 */ |
|
104 void WriteArrayToStreamL( RSearchKeyInfoImpArray& aKeyInfoArray, |
|
105 RWriteStream& aStream ) const; |
|
106 |
|
107 /** |
|
108 * Helper for internalize |
|
109 */ |
|
110 void FillArrayFromStreamL( RSearchKeyInfoImpArray& aKeyInfoArray, |
|
111 RReadStream& aStream ); |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 public: // From API base interfaces |
|
117 |
|
118 /** |
|
119 * Implementation of MXIMPBase interface methods |
|
120 * @see MXIMPBase |
|
121 */ |
|
122 XIMPIMP_DECLARE_IF_BASE_METHODS |
|
123 |
|
124 /** |
|
125 * Implementation of MSearchEventBase interface and |
|
126 * CSearchApiEventBase methods |
|
127 * |
|
128 */ |
|
129 XIMPIMP_DECLARE_EVENT_BASE_METHODS |
|
130 |
|
131 |
|
132 |
|
133 private: // data |
|
134 |
|
135 /** |
|
136 * RSupportedSearchKeyImpArray : owned |
|
137 */ |
|
138 RSearchKeyInfoImpArray* iInfoArray; |
|
139 |
|
140 |
|
141 }; |
|
142 |
|
143 |
|
144 #endif // CSEARCHKEYSEVENTIMP_H |