|
1 /* |
|
2 * Copyright (c) 2004-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: Virtual Phonebook Contact model phone number match operation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMATCHPHONENUMBEROPERATION_H |
|
20 #define CMATCHPHONENUMBEROPERATION_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <MVPbkContactOperation.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVPbkContactFindObserver; |
|
28 class MVPbkContactLink; |
|
29 class CContactIdArray; |
|
30 class CVPbkContactLinkArray; |
|
31 |
|
32 namespace VPbkCntModel { |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CContactStore; |
|
36 |
|
37 /** |
|
38 * Virtual Phonebook Contact model phone number match operation. |
|
39 */ |
|
40 NONSHARABLE_CLASS( CMatchPhoneNumberOperation ): |
|
41 public CActive, |
|
42 public MVPbkContactOperation |
|
43 { |
|
44 public: |
|
45 static CMatchPhoneNumberOperation* NewL( |
|
46 CContactStore& aContactStore, |
|
47 const TDesC& aPhoneNumber, |
|
48 TInt aMaxMatchDigits, |
|
49 MVPbkContactFindObserver& aObserver); |
|
50 ~CMatchPhoneNumberOperation(); |
|
51 |
|
52 public: // From MVPbkContactOperation |
|
53 void StartL(); |
|
54 void Cancel(); |
|
55 |
|
56 private: // From CActive |
|
57 void DoCancel(); |
|
58 void RunL(); |
|
59 TInt RunError(TInt aError); |
|
60 |
|
61 private: // Implementation |
|
62 CMatchPhoneNumberOperation( |
|
63 CContactStore& aContactStore, |
|
64 TInt aMaxMatchDigits, |
|
65 MVPbkContactFindObserver& aObserver); |
|
66 void ConstructL(const TDesC& aPhoneNumber); |
|
67 void IssueRequest(); |
|
68 |
|
69 private: // Data |
|
70 ///Ref: contact store |
|
71 CContactStore& iContactStore; |
|
72 ///Ref: find observer |
|
73 MVPbkContactFindObserver& iObserver; |
|
74 ///Own: max digits to match |
|
75 TInt iMaxMatchDigits; |
|
76 ///Own: phone number |
|
77 HBufC* iPhoneNumber; |
|
78 ///Own: matching contact ids |
|
79 CContactIdArray* iContactIds; |
|
80 ///Own: find results |
|
81 CVPbkContactLinkArray* iResults; |
|
82 enum TState |
|
83 { |
|
84 EMatch, |
|
85 EBuildLinks, |
|
86 EComplete, |
|
87 ECancelled |
|
88 }; |
|
89 ///Own: find operation state |
|
90 TState iState; |
|
91 |
|
92 }; |
|
93 |
|
94 } // namespace VPbkCntModel |
|
95 |
|
96 #endif // CMATCHPHONENUMBEROPERATION_H |
|
97 |
|
98 //End of file |