24
|
1 |
// Copyright (c) 1999-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 |
// This file define the classes for SMS message queues
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef SMSP_QUEUE_H__
|
|
24 |
#define SMSP_QUEUE_H__
|
|
25 |
|
|
26 |
#include <e32std.h>
|
|
27 |
#include "smspmain.h"
|
|
28 |
#include "Gsmumsg.h"
|
|
29 |
#include "smsuact.h"
|
|
30 |
|
|
31 |
class CSmsMessage;
|
|
32 |
class MSmsMessageObserver;
|
|
33 |
class MSmsComm;
|
|
34 |
class CSmsMessageWrite;
|
|
35 |
class TSmsSettings;
|
|
36 |
class CSmsSegmentationStore;
|
|
37 |
class CSmsMessageSend;
|
|
38 |
class CSmsPDUDelete;
|
|
39 |
class CSmspSetBearer;
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Used by CSmsProtocol to hold CSmsMessage objects queued for sending
|
|
43 |
* or writing to the phone.
|
|
44 |
* @internalComponent
|
|
45 |
*/
|
|
46 |
class CQueuedSmsMessage : public CBase
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
CQueuedSmsMessage(CSmsMessage* aSmsMessage,MSmsMessageObserver& aObserver,TUint aOptions);
|
|
50 |
~CQueuedSmsMessage();
|
|
51 |
public:
|
|
52 |
|
|
53 |
CSmsMessage* iSmsMessage;
|
|
54 |
MSmsMessageObserver& iObserver;
|
|
55 |
TUint iOptions;
|
|
56 |
TSglQueLink iLink;
|
|
57 |
};
|
|
58 |
|
|
59 |
|
|
60 |
/**
|
|
61 |
* @internalComponent
|
|
62 |
*/
|
|
63 |
class CSmspProtocolQueue : public CSmsuActiveBase
|
|
64 |
{
|
|
65 |
public:
|
|
66 |
|
|
67 |
virtual void Start()=0;
|
|
68 |
virtual void CancelObserver(MSmsMessageObserver& aObserver)=0;
|
|
69 |
virtual void CompleteFirst(TInt aStatus)=0;
|
|
70 |
|
|
71 |
protected:
|
|
72 |
|
|
73 |
CSmspProtocolQueue(MSmsComm& aSmsComm, TInt aPriority);
|
|
74 |
|
|
75 |
protected:
|
|
76 |
|
|
77 |
MSmsComm& iSmsComm;
|
|
78 |
};
|
|
79 |
|
|
80 |
|
|
81 |
/**
|
|
82 |
* @internalComponent
|
|
83 |
*/
|
|
84 |
class CSmspMessageQueue : public CSmspProtocolQueue
|
|
85 |
{
|
|
86 |
public:
|
|
87 |
|
|
88 |
void Queue(CSmsMessage* aSmsMessage, MSmsMessageObserver& aObserver, TUint aOptions);
|
|
89 |
void CancelObserver(MSmsMessageObserver& aObserver);
|
|
90 |
|
|
91 |
protected:
|
|
92 |
|
|
93 |
CSmspMessageQueue(MSmsComm& aSmsComm, TInt aPriority);
|
|
94 |
~CSmspMessageQueue();
|
|
95 |
|
|
96 |
void DoRunL();
|
|
97 |
void DoCancel();
|
|
98 |
void DoQueueL(CSmsMessage* aSmsMessage, MSmsMessageObserver& aObserver, TUint aOptions);
|
|
99 |
void CompleteRequest(CQueuedSmsMessage* aQueuedMessage, TInt aStatus);
|
|
100 |
void CompleteFirst(TInt aStatus);
|
|
101 |
|
|
102 |
virtual void CompleteObserver(MSmsMessageObserver& aObserver, TInt aStatus, const CSmsMessage* aSmsMessage = NULL)=0;
|
|
103 |
virtual void CancelRequestIfObserved(MSmsMessageObserver& aObserver)=0;
|
|
104 |
|
|
105 |
protected:
|
|
106 |
|
|
107 |
TSglQue<CQueuedSmsMessage> iMessageQueue; //< Queue of messages
|
|
108 |
};
|
|
109 |
|
|
110 |
|
|
111 |
/**
|
|
112 |
* @internalComponent
|
|
113 |
*/
|
|
114 |
class CSmspWriteQueue : public CSmspMessageQueue
|
|
115 |
{
|
|
116 |
public:
|
|
117 |
|
|
118 |
static CSmspWriteQueue* NewL(MSmsComm& aSmsComm, const TSmsSettings& aSmsSettings, RMobilePhone& aGsmPhone, CSmsSegmentationStore& aSegmentationStore,TInt aPriority);
|
|
119 |
void Start(); //< From CSmspProtocolQueue
|
|
120 |
~CSmspWriteQueue();
|
|
121 |
|
|
122 |
private:
|
|
123 |
|
|
124 |
CSmspWriteQueue(MSmsComm& aSmsComm, TInt aPriority);
|
|
125 |
void ConstructL(const TSmsSettings& aSmsSettings, RMobilePhone& aGsmPhone, CSmsSegmentationStore& aSegmentationStore);
|
|
126 |
void CancelRequestIfObserved(MSmsMessageObserver& aObserver);
|
|
127 |
void CompleteObserver(MSmsMessageObserver& aObserver, TInt aStatus, const CSmsMessage* aSmsMessage = NULL); //< From CSmspMessageQueue
|
|
128 |
void Complete(TInt aStatus); //< From CSmsuActiveBase
|
|
129 |
|
|
130 |
private:
|
|
131 |
|
|
132 |
CSmsMessageWrite* iSmsMessageWrite;
|
|
133 |
};
|
|
134 |
|
|
135 |
|
|
136 |
/**
|
|
137 |
* @internalComponent
|
|
138 |
*/
|
|
139 |
class CSmspSendQueue : public CSmspMessageQueue
|
|
140 |
{
|
|
141 |
public:
|
|
142 |
|
|
143 |
static CSmspSendQueue* NewL(MSmsComm& aSmsComm, CSmsSegmentationStore& aSegmentationStore, const TSmsSettings& aSmsSettings, const RMobileSmsMessaging::TMobileSmsCapsV1& aMobileSmsCaps, RMobileSmsMessaging& aSmsMessaging, TInt aPriority, CSmspSetBearer& aSmspSetBearer);
|
|
144 |
void Start(); //< From CSmspProtocolQueue
|
|
145 |
~CSmspSendQueue();
|
|
146 |
|
|
147 |
private:
|
|
148 |
|
|
149 |
CSmspSendQueue(MSmsComm& aSmsComm, TInt aPriority);
|
|
150 |
void ConstructL(CSmsSegmentationStore& aSegmentationStore, const TSmsSettings& aSmsSettings, const RMobileSmsMessaging::TMobileSmsCapsV1& aMobileSmsCaps, RMobileSmsMessaging& aSmsMessaging, CSmspSetBearer& aSmspSetBearer);
|
|
151 |
void CancelRequestIfObserved(MSmsMessageObserver& aObserver);
|
|
152 |
void CompleteObserver(MSmsMessageObserver& aObserver, TInt aStatus, const CSmsMessage* aSmsMessage = NULL); //< From CSmspMessageQueue
|
|
153 |
void Complete(TInt aStatus); //< From CSmsuActiveBase
|
|
154 |
|
|
155 |
private:
|
|
156 |
|
|
157 |
CSmsMessageSend* iSmsMessageSend;
|
|
158 |
};
|
|
159 |
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Used by CSmsProtocol to hold CSmsMessage objects queued for deletion
|
|
163 |
* from the phone.
|
|
164 |
* @internalComponent
|
|
165 |
*/
|
|
166 |
class CQueuedPDUDelete : public CBase
|
|
167 |
{
|
|
168 |
public:
|
|
169 |
|
|
170 |
static CQueuedPDUDelete* NewL(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray,MSmsMessageObserver* aObserver);
|
|
171 |
~CQueuedPDUDelete();
|
|
172 |
|
|
173 |
private:
|
|
174 |
|
|
175 |
CQueuedPDUDelete(MSmsMessageObserver* aObserver);
|
|
176 |
void ConstructL(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray);
|
|
177 |
|
|
178 |
public:
|
|
179 |
|
|
180 |
CArrayFixFlat<TGsmSmsSlotEntry> iLocationArray;
|
|
181 |
MSmsMessageObserver* iObserver;
|
|
182 |
TSglQueLink iLink;
|
|
183 |
};
|
|
184 |
|
|
185 |
|
|
186 |
/**
|
|
187 |
* @internalComponent
|
|
188 |
*/
|
|
189 |
class CSmspDeleteQueue : public CSmspProtocolQueue
|
|
190 |
{
|
|
191 |
public:
|
|
192 |
|
|
193 |
void Queue(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray, MSmsMessageObserver* aObserver);
|
|
194 |
|
|
195 |
static CSmspDeleteQueue* NewL(MSmsComm& aSmsComm, const TSmsSettings& aSmsSettings, RMobileSmsMessaging& aSmsMessaging, TInt aPriority);
|
|
196 |
void Start(); //< From CSmspProtocolQueue
|
|
197 |
void CancelObserver(MSmsMessageObserver& aObserver); //< From CSmspProtocolQueue
|
|
198 |
~CSmspDeleteQueue();
|
|
199 |
|
|
200 |
protected:
|
|
201 |
void RunL();
|
|
202 |
|
|
203 |
private:
|
|
204 |
|
|
205 |
CSmspDeleteQueue(MSmsComm& aSmsComm, TInt aPriority);
|
|
206 |
void ConstructL(const TSmsSettings& aSmsSettings, RMobileSmsMessaging& aSmsMessaging);
|
|
207 |
void CompleteObserver(MSmsMessageObserver& aObserver, TInt aStatus, const CSmsMessage* aSmsMessage = NULL); //< From CSmspMessageQueue
|
|
208 |
void CompleteFirst(TInt aStatus); //< From CSmspProtocolQueue
|
|
209 |
void DoQueueL(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray, MSmsMessageObserver* aObserver);
|
|
210 |
|
|
211 |
void DoRunL();
|
|
212 |
void DoCancel(); //< From CActive
|
|
213 |
|
|
214 |
void CompleteRequest(CQueuedPDUDelete* aQueuedMessage, TInt aStatus);
|
|
215 |
|
|
216 |
private:
|
|
217 |
|
|
218 |
CSmsPDUDelete* iSmsPDUDelete;
|
|
219 |
TSglQue<CQueuedPDUDelete> iDeleteQueue;
|
|
220 |
};
|
|
221 |
|
|
222 |
#endif //< SMSP_QUEUE_H__
|