|
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: The virtual phonebook get own contact link operation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "COwnContactLinkOperation.h" |
|
20 |
|
21 #include <MVPbkContactLink.h> |
|
22 #include <MVPbkSingleContactLinkOperationObserver.h> |
|
23 |
|
24 namespace VPbkCntModel { |
|
25 |
|
26 COwnContactLinkOperation::COwnContactLinkOperation( |
|
27 MVPbkContactLink* aOwnContactLink, |
|
28 MVPbkSingleContactLinkOperationObserver& aObserver ): |
|
29 CActive( CActive::EPriorityStandard ), |
|
30 iOwnContactLink( aOwnContactLink ), |
|
31 iObserver( aObserver ) |
|
32 { |
|
33 CActiveScheduler::Add( this ); |
|
34 |
|
35 // this operation just delivers ready contact link asynchronnously |
|
36 // it's ready right away |
|
37 TRequestStatus* status = &iStatus; |
|
38 User::RequestComplete( status, KErrNone ); |
|
39 SetActive(); |
|
40 } |
|
41 |
|
42 COwnContactLinkOperation::~COwnContactLinkOperation() |
|
43 { |
|
44 delete iOwnContactLink; |
|
45 Cancel(); |
|
46 } |
|
47 |
|
48 void COwnContactLinkOperation::RunL() |
|
49 { |
|
50 if ( iOwnContactLink ) |
|
51 { |
|
52 iObserver.VPbkSingleContactLinkOperationComplete( *this, iOwnContactLink ); |
|
53 iOwnContactLink = NULL; //pass ownership |
|
54 } |
|
55 else |
|
56 { |
|
57 iObserver.VPbkSingleContactLinkOperationFailed( *this, KErrNotFound ); |
|
58 } |
|
59 } |
|
60 |
|
61 void COwnContactLinkOperation::DoCancel() |
|
62 { |
|
63 } |
|
64 |
|
65 } // namespace VPbkCntModel |
|
66 //End of file |