|
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: Phonebook 2 view loader |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2VIEWLOADER_H |
|
20 #define CPBK2VIEWLOADER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MVPbkContactViewObserver.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MPbk2ViewLoaderObserver; |
|
29 class MVPbkContactViewBase; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Phonebook 2 view loader |
|
35 * Responsible for: |
|
36 * - Load given view and inform when it is ready to use. |
|
37 */ |
|
38 NONSHARABLE_CLASS( CPbk2ViewLoader ): public CBase, |
|
39 public MVPbkContactViewObserver |
|
40 |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Creates a new instance of this class. |
|
45 * |
|
46 * @param aObserver view loader's observer |
|
47 * @return A new instance of this class. |
|
48 */ |
|
49 static CPbk2ViewLoader* NewL( |
|
50 MVPbkContactViewBase& aView, |
|
51 MPbk2ViewLoaderObserver& aObserver ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CPbk2ViewLoader(); |
|
57 |
|
58 private: // From MVPbkContactViewObserver |
|
59 /** |
|
60 * If subclass overwrites this it must first call the |
|
61 * base class version. |
|
62 */ |
|
63 void ContactViewReady( |
|
64 MVPbkContactViewBase& aView ); |
|
65 /** |
|
66 * If subclass overwrites this it must first call the |
|
67 * base class version. |
|
68 */ |
|
69 void ContactViewUnavailable( |
|
70 MVPbkContactViewBase& aView ); |
|
71 /** |
|
72 * If subclass overwrites this it must first call the |
|
73 * base class version. |
|
74 */ |
|
75 void ContactAddedToView( |
|
76 MVPbkContactViewBase& aView, |
|
77 TInt aIndex, |
|
78 const MVPbkContactLink& aContactLink ); |
|
79 /** |
|
80 * If subclass overwrites this it must first call the |
|
81 * base class version. |
|
82 */ |
|
83 void ContactRemovedFromView( |
|
84 MVPbkContactViewBase& aView, |
|
85 TInt aIndex, |
|
86 const MVPbkContactLink& aContactLink ); |
|
87 /** |
|
88 * If subclass overwrites this it must first call the |
|
89 * base class version. |
|
90 */ |
|
91 void ContactViewError( |
|
92 MVPbkContactViewBase& aView, |
|
93 TInt aError, |
|
94 TBool aErrorNotified ); |
|
95 |
|
96 private: // Implementation |
|
97 CPbk2ViewLoader( |
|
98 MVPbkContactViewBase& aView, |
|
99 MPbk2ViewLoaderObserver& aObserver ); |
|
100 void ConstructL(); |
|
101 |
|
102 private: // Data |
|
103 /// Ref: Loaded view |
|
104 MVPbkContactViewBase& iView; |
|
105 /// Ref: Observer view loading |
|
106 MPbk2ViewLoaderObserver& iObserver; |
|
107 }; |
|
108 |
|
109 #endif // CPBK2VIEWLOADER_H |
|
110 |
|
111 // End of File |