24
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "cmmonstoregsmext.h"
|
|
20 |
#include "cmmonstoretsy.h"
|
|
21 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
22 |
|
|
23 |
// ======== MEMBER FUNCTIONS ========
|
|
24 |
|
|
25 |
CMmONStoreGsmExt::CMmONStoreGsmExt()
|
|
26 |
{
|
|
27 |
}
|
|
28 |
|
|
29 |
CMmONStoreGsmExt::~CMmONStoreGsmExt()
|
|
30 |
{
|
|
31 |
}
|
|
32 |
|
|
33 |
CMmONStoreGsmExt* CMmONStoreGsmExt::NewL(
|
|
34 |
CMmONStoreTsy* aMmONStoreTsy )
|
|
35 |
{
|
|
36 |
|
|
37 |
CMmONStoreGsmExt* aONStoreGsmExt = new ( ELeave ) CMmONStoreGsmExt();
|
|
38 |
|
|
39 |
CleanupStack::PushL(aONStoreGsmExt);
|
|
40 |
aONStoreGsmExt->iMmONStoreTsy = aMmONStoreTsy;
|
|
41 |
aONStoreGsmExt->ConstructL();
|
|
42 |
CleanupStack::Pop();
|
|
43 |
|
|
44 |
return aONStoreGsmExt;
|
|
45 |
}
|
|
46 |
|
|
47 |
void CMmONStoreGsmExt::ConstructL()
|
|
48 |
{
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// CMmONStoreGsmExt::ReadL
|
|
53 |
// Reads an entry from the ONStore
|
|
54 |
// (other items were commented in a header).
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
TInt CMmONStoreGsmExt::ReadL(
|
|
58 |
TInt aIpc,
|
|
59 |
TInt aIndex )
|
|
60 |
{
|
|
61 |
//Create package
|
|
62 |
CMmDataPackage package;
|
|
63 |
|
|
64 |
//Set call id and call mode
|
|
65 |
package.PackData( &aIndex );
|
|
66 |
|
|
67 |
//Send request to the Domestic OS layer.
|
|
68 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
69 |
&package );
|
|
70 |
}
|
|
71 |
|
|
72 |
// ---------------------------------------------------------------------------
|
|
73 |
// CMmONStoreGsmExt::WriteL
|
|
74 |
// Writes an entry to the ON store
|
|
75 |
// This function also used to delete one entry by index
|
|
76 |
// (other items were commented in a header).
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
//
|
|
79 |
TInt CMmONStoreGsmExt::WriteL(
|
|
80 |
TInt aIpc,
|
|
81 |
TDesC8* aEntry )
|
|
82 |
{
|
|
83 |
//Create package
|
|
84 |
CMmDataPackage package;
|
|
85 |
|
|
86 |
//Set call id and call mode
|
|
87 |
package.PackData( &aEntry );
|
|
88 |
|
|
89 |
//Send request to the Domestic OS layer.
|
|
90 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
91 |
&package );
|
|
92 |
}
|
|
93 |
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
// CMmONStoreGsmExt::WriteAllL
|
|
96 |
// Writes an entry to the ON store.
|
|
97 |
// (other items were commented in a header).
|
|
98 |
// ---------------------------------------------------------------------------
|
|
99 |
//
|
|
100 |
TInt CMmONStoreGsmExt::WriteAllL(
|
|
101 |
TInt aIpc,
|
|
102 |
const CMmDataPackage* aEntry )
|
|
103 |
{
|
|
104 |
//Send request to the Domestic OS layer.
|
|
105 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
106 |
aEntry );
|
|
107 |
}
|
|
108 |
|
|
109 |
// ---------------------------------------------------------------------------
|
|
110 |
// CMmONStoreGsmExt::GetInfoL
|
|
111 |
// Returns information about ON store
|
|
112 |
// This method is used by many requests, because supplied servicetype
|
|
113 |
// can be used to get e.g. num of entries, length of number/name.
|
|
114 |
// (other items were commented in a header).
|
|
115 |
// ---------------------------------------------------------------------------
|
|
116 |
//
|
|
117 |
TInt CMmONStoreGsmExt::GetInfoL(
|
|
118 |
TInt aIpc,
|
|
119 |
TUint8 aServiceType )
|
|
120 |
{
|
|
121 |
//Create package
|
|
122 |
CMmDataPackage package;
|
|
123 |
|
|
124 |
//Set call id and call mode
|
|
125 |
package.PackData( &aServiceType );
|
|
126 |
|
|
127 |
//Send request to the Domestic OS layer.
|
|
128 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
129 |
&package );
|
|
130 |
}
|
|
131 |
|
|
132 |
// ---------------------------------------------------------------------------
|
|
133 |
// CMmONStoreGsmExt::DeleteAllL
|
|
134 |
// Deletes all phonebook's entries.
|
|
135 |
// (other items were commented in a header).
|
|
136 |
// ---------------------------------------------------------------------------
|
|
137 |
//
|
|
138 |
TInt CMmONStoreGsmExt::DeleteAllL(
|
|
139 |
TInt aIpc )
|
|
140 |
{
|
|
141 |
//Create package
|
|
142 |
CMmDataPackage package; // dummy package
|
|
143 |
|
|
144 |
//Send request to the Domestic OS layer.
|
|
145 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
146 |
&package );
|
|
147 |
}
|
|
148 |
|
|
149 |
// ---------------------------------------------------------------------------
|
|
150 |
// CMmONStoreGsmExt::DeleteL
|
|
151 |
// Deletes an entry from the phonebook
|
|
152 |
// (other items were commented in a header).
|
|
153 |
// ---------------------------------------------------------------------------
|
|
154 |
//
|
|
155 |
TInt CMmONStoreGsmExt::DeleteL(
|
|
156 |
TInt aIpc,
|
|
157 |
TInt aIndex )
|
|
158 |
{
|
|
159 |
//Create package
|
|
160 |
CMmDataPackage package;
|
|
161 |
|
|
162 |
//Set call id and call mode
|
|
163 |
package.PackData( &aIndex );
|
|
164 |
|
|
165 |
//Send request to the Domestic OS layer.
|
|
166 |
return iMmONStoreTsy->Phone()->MessageManager()->HandleRequestL( aIpc,
|
|
167 |
&package );
|
|
168 |
}
|
|
169 |
|
|
170 |
// ---------------------------------------------------------------------------
|
|
171 |
// CMmONStoreGsmExt::ReceivedNumOfEntries
|
|
172 |
// Inits the number of entries
|
|
173 |
// (other items were commented in a header).
|
|
174 |
// ---------------------------------------------------------------------------
|
|
175 |
//
|
|
176 |
void CMmONStoreGsmExt::ReceivedNumOfEntries(
|
|
177 |
TInt aNumOfEntries )
|
|
178 |
{
|
|
179 |
// Set the number of entries for DeleteAll
|
|
180 |
iNumberOfEntries = aNumOfEntries;
|
|
181 |
}
|
|
182 |
|
|
183 |
// ---------------------------------------------------------------------------
|
|
184 |
// CMmONStoreGsmExt::GetDeleteAllNumOfEntries
|
|
185 |
// Gets the number of entries
|
|
186 |
// (other items were commented in a header).
|
|
187 |
// ---------------------------------------------------------------------------
|
|
188 |
//
|
|
189 |
TInt CMmONStoreGsmExt::GetDeleteAllNumOfEntries()
|
|
190 |
{
|
|
191 |
// Return the num of entries for DeleteAll
|
|
192 |
return iNumberOfEntries;
|
|
193 |
}
|
|
194 |
|
|
195 |
// ---------------------------------------------------------------------------
|
|
196 |
// CMmONStoreGsmExt::GetAndUpdateDeleteAllIndex
|
|
197 |
// This method returns and increases the index to be deleted
|
|
198 |
// for DeleteAll -request.
|
|
199 |
// (other items were commented in a header).
|
|
200 |
// ---------------------------------------------------------------------------
|
|
201 |
//
|
|
202 |
TInt CMmONStoreGsmExt::GetAndUpdateDeleteAllIndex()
|
|
203 |
{
|
|
204 |
// Return and increase by one
|
|
205 |
return iDeleteAllIndex++;
|
|
206 |
}
|
|
207 |
|
|
208 |
// ---------------------------------------------------------------------------
|
|
209 |
// CMmONStoreGsmExt::IncreaseAndGetNumOfUsedEntries
|
|
210 |
// Increases and return used entry variable
|
|
211 |
// (other items were commented in a header).
|
|
212 |
// ---------------------------------------------------------------------------
|
|
213 |
//
|
|
214 |
TInt CMmONStoreGsmExt::IncreaseAndGetNumOfUsedEntries()
|
|
215 |
{
|
|
216 |
return ++iNumOfUsedEntries;
|
|
217 |
}
|
|
218 |
|
|
219 |
// ---------------------------------------------------------------------------
|
|
220 |
// CMmONStoreGsmExt::NumOfUsedEntries
|
|
221 |
// Return used entry member variable
|
|
222 |
// (other items were commented in a header).
|
|
223 |
// ---------------------------------------------------------------------------
|
|
224 |
//
|
|
225 |
TInt CMmONStoreGsmExt::NumOfUsedEntries()
|
|
226 |
{
|
|
227 |
return iNumOfUsedEntries;
|
|
228 |
}
|
|
229 |
|
|
230 |
// End of file
|