|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Phonebook contact view listbox model. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPbkContactViewListCacheModel_H__ |
|
21 #define __CPbkContactViewListCacheModel_H__ |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "CPbkContactViewListModelCommon.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class TPbkContactEntry; |
|
29 class CPbkEntryCache; |
|
30 class MPbkContactEntryLoader; |
|
31 |
|
32 /// Use for testing only!!! |
|
33 class CPbkContactViewListModel_TestAccess; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Listbox model for CPbkContactViewListControl. |
|
39 */ |
|
40 NONSHARABLE_CLASS(CPbkContactViewListCacheModel) : |
|
41 public CPbkContactViewListModelCommon |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 /** |
|
45 * Creates a new instance of this class. |
|
46 * @param aParams @see PbkContactViewListModelFactory |
|
47 */ |
|
48 static CPbkContactViewListCacheModel* NewL |
|
49 (PbkContactViewListModelFactory::TParams& aParams); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CPbkContactViewListCacheModel(); |
|
55 |
|
56 public: // interface |
|
57 /** |
|
58 * Returns contact entry for aContactId. |
|
59 * If contact is a group returns NULL. |
|
60 * @param aContactId contact id for entry |
|
61 */ |
|
62 const TPbkContactEntry* GetEntryL(TContactItemId aContactId) const; |
|
63 |
|
64 /** |
|
65 * Purges an entry from this model's cache. |
|
66 * |
|
67 * @param aContactId contact id for entry |
|
68 */ |
|
69 void PurgeEntry(TContactItemId aContactId); |
|
70 |
|
71 /** |
|
72 * Sets contact entry loader. |
|
73 * @aContactEntryLoader loader to be set |
|
74 */ |
|
75 void SetEntryLoader(MPbkContactEntryLoader& aContactEntryLoader); |
|
76 |
|
77 /** |
|
78 * Flushes cache. |
|
79 */ |
|
80 void FlushCache(); |
|
81 |
|
82 private: // from CPbkContactViewListModelBase |
|
83 void FormatBufferForContactL(const CViewContact& aViewContact) const; |
|
84 |
|
85 private: // Implementation |
|
86 CPbkContactViewListCacheModel |
|
87 (PbkContactViewListModelFactory::TParams& aParams); |
|
88 void ConstructL(PbkContactViewListModelFactory::TParams& aParams); |
|
89 /// Use for testing only!!! |
|
90 friend class CPbkContactViewListModel_TestAccess; |
|
91 |
|
92 private: // data |
|
93 /// Own: cache of contact entries |
|
94 CPbkEntryCache* iEntryCache; |
|
95 }; |
|
96 |
|
97 #endif // __CPbkContactViewListCacheModel_H__ |
|
98 |
|
99 // End of File |