24
|
1 |
// Copyright (c) 1997-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 |
@file
|
|
18 |
@internalAll
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __SMSPPROC_H__
|
|
23 |
#define __SMSPPROC_H__
|
|
24 |
|
|
25 |
#include <etelmm.h>
|
|
26 |
#include <smsuaddr.h>
|
|
27 |
#include <smsuact.h>
|
|
28 |
#include <logwrap.h>
|
|
29 |
#include <logsmspdudata.h>
|
|
30 |
#include "smspstor.h"
|
|
31 |
#include "gsmuSmsSlot.h"
|
|
32 |
|
|
33 |
|
|
34 |
class CFacadeSmsReassemblyStore;
|
|
35 |
class CSmsSegmentationStore;
|
|
36 |
class TSmsSettings;
|
|
37 |
class CSmsEventLogger;
|
|
38 |
|
|
39 |
class CSmspReceiveMode;
|
|
40 |
class MSmsComm;
|
|
41 |
class CSmsMonitorDiskSpace;
|
|
42 |
class CSmsPDURead;
|
|
43 |
|
|
44 |
/**
|
|
45 |
@internalComponent
|
|
46 |
*/
|
|
47 |
|
|
48 |
const TInt KDefaultMaxmumNumberOfCompleteMessagesInReassemblyStore = 10; //<Maximum number of comlete messages in reassembly store
|
|
49 |
|
|
50 |
|
|
51 |
/**
|
|
52 |
* @internalComponent
|
|
53 |
*/
|
|
54 |
NONSHARABLE_CLASS(CSmsPDUProcessor) : public CBase
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
enum
|
|
58 |
{
|
|
59 |
ESmsMaxDeliverReportBufferSize = 160
|
|
60 |
};
|
|
61 |
|
|
62 |
//
|
|
63 |
// Public static constructor and destructor...
|
|
64 |
//
|
|
65 |
static CSmsPDUProcessor* NewL(MSmsComm& aSmsComm, const TSmsSettings& aSmsSettings,
|
|
66 |
CFacadeSmsReassemblyStore& aReassemblyStore,
|
|
67 |
CSmsSegmentationStore& aSegmentationStore,
|
|
68 |
CSmsMonitorDiskSpace& aSmsMonitorDiskSpace);
|
|
69 |
~CSmsPDUProcessor();
|
|
70 |
|
|
71 |
//
|
|
72 |
// Functions to return basic information about the PDU...
|
|
73 |
//
|
|
74 |
inline TBool IsComplete() const;
|
|
75 |
inline TBool IsMobileTerminated() const;
|
|
76 |
inline TBool IsEnumeration() const;
|
|
77 |
inline TBool IsClass0Message() const;
|
|
78 |
inline TBool IsClass1Message() const;
|
|
79 |
inline TBool IsClass2Message() const;
|
|
80 |
inline TBool IsClass3Message() const;
|
|
81 |
inline TBool IsPIDType0() const;
|
|
82 |
inline TBool IsForwardMessageToClient() const;
|
|
83 |
inline TBool IsMarkedForAutoDelete() const;
|
|
84 |
inline TBool IsPDUToBeDeleted() const;
|
|
85 |
inline TBool IsMessageGoingToBeStored() const;
|
|
86 |
|
|
87 |
//
|
|
88 |
// Configurable options for processing...
|
|
89 |
//
|
|
90 |
inline void SetApplyAutoDeletionToClass2(TBool aSetting);
|
|
91 |
inline TBool IsApplyAutoDeletionToClass2() const;
|
|
92 |
inline void SetDiscardType0Class0(TBool aSetting);
|
|
93 |
inline TBool IsDiscardType0Class0() const;
|
|
94 |
inline void SetDiscardType0Class2(TBool aSetting);
|
|
95 |
inline TBool IsDiscardType0Class2() const;
|
|
96 |
|
|
97 |
//
|
|
98 |
// General process functions...
|
|
99 |
//
|
|
100 |
void DecodeAndProcessPDUL(TGsmSmsSlot& aSlot, TBool aIsEnumeration);
|
|
101 |
void UpdateLogServerIdL();
|
|
102 |
void ProcessMessageIfCompleteL();
|
|
103 |
void DeletePDUL();
|
|
104 |
|
|
105 |
//
|
|
106 |
// Access functions for private members...
|
|
107 |
//
|
|
108 |
inline TPtrC DeliverReportBuffer() const;
|
|
109 |
inline CSmsMessage* SmsMessage() const;
|
|
110 |
inline CSmsMessage* OriginalSmsMessage() const;
|
|
111 |
inline const TLogSmsPduData* SmsPDUData() const;
|
|
112 |
inline TInt Index() const;
|
|
113 |
|
|
114 |
private:
|
|
115 |
//
|
|
116 |
// Private constructor and second phase constructor...
|
|
117 |
//
|
|
118 |
CSmsPDUProcessor(MSmsComm& aSmsComm, const TSmsSettings& aSmsSettings,
|
|
119 |
CFacadeSmsReassemblyStore& aReassemblyStore,
|
|
120 |
CSmsSegmentationStore& aSegmentationStore,
|
|
121 |
CSmsMonitorDiskSpace& aSmsMonitorDiskSpace);
|
|
122 |
|
|
123 |
void ConstructL();
|
|
124 |
|
|
125 |
//
|
|
126 |
// Private processing functions...
|
|
127 |
//
|
|
128 |
void AnalysePDUCharacteristics();
|
|
129 |
void FindOriginalMessageAndProcessStatusReportL();
|
|
130 |
void UpdateStatusReportL();
|
|
131 |
void AddSlotToSmsMessageIfRequiredL();
|
|
132 |
void AddSegmentOfMessageToReassemblyStoreIfRequiredL();
|
|
133 |
|
|
134 |
private:
|
|
135 |
MSmsComm& iSmsComm;
|
|
136 |
const TSmsSettings& iSmsSettings;
|
|
137 |
CFacadeSmsReassemblyStore& iReassemblyStore;
|
|
138 |
CSmsSegmentationStore& iSegmentationStore;
|
|
139 |
TGsmSms iGsmSms;
|
|
140 |
CSmsMessage* iSmsMessage;
|
|
141 |
CSmsMessage* iOriginalSmsMessage;
|
|
142 |
TLogSmsPduData iSmsPDUData;
|
|
143 |
TInt iIndex;
|
|
144 |
|
|
145 |
TGsmSmsSlot iSlot;
|
|
146 |
TSmsAddr iSmsAddr;
|
|
147 |
CSmsSegmentationStore::RSmsSegmentationStoreRefStatusArray iStatusArray;
|
|
148 |
TBuf16<ESmsMaxDeliverReportBufferSize> iDeliverReportBuffer;
|
|
149 |
CSmsMonitorDiskSpace& iSmsMonitorDiskSpace;
|
|
150 |
|
|
151 |
TBool iIsEnumeration;
|
|
152 |
TBool iIsComplete;
|
|
153 |
TBool iIsMobileTerminated;
|
|
154 |
TBool iIsClass0Message;
|
|
155 |
TBool iIsClass1Message;
|
|
156 |
TBool iIsClass2Message;
|
|
157 |
TBool iIsClass3Message;
|
|
158 |
TBool iIsPIDType0;
|
|
159 |
TBool iIsForwardMessageToClient;
|
|
160 |
TBool iIsMarkedForAutoDelete;
|
|
161 |
TBool iIsPDUToBeDeleted;
|
|
162 |
TBool iIsMessageGoingToBeStored;
|
|
163 |
TBool iOptionApplyAutoDeletionToClass2;
|
|
164 |
TBool iOptionDiscardType0Class2;
|
|
165 |
TBool iOptionDiscardType0Class0;
|
|
166 |
TBool iIsWapSms;
|
|
167 |
};
|
|
168 |
|
|
169 |
#include "smspproc.inl"
|
|
170 |
|
|
171 |
#endif // !defined __SMSPPROC_H__
|