|
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: Store API to retrieve attribute lists. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "CPEngAttributeListStore2Imp.h" |
|
20 #include "CPEngNWSessionSlotID2Imp.h" |
|
21 #include "CPEngSessionSlotId.h" |
|
22 #include "CPEngNWSessionSlotStorageProxy.h" |
|
23 |
|
24 #include "MPEngAttributeListManager.h" |
|
25 #include "PEngListLibraryFactory.h" |
|
26 |
|
27 #include <CPEngNWSessionSlotID2.h> |
|
28 |
|
29 |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CPEngAttributeListStore2Imp::NewL() |
|
36 // Two-phased constructor. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CPEngAttributeListStore2Imp* CPEngAttributeListStore2Imp::NewL( |
|
40 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
41 TInt aPriority ) |
|
42 { |
|
43 CPEngAttributeListStore2Imp* self = |
|
44 new ( ELeave ) CPEngAttributeListStore2Imp( aPriority ); |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL( aNWSessionSlotID ); |
|
47 CleanupStack::Pop( self ); |
|
48 return self; |
|
49 } |
|
50 |
|
51 |
|
52 |
|
53 // Destructor |
|
54 CPEngAttributeListStore2Imp::~CPEngAttributeListStore2Imp() |
|
55 { |
|
56 if ( iAttrListManager ) |
|
57 { |
|
58 iAttrListManager->Close(); |
|
59 } |
|
60 |
|
61 delete iUsedSlot; |
|
62 } |
|
63 |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CPEngAttributeListStore2Imp::CPEngAttributeListStore2Imp |
|
67 // C++ default constructor can NOT contain any code, that |
|
68 // might leave. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CPEngAttributeListStore2Imp::CPEngAttributeListStore2Imp( TInt aPriority ) |
|
72 : iCActivePriority( aPriority ) |
|
73 { |
|
74 } |
|
75 |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CPEngAttributeListStore2Imp::ConstructL() |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 void CPEngAttributeListStore2Imp::ConstructL( const CPEngNWSessionSlotID2& aNWSessionSlotID ) |
|
82 { |
|
83 iUsedSlot = CPEngNWSessionSlotStorageProxy::NewL( aNWSessionSlotID ); |
|
84 iAttrListManager = PEngListLibraryFactory::AttributeListsManagerL( |
|
85 iUsedSlot->BaseId() ); |
|
86 } |
|
87 |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CPEngAttributeListStore2Imp::CreateEmptyAttributeListL() |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 MPEngAttributeList2* CPEngAttributeListStore2Imp::CreateEmptyAttributeListL() |
|
94 { |
|
95 return iAttrListManager->CreateEmptyAttributeListL(); |
|
96 } |
|
97 |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CPEngAttributeListStore2Imp::GetDefaultAttributeListL() |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 MPEngAttributeList2* CPEngAttributeListStore2Imp::GetDefaultAttributeListL( |
|
104 TPEngAttributeListsSet2 aAttrListsSet ) |
|
105 { |
|
106 return iAttrListManager->GetDefaultAttributeListL( aAttrListsSet ); |
|
107 } |
|
108 |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // CPEngAttributeListStore2Imp::SetAsDefaultAttributeListL() |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 void CPEngAttributeListStore2Imp::SetAsDefaultAttributeListL( |
|
115 MPEngAttributeList2& aAttributeList ) |
|
116 { |
|
117 iAttrListManager->SetAsDefaultAttributeListL( aAttributeList ); |
|
118 } |
|
119 |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // CPEngAttributeListStore2Imp::DeleteDefaultAttributeListL() |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 void CPEngAttributeListStore2Imp::DeleteDefaultAttributeListL() |
|
126 { |
|
127 iAttrListManager->DeleteDefaultAttributeListL(); |
|
128 } |
|
129 |
|
130 |
|
131 // ----------------------------------------------------------------------------- |
|
132 // CPEngAttributeListStore2Imp::GetAttributeListForContactListL() |
|
133 // ----------------------------------------------------------------------------- |
|
134 // |
|
135 MPEngAttributeList2* CPEngAttributeListStore2Imp::GetAttributeListForContactListL( |
|
136 const TDesC& aContactListName, |
|
137 TPEngAttributeListsSet2 aAttrListsSet ) |
|
138 { |
|
139 return iAttrListManager->GetAttributeListForContactListL( aContactListName, |
|
140 aAttrListsSet ); |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CPEngAttributeListStore2Imp::AttachAttributeListToContactListL() |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CPEngAttributeListStore2Imp::AttachAttributeListToContactListL( |
|
149 const TDesC& aContactListName, |
|
150 MPEngAttributeList2& aAttributeList ) |
|
151 { |
|
152 iAttrListManager->AttachAttributeListToContactListL( aContactListName, |
|
153 aAttributeList ); |
|
154 } |
|
155 |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CPEngAttributeListStore2Imp::DeleteAttributeListFromContactListL() |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 void CPEngAttributeListStore2Imp::DeleteAttributeListFromContactListL( |
|
162 const TDesC& aContactListName ) |
|
163 { |
|
164 iAttrListManager->DeleteAttributeListFromContactListL( aContactListName ); |
|
165 } |
|
166 |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CPEngAttributeListStore2Imp::GetAttributeListForUserL() |
|
170 // ----------------------------------------------------------------------------- |
|
171 // |
|
172 MPEngAttributeList2* CPEngAttributeListStore2Imp::GetAttributeListForUserL( |
|
173 const TDesC& aPresenceID, |
|
174 TPEngAttributeListsSet2 aAttrListsSet ) |
|
175 { |
|
176 return iAttrListManager->GetAttributeListForUserL( aPresenceID, |
|
177 aAttrListsSet ); |
|
178 } |
|
179 |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CPEngAttributeListStore2Imp::AttachAttributeListToUserL() |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 void CPEngAttributeListStore2Imp::AttachAttributeListToUserL( |
|
186 const TDesC& aPresenceID, |
|
187 MPEngAttributeList2& aList ) |
|
188 { |
|
189 iAttrListManager->AttachAttributeListToUserL( aPresenceID, |
|
190 aList ); |
|
191 } |
|
192 |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // CPEngAttributeListStore2Imp::DeleteAttributeListFromUserL() |
|
196 // ----------------------------------------------------------------------------- |
|
197 // |
|
198 void CPEngAttributeListStore2Imp::DeleteAttributeListFromUserL( |
|
199 const TDesC& aPresenceID ) |
|
200 { |
|
201 iAttrListManager->DeleteAttributeListFromUserL( aPresenceID ); |
|
202 } |
|
203 |
|
204 |
|
205 // End of File |
|
206 |
|
207 |
|
208 |