|
1 /* |
|
2 * Copyright (c) 2004 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: Presence Store Entry adapter for presence attributes. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGMODELSTOREENTRYADAPTER_H |
|
19 #define CPENGMODELSTOREENTRYADAPTER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "CPEngStoreEntry.h" |
|
23 |
|
24 |
|
25 //FORWARD DECLARATIONS |
|
26 class CPEngPresenceAttrModel; |
|
27 class MPEngStorageManager; |
|
28 |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * Presence Store Entry adapter for presence attributes. |
|
34 * |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CPEngModelStoreEntryAdapter ) : public CPEngStoreEntry |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CPEngModelStoreEntryAdapter* NewL( |
|
45 HBufC* aStoreId, |
|
46 MPEngStorageManager& aStorageManager, |
|
47 TPEngStorageType aStorageType, |
|
48 CPEngPresenceAttrModel& aAttributeModel ); |
|
49 |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CPEngModelStoreEntryAdapter(); |
|
55 |
|
56 |
|
57 private: // Constructors. |
|
58 |
|
59 /** |
|
60 * C++ default constructor. |
|
61 */ |
|
62 CPEngModelStoreEntryAdapter( TPEngStorageType aStorageType, |
|
63 HBufC* aStoreId, |
|
64 CPEngPresenceAttrModel& aAttributeModel ); |
|
65 |
|
66 public: // New access functions |
|
67 |
|
68 /** |
|
69 * Access to Storage Manager used by the |
|
70 * CPEngModelStoreEntryAdapter. |
|
71 * |
|
72 * Both const and non const overload. |
|
73 * @return Reference to MPEngStorageManager. |
|
74 */ |
|
75 MPEngStorageManager& StorageManager(); |
|
76 const MPEngStorageManager& StorageManager() const; |
|
77 |
|
78 |
|
79 |
|
80 private: // Functions from the CPEngStoreEntry |
|
81 |
|
82 /** |
|
83 * From CPEngStoreEntry. |
|
84 * |
|
85 * Externalizes the referenced |
|
86 * CPEngPresenceAttrModel data to Presence Storage. |
|
87 * |
|
88 * @since 3.0 |
|
89 * @param aStream stream to write to |
|
90 * @param aStorageType storage type to externalized |
|
91 */ |
|
92 void ExternalizeL( RWriteStream& aStream, |
|
93 TPEngStorageType aStorageType ) const; |
|
94 |
|
95 /** |
|
96 * From CPEngStoreEntry. |
|
97 * |
|
98 * Externalizes the referenced |
|
99 * CPEngPresenceAttrModel data to Presence Storage. |
|
100 * |
|
101 * @since 3.0 |
|
102 * @param aStream stream to read from |
|
103 * @param aStorageType storage type to internalized |
|
104 */ |
|
105 void InternalizeL( RReadStream& aStream, |
|
106 TPEngStorageType aStorageType ); |
|
107 |
|
108 /** |
|
109 * From CPEngStoreEntry. |
|
110 * |
|
111 * @since 3.0 |
|
112 * @return ID. |
|
113 */ |
|
114 const TDesC& StorageId() const; |
|
115 |
|
116 |
|
117 /** |
|
118 * From CPEngStoreEntry. |
|
119 * |
|
120 * Returns required storage size for |
|
121 * storing this entry to Presence Storage. |
|
122 * |
|
123 * @since 3.0 |
|
124 * @return Size. |
|
125 */ |
|
126 TUint32 EntrySize() const; |
|
127 |
|
128 |
|
129 |
|
130 private: // Data |
|
131 |
|
132 //OWN: Store id for storing this entry. |
|
133 HBufC* iStoreId; |
|
134 |
|
135 //REF: Attribute model to store |
|
136 CPEngPresenceAttrModel& iAttributeModel; |
|
137 }; |
|
138 |
|
139 |
|
140 #endif // CPENGMODELSTOREENTRYADAPTER_H |
|
141 |
|
142 // End of File |