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