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 |
// Declares the two main notification interfaces for the protocol.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#if !defined(SMSPCOMM_H__)
|
|
24 |
#define SMSPCOMM_H__
|
|
25 |
|
|
26 |
#include <e32std.h>
|
|
27 |
#include "smspmain.h"
|
|
28 |
#include "smsuact.h"
|
|
29 |
#include "smsuaddr.H"
|
|
30 |
#include "Gsmumsg.h"
|
|
31 |
|
|
32 |
|
|
33 |
#include <etel.h>
|
|
34 |
|
|
35 |
//
|
|
36 |
// Forward declarations
|
|
37 |
//
|
|
38 |
|
|
39 |
class TSmsAddr;
|
|
40 |
class CSmsMessage;
|
|
41 |
|
|
42 |
//
|
|
43 |
// Class declarations
|
|
44 |
//
|
|
45 |
|
|
46 |
|
|
47 |
/**
|
|
48 |
* The notification interface used by the protocol to notify Service Access
|
|
49 |
* Points (SAPs, eg CSmsProvider) or WAP SMS Protocol of completion of a
|
|
50 |
* previous request.
|
|
51 |
*
|
|
52 |
* It is also used to request and set the local address of a SAP.
|
|
53 |
* @internalComponent
|
|
54 |
*/
|
|
55 |
class MSmsMessageObserver
|
|
56 |
{
|
|
57 |
public:
|
|
58 |
// Used by the protocol to ask a SAP for its local address.
|
|
59 |
virtual const TSmsAddr& GetLocalAddress() const=0;
|
|
60 |
|
|
61 |
// Used by the protocol to bind (set) the local address for the SAP.
|
|
62 |
virtual void SetLocalAddress(const TSmsAddr& aSmsAddr)=0;
|
|
63 |
|
|
64 |
// Used to notify a SAP that the modem connection status has changed.
|
|
65 |
virtual void ModemNotificationCompleted(TInt aStatus)=0;
|
|
66 |
|
|
67 |
// Used to notify a SAP that sending of a message has completed.
|
|
68 |
// @param aStatus is EPOC error or -(KFailureCauseOffset+failurecause).
|
|
69 |
virtual void MessageSendCompleted(TInt aStatus)=0;
|
|
70 |
|
|
71 |
// Used to notify a SAP that a message has been successfully received.
|
|
72 |
// @param aSmsMessage the SMS message received.
|
|
73 |
// @return aDes a buffer for the deliver report which can be filled in by the observer.
|
|
74 |
// @return EPOC error or -(KFailureCauseOffset+failurecause) must be returned by the observer.
|
|
75 |
virtual TInt MessageReceived(const CSmsMessage& aSmsMessage,TDes& aDes)=0;
|
|
76 |
|
|
77 |
// Used to notify a SAP that a phone enumeration has completed.
|
|
78 |
virtual void EnumeratePhoneCompleted(TInt aStatus)=0;
|
|
79 |
|
|
80 |
// Used to notify a SAP that writing a message to the phone has completed.
|
|
81 |
virtual void MessageWriteCompleted(TInt aStatus, const CSmsMessage* aSmsMessage = NULL)=0;
|
|
82 |
|
|
83 |
// Used to notify a SAP that a message deletion has completed.
|
|
84 |
virtual void MessageDeleteCompleted(TInt aStatus)=0;
|
|
85 |
|
|
86 |
// Used to notify a SAP that a read all SMS parameters has completed.
|
|
87 |
virtual void ReadSmsParamsCompleted(TInt aStatus,CMobilePhoneSmspList* aSmspList)=0;
|
|
88 |
|
|
89 |
// Used to notify a SAP that a write all SMS parameters has completed.
|
|
90 |
virtual void WriteSmsParamsCompleted(TInt aStatus)=0;
|
|
91 |
|
|
92 |
// Used to figure out whether entry in reassembly store can be deleted, or confirmation of
|
|
93 |
// successfull receipt from client is needed
|
|
94 |
virtual TBool ClientConfirmsMessage()const=0;
|
|
95 |
virtual TBool SmsAddrIsDuplicate(const MSmsMessageObserver* aObserver,const TSmsAddr& aAddr)const=0;
|
|
96 |
};
|
|
97 |
|
|
98 |
|
|
99 |
/**
|
|
100 |
* The notification interface used by the active object derived state machines
|
|
101 |
* to notify the protocol of an event or to make a request.
|
|
102 |
* @internalComponent
|
|
103 |
*/
|
|
104 |
class MSmsComm
|
|
105 |
{
|
|
106 |
public:
|
|
107 |
// Callback to allow the protocol to notify a SAP of a new (valid) message.
|
|
108 |
// @param aSmsMessage the received message.
|
|
109 |
// @return EPOC error or -(KFailureCauseOffset+failurecause) must be returned by the observed.
|
|
110 |
virtual TInt ProcessMessageL(const CSmsMessage& aSmsMessage,const TSmsAddr* aOriginalSmsAddr,const CSmsMessage* aOriginalSmsMessage,TDes& aDes)=0;
|
|
111 |
|
|
112 |
// Callback to request deletion of a number of SMS PDUs from the phone.
|
|
113 |
// @param aSlotArray the array of SMS PDU slots to delete.
|
|
114 |
// @param aObserver a reference to an observer if the request is from a SAP.
|
|
115 |
virtual void DeletePDUs(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray,MSmsMessageObserver* aObserver)=0;
|
|
116 |
|
|
117 |
// Callback when the state machine for sending a message has completed.
|
|
118 |
virtual void MessageSendCompleted(TInt aStatus)=0;
|
|
119 |
|
|
120 |
// Callback to notify the protocol that the modem detection status has changed.
|
|
121 |
virtual void ModemNotificationCompleted(TInt aStatus,RPhone::TModemDetection aState)=0;
|
|
122 |
|
|
123 |
// Callback when the state machine for enumerating the phone message stores has completed
|
|
124 |
virtual void PhoneEnumerationCompleted(TInt aStatus)=0;
|
|
125 |
|
|
126 |
// Callback when the state machine for deleting a PDU from the phone has completed
|
|
127 |
virtual TBool ClosingDown() const =0;
|
|
128 |
virtual void CloseNowWrap() = 0;
|
|
129 |
|
|
130 |
// Check if observer is still present.
|
|
131 |
// @param a reference to an observer.
|
|
132 |
virtual TBool ObserverIsPresent(const MSmsMessageObserver& aObserver) const =0;
|
|
133 |
// Callback to get network info
|
|
134 |
virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& NetworkInfo()const=0;
|
|
135 |
virtual TBool NetworkInfoAvailable()const=0;
|
|
136 |
|
|
137 |
// Callback to notify the protocol that the Disk Space Monitor has changed state.
|
|
138 |
virtual void DiskSpaceMonitorStateChange(TSmsDiskSpaceMonitorStatus aStatus)=0;
|
|
139 |
};
|
|
140 |
|
|
141 |
#endif // SMSPCOMM_H__
|