|
1 /* |
|
2 * Copyright (c) 2002-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: A SIM contact view subsession. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef RVPBKSIMCNTVIEW_H |
|
20 #define RVPBKSIMCNTVIEW_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <VPbkSimStoreCommon.h> |
|
25 #include <VPbkSimServerCommon.h> |
|
26 #include <bamdesca.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class RVPbkSimStore; |
|
30 class RVPbkSimFieldTypeArray; |
|
31 class CVPbkSimFieldTypeFilter; |
|
32 struct TVPbkSimContactEventData; |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * A SIM contact view subsession. |
|
39 * |
|
40 */ |
|
41 class RVPbkSimCntView : public RSubSessionBase |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * C++ constructor. |
|
47 */ |
|
48 IMPORT_C RVPbkSimCntView(); |
|
49 |
|
50 public: // New functions |
|
51 |
|
52 /** |
|
53 * Opens a view subsession. |
|
54 * |
|
55 * @param aStore An open parent store session. |
|
56 * @param aSortOrder The sortorder for the view. |
|
57 * @param aConstructionPolicy Defines the way the view |
|
58 * is constructed. |
|
59 * @param aViewName The name of the view for the |
|
60 * shared view or KNullDesC. |
|
61 * @param aFilter Field type filter or NULL |
|
62 * @exception KErrArgument If invalid sortorder or |
|
63 * store is not ready. |
|
64 */ |
|
65 IMPORT_C void OpenL( |
|
66 RVPbkSimStore& aStore, |
|
67 const RVPbkSimFieldTypeArray& aSortOrder, |
|
68 TVPbkSimViewConstructionPolicy aConstructionPolicy, |
|
69 const TDesC& aViewName, |
|
70 CVPbkSimFieldTypeFilter* aFilter ); |
|
71 |
|
72 /** |
|
73 * Closes the view subsession |
|
74 */ |
|
75 IMPORT_C void Close(); |
|
76 |
|
77 /** |
|
78 * Cancels asynchronous store request. |
|
79 * |
|
80 * @param aReqToCancel An asynchronous operation code |
|
81 * from VPbkSimServerOpCodes.h. |
|
82 */ |
|
83 IMPORT_C void CancelAsyncRequest( |
|
84 TInt aReqToCancel ); |
|
85 |
|
86 /** |
|
87 * Starts listening to view events. |
|
88 * |
|
89 * @param aStatus The request status completed by the server. |
|
90 * @param aEvent The view event data structure filled by the server. |
|
91 */ |
|
92 IMPORT_C void ListenToViewEvents( |
|
93 TRequestStatus& aStatus, |
|
94 TVPbkSimContactEventData& aEvent ); |
|
95 |
|
96 /** |
|
97 * Returns the number of contacts in the view. |
|
98 * |
|
99 * @return The number of contacts in the view. |
|
100 */ |
|
101 IMPORT_C TInt CountL() const; |
|
102 |
|
103 /** |
|
104 * Returns a view contact in specified index. |
|
105 * |
|
106 * @param aIndex The view index of the contact. |
|
107 * @exception KErrArgument If invalid index. |
|
108 * @return A pointer to view contact in ETel format. The contact. |
|
109 * is valid until next call to this function. |
|
110 */ |
|
111 IMPORT_C TPtr8 ContactAtL( |
|
112 TInt aIndex ); |
|
113 |
|
114 /** |
|
115 * Starts reordering of the contacts in the view. |
|
116 * |
|
117 * @param aSortOrder The new sort order. |
|
118 */ |
|
119 IMPORT_C void ChangeSortOrderL( |
|
120 const RVPbkSimFieldTypeArray& aSortOrder ); |
|
121 |
|
122 /** |
|
123 * Finds the view index of the contact whose sim index is given. |
|
124 * |
|
125 * @param aSimIndex The SIM index of the contact. |
|
126 * @return The view index or KErrNotFound. |
|
127 */ |
|
128 IMPORT_C TInt FindViewIndexL( |
|
129 TInt aSimIndex ); |
|
130 |
|
131 /** |
|
132 * Contact matching prefix |
|
133 * |
|
134 * @param aFindStrings |
|
135 * @param aResultBufferSize, contact matching result buffer's size |
|
136 * @param aStatus The request status completed by the server. |
|
137 */ |
|
138 IMPORT_C void ContactMatchingPrefixL( |
|
139 const MDesCArray& aFindStrings, |
|
140 TInt& aResultBufferSize, |
|
141 TRequestStatus& aStatus ); |
|
142 |
|
143 /** |
|
144 * Get contact matching result, synchronous function |
|
145 * |
|
146 * @param aSimMatchResultBufPtr |
|
147 */ |
|
148 IMPORT_C void ContactMatchingResultL( |
|
149 TPtr8& aSimMatchResultBufPtr ); |
|
150 |
|
151 /** |
|
152 * Gets the sort order of the view. |
|
153 * |
|
154 * It can be internalized using RVPbkSimFieldTypeArray |
|
155 * |
|
156 * @return A packed sort order. Ownership is given. |
|
157 */ |
|
158 IMPORT_C HBufC8* SortOrderL() const; |
|
159 |
|
160 private: // Implementation |
|
161 /// Double the size of the buffer or leave if max size achieved |
|
162 void EnlargeBufferOrLeaveL(); |
|
163 // Prohibit copy constructor if not deriving from CBase. |
|
164 RVPbkSimCntView( |
|
165 const RVPbkSimCntView& ); |
|
166 // Prohibit assigment operator if not deriving from CBase. |
|
167 RVPbkSimCntView& operator=( |
|
168 const RVPbkSimCntView& ); |
|
169 HBufC8* SerializeParametersL( |
|
170 const TDesC* aViewName, |
|
171 const HBufC8* aFilterBuffer ) const; |
|
172 |
|
173 private: // Data |
|
174 /// Own: Descriptor pointer for the view event |
|
175 TPtr8 iViewEvent; |
|
176 /// Own: Buffer for ETel contact |
|
177 HBufC8* iContactBuf; |
|
178 /// Own: Pointer for the ETel contact |
|
179 TPtr8 iContactPtr; |
|
180 /// Own: |
|
181 HBufC8* iMatchingBuffer; |
|
182 /// The sim index of the saved contact |
|
183 TPtr8 iMatchingBufferSize; |
|
184 }; |
|
185 |
|
186 #endif // RVPBKSIMCNTVIEW_H |
|
187 |
|
188 // End of File |