24
|
1 |
// Copyright (c) 2008-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 |
#ifndef __CPHONEBOOKDISPATCHER_H_
|
|
17 |
#define __CPHONEBOOKDISPATCHER_H_
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <e32std.h>
|
|
21 |
#include <e32base.h>
|
|
22 |
#include <e32def.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
|
|
25 |
#include <ctsy/ltsy/mltsydispatchfactory.h>
|
|
26 |
|
|
27 |
#include "requestqueueoneshot.h"
|
|
28 |
#include <ctsy/ltsy/ltsylogger.h>
|
|
29 |
#include "mdispatchercallback.h"
|
|
30 |
|
|
31 |
#include <ctsy/ltsy/mltsydispatchphonebookinterface.h>
|
|
32 |
|
|
33 |
// FORWARD DECLARATIONS
|
|
34 |
class CMmDataPackage;
|
|
35 |
class MmMessageManagerCallback;
|
|
36 |
class TDispatcherHolder;
|
|
37 |
class CPhoneBookEntry;
|
|
38 |
class CPhoneBookBuffer;
|
|
39 |
class CPhoneBookStoreEntry;
|
|
40 |
class CStorageInfoData;
|
|
41 |
class TPhonebookInfoV1;
|
|
42 |
class DispatcherPhonebook::TPhonebookStoreInfoV1;
|
|
43 |
|
|
44 |
class MLtsyDispatchPhonebookStoreReadEntry;
|
|
45 |
class MLtsyDispatchPhonebookStoreDeleteEntry;
|
|
46 |
class MLtsyDispatchPhonebookStoreCache;
|
|
47 |
class MLtsyDispatchPhonebookStoreGetPhonebookInfo;
|
|
48 |
class MLtsyDispatchPhonebookStoreInitialise;
|
|
49 |
class MLtsyDispatchPhonebookStoreDeleteAll;
|
|
50 |
class MLtsyDispatchPhonebookSmsStoreReadAll;
|
|
51 |
class MLtsyDispatchPhonebookStoreWriteEntry;
|
|
52 |
class MLtsyDispatchPhonebookGetPhoneStoreInfo;
|
|
53 |
class MLtsyDispatchPhonebookSmsStoreDeleteEntry;
|
|
54 |
class MLtsyDispatchPhonebookSmsStoreDeleteAll;
|
|
55 |
class MLtsyDispatchPhonebookSmsStoreGetInfo;
|
|
56 |
class MLtsyDispatchPhonebookSmsStoreReadEntry;
|
|
57 |
class MLtsyDispatchPhonebookSmsStoreWriteEntry;
|
|
58 |
class MLtsyDispatchPhonebookStoreCacheCancel;
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
// CLASS DECLARATION
|
|
63 |
|
|
64 |
/**
|
|
65 |
* This class is responsible for packing and unpacking data belonging
|
|
66 |
* to Phonebook related requests to the Licensee LTSY.
|
|
67 |
*/
|
|
68 |
class CPhonebookDispatcher : public CBase, public MDispatcherCallback
|
|
69 |
{
|
|
70 |
public:
|
|
71 |
|
|
72 |
virtual ~CPhonebookDispatcher();
|
|
73 |
|
|
74 |
static CPhonebookDispatcher* NewL(
|
|
75 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
76 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
77 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
78 |
|
|
79 |
static CPhonebookDispatcher* NewLC(
|
|
80 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
81 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
82 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
83 |
|
|
84 |
// Dispatcher functions for dispatching requests DOWN to the Licensee LTSY
|
|
85 |
|
|
86 |
TInt DispatchStoreReadEntryL(const CMmDataPackage* aDataPackage);
|
|
87 |
TInt DispatchStoreDeleteEntryL(const CMmDataPackage* aDataPackage);
|
|
88 |
TInt DispatchStoreCacheL(const CMmDataPackage* aDataPackage);
|
|
89 |
TInt DispatchStoreGetInfoL(const CMmDataPackage* aDataPackage);
|
|
90 |
TInt DispatchStoreInitialiseL(const CMmDataPackage* aDataPackage);
|
|
91 |
TInt DispatchStoreDeleteAllL(const CMmDataPackage* aDataPackage);
|
|
92 |
TInt DispatchSmsStoreReadAllL();
|
|
93 |
TInt DispatchStoreWriteEntryL(const CMmDataPackage* aDataPackage);
|
|
94 |
TInt DispatchGetPhoneStoreInfoL(const CMmDataPackage* aDataPackage);
|
|
95 |
TInt DispatchSmsStoreDeleteEntryL(const CMmDataPackage* aDataPackage);
|
|
96 |
TInt DispatchSmsStoreDeleteAllL();
|
|
97 |
TInt DispatchSmsStoreGetInfoL();
|
|
98 |
TInt DispatchSmsStoreReadEntryL(const CMmDataPackage* aDataPackage);
|
|
99 |
TInt DispatchSmsStoreWriteEntryL(const CMmDataPackage* aDataPackage);
|
|
100 |
TInt DispatchStoreCacheCancelL(const CMmDataPackage* aDataPackage);
|
|
101 |
|
|
102 |
|
|
103 |
// Complete functions for receiving completions UP from the Licensee LTSY
|
|
104 |
// via the CCtsyDispatcherCallback object.
|
|
105 |
|
|
106 |
void CallbackStoreResetCache(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook);
|
|
107 |
void CallbackStoreSetFdnPhonebookInfoInd(TInt aError, TInt aTotalEntries , TInt aMaxTextLength , TInt aMaxNumberLength);
|
|
108 |
void CallbackStoreReadEntry(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, const TDesC8& aPhonebookEntries);
|
|
109 |
void CallbackStoreDeleteEntry(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, TInt aMaxNumberLength);
|
|
110 |
void CallbackStoreCache(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, const TDesC8& aPhonebookEntries);
|
|
111 |
void CallbackStoreGetPhonebookInfo(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, TInt aUsedEntries);
|
|
112 |
void CallbackStoreInitialise(TInt aError, const DispatcherPhonebook::TPhonebookStoreInfoV1& aPhonebookStoreInfo);
|
|
113 |
void CallbackStoreDeleteAll(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, TInt aMaxNumberLength);
|
|
114 |
void CallbackStoreWriteEntry(TInt aError, DispatcherPhonebook::TPhonebook aPhonebook, TUint16 aIndex, TInt aMaxNumberLength);
|
|
115 |
void CallbackGetPhoneStoreInfo(TInt aError, const RMobilePhoneStore::TMobilePhoneStoreInfoV1& aPhoneStoreInfo);
|
|
116 |
void CallbackSmsStoreReadAll(TInt aError, const DispatcherPhonebook::TSmsData& aSmsData, TInt aIndex, TBool aMoreToCome, TBool aReceivedClass2ToBeResent);
|
|
117 |
void CallbackSmsStoreDeleteEntry(TInt aError);
|
|
118 |
void CallbackSmsStoreDeleteAll(TInt aError);
|
|
119 |
void CallbackSmsStoreGetInfo(TInt aError, TInt aTotalEntries, TInt aUsedEntries);
|
|
120 |
void CallbackSmsStoreReadEntry(TInt aError, const DispatcherPhonebook::TSmsData& aSmsData);
|
|
121 |
void CallbackSmsStoreWriteEntry(TInt aError, TInt aLocation, TBool aReceivedClass2ToBeResent);
|
|
122 |
|
|
123 |
|
|
124 |
// From MDispatcherCallback
|
|
125 |
void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage);
|
|
126 |
|
|
127 |
// Other public functions
|
|
128 |
void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder);
|
|
129 |
|
|
130 |
private:
|
|
131 |
|
|
132 |
static const TInt KPhonebookTypes = DispatcherPhonebook::EUnknown;
|
|
133 |
|
|
134 |
static const TInt KMaxTotalEntries = 255;
|
|
135 |
|
|
136 |
private:
|
|
137 |
|
|
138 |
CPhonebookDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
139 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
140 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
141 |
|
|
142 |
void ConstructL();
|
|
143 |
|
|
144 |
//helper functions
|
|
145 |
CPhoneBookStoreEntry* CreatePhoneBookStoreEntryLC(const CPhoneBookEntry& aPhoneBookEntry) const;
|
|
146 |
TInt FillPhoneBookEntry(const CPhoneBookStoreEntry& aPhoneBookStoreEntry, CPhoneBookEntry& aPhoneBookEntry) const;
|
|
147 |
void FillCtsyPhoneBookStoreL(const TDesC8& aPhonebookEntries, CArrayPtrSeg<CPhoneBookStoreEntry>& aCtsyPhoneBook);
|
|
148 |
const TDesC& PhonebookName(DispatcherPhonebook::TPhonebook aPhonebookType) const;
|
|
149 |
DispatcherPhonebook::TPhonebook Phonebook(const TDesC& aPhonebookName) const;
|
|
150 |
void PhonebookStoreToStorageInfo(const DispatcherPhonebook::TPhonebookStoreInfoV1& aPhonebookStoreInfo, CStorageInfoData& aStorageInfoData) const;
|
|
151 |
|
|
152 |
void FillSmsStoreListL(const DispatcherPhonebook::TSmsData& aSmsData, TInt aIndex, CArrayPtrFlat< TSmsMsg >& aSmsListArray);
|
|
153 |
|
|
154 |
private: // Not owned
|
|
155 |
|
|
156 |
|
|
157 |
MLtsyDispatchFactoryV1& iLtsyFactoryV1;
|
|
158 |
MmMessageManagerCallback& iMessageManagerCallback;
|
|
159 |
CRequestQueueOneShot& iRequestAsyncOneShot;
|
|
160 |
TDispatcherHolder* iDispatcherHolder;
|
|
161 |
|
|
162 |
// Interfaces in the Licensee LTSY, not owned by this object
|
|
163 |
|
|
164 |
MLtsyDispatchPhonebookStoreReadEntry* iLtsyDispatchPhonebookStoreReadEntry;
|
|
165 |
MLtsyDispatchPhonebookStoreDeleteEntry* iLtsyDispatchPhonebookStoreDeleteEntry;
|
|
166 |
MLtsyDispatchPhonebookStoreCache* iLtsyDispatchPhonebookStoreCache;
|
|
167 |
MLtsyDispatchPhonebookStoreGetPhonebookInfo* iLtsyDispatchPhonebookStoreGetPhonebookInfo;
|
|
168 |
MLtsyDispatchPhonebookStoreInitialise* iLtsyDispatchPhonebookStoreInitialise;
|
|
169 |
MLtsyDispatchPhonebookStoreDeleteAll* iLtsyDispatchPhonebookStoreDeleteAll;
|
|
170 |
MLtsyDispatchPhonebookSmsStoreReadAll* iLtsyDispatchPhonebookSmsStoreReadAll;
|
|
171 |
MLtsyDispatchPhonebookStoreWriteEntry* iLtsyDispatchPhonebookStoreWriteEntry;
|
|
172 |
MLtsyDispatchPhonebookGetPhoneStoreInfo* iLtsyDispatchPhonebookGetPhoneStoreInfo;
|
|
173 |
MLtsyDispatchPhonebookSmsStoreDeleteEntry* iLtsyDispatchPhonebookSmsStoreDeleteEntry;
|
|
174 |
MLtsyDispatchPhonebookSmsStoreDeleteAll* iLtsyDispatchPhonebookSmsStoreDeleteAll;
|
|
175 |
MLtsyDispatchPhonebookSmsStoreGetInfo* iLtsyDispatchPhonebookSmsStoreGetInfo;
|
|
176 |
MLtsyDispatchPhonebookSmsStoreReadEntry* iLtsyDispatchPhonebookSmsStoreReadEntry;
|
|
177 |
MLtsyDispatchPhonebookSmsStoreWriteEntry* iLtsyDispatchPhonebookSmsStoreWriteEntry;
|
|
178 |
MLtsyDispatchPhonebookStoreCacheCancel* iLtsyDispatchPhonebookStoreCacheCancel;
|
|
179 |
|
|
180 |
|
|
181 |
//stored pointers sent from the CTSY between Req Comp calls
|
|
182 |
RPointerArray<CArrayPtrSeg<CPhoneBookStoreEntry> > iPhonebookCachePtrs;
|
|
183 |
RPointerArray<CArrayPtrSeg<CPhoneBookStoreEntry> > iPhonebookReadPtrs;
|
|
184 |
CArrayPtrFlat< TSmsMsg >* iSmsListArray;
|
|
185 |
DispatcherPhonebook::TPhonebook iInitialisePhonebook;
|
|
186 |
}; // class CPhonebookDispatcher
|
|
187 |
|
|
188 |
#endif // __CPHONEBOOKDISPATCHER_H_
|
|
189 |
|