|
1 /* |
|
2 * Copyright (c) 2005-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: Phonebook2 view loader |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "CPbk2ViewLoader.h" |
|
21 |
|
22 // Phonebook 2 |
|
23 #include "MPbk2ViewLoaderObserver.h" |
|
24 |
|
25 // Virtual Phonebook |
|
26 #include <MVPbkContactViewBase.h> |
|
27 |
|
28 // -------------------------------------------------------------------------- |
|
29 // CPbk2ViewLoader::CPbk2ViewLoader |
|
30 // -------------------------------------------------------------------------- |
|
31 // |
|
32 CPbk2ViewLoader::CPbk2ViewLoader( |
|
33 MVPbkContactViewBase& aView, |
|
34 MPbk2ViewLoaderObserver& aObserver ) : |
|
35 iView( aView ), iObserver( aObserver ) |
|
36 { |
|
37 // Do nothing |
|
38 } |
|
39 |
|
40 // -------------------------------------------------------------------------- |
|
41 // CPbk2ViewLoader::~CPbk2ViewLoader |
|
42 // -------------------------------------------------------------------------- |
|
43 // |
|
44 CPbk2ViewLoader::~CPbk2ViewLoader() |
|
45 { |
|
46 iView.RemoveObserver( *this ); |
|
47 } |
|
48 |
|
49 // -------------------------------------------------------------------------- |
|
50 // CPbk2ViewLoader::NewL |
|
51 // -------------------------------------------------------------------------- |
|
52 // |
|
53 CPbk2ViewLoader* CPbk2ViewLoader::NewL( |
|
54 MVPbkContactViewBase& aView, |
|
55 MPbk2ViewLoaderObserver& aObserver ) |
|
56 { |
|
57 CPbk2ViewLoader* self = |
|
58 new( ELeave ) CPbk2ViewLoader( aView, aObserver ); |
|
59 CleanupStack::PushL( self ); |
|
60 self->ConstructL(); |
|
61 CleanupStack::Pop( self ); |
|
62 return self; |
|
63 } |
|
64 |
|
65 // -------------------------------------------------------------------------- |
|
66 // CPbk2ViewLoader::ConstructL |
|
67 // -------------------------------------------------------------------------- |
|
68 // |
|
69 inline void CPbk2ViewLoader::ConstructL() |
|
70 { |
|
71 iView.AddObserverL( *this ); |
|
72 } |
|
73 |
|
74 // -------------------------------------------------------------------------- |
|
75 // CPbk2ViewLoader::ContactViewReady |
|
76 // -------------------------------------------------------------------------- |
|
77 // |
|
78 void CPbk2ViewLoader::ContactViewReady( |
|
79 MVPbkContactViewBase& aView ) |
|
80 { |
|
81 iObserver.ViewLoaded( aView ); |
|
82 } |
|
83 |
|
84 // -------------------------------------------------------------------------- |
|
85 // CPbk2ViewLoader::ContactViewUnavailable |
|
86 // -------------------------------------------------------------------------- |
|
87 // |
|
88 void CPbk2ViewLoader::ContactViewUnavailable( |
|
89 MVPbkContactViewBase& /*aView*/ ) |
|
90 { |
|
91 // Do nothing |
|
92 } |
|
93 |
|
94 // -------------------------------------------------------------------------- |
|
95 // CPbk2ViewLoader::ContactAddedToView |
|
96 // -------------------------------------------------------------------------- |
|
97 // |
|
98 void CPbk2ViewLoader::ContactAddedToView( |
|
99 MVPbkContactViewBase& /*aView*/, |
|
100 TInt /*aIndex*/, |
|
101 const MVPbkContactLink& /*aContactLink*/ ) |
|
102 { |
|
103 // Do nothing |
|
104 } |
|
105 |
|
106 // -------------------------------------------------------------------------- |
|
107 // CPbk2ViewLoader::ContactRemovedFromView |
|
108 // -------------------------------------------------------------------------- |
|
109 // |
|
110 void CPbk2ViewLoader::ContactRemovedFromView( |
|
111 MVPbkContactViewBase& /*aView*/, |
|
112 TInt /*aIndex*/, |
|
113 const MVPbkContactLink& /*aContactLink*/ ) |
|
114 { |
|
115 // Do nothing |
|
116 } |
|
117 |
|
118 // -------------------------------------------------------------------------- |
|
119 // CPbk2ViewLoader::ContactViewError |
|
120 // -------------------------------------------------------------------------- |
|
121 // |
|
122 void CPbk2ViewLoader::ContactViewError( |
|
123 MVPbkContactViewBase& aView, |
|
124 TInt aError, |
|
125 TBool /*aErrorNotified*/ ) |
|
126 { |
|
127 iObserver.ViewError( aView, aError ); |
|
128 } |
|
129 |
|
130 // End of File |