?? smstransport.cpp
字號(hào):
// Copyright (c) 2004 - 2007, Symbian Software Ltd. All rights reserved.
#include "smstransport.h"
CSmsTransport* CSmsTransport::NewL(TAny* aTransportCreateInfo)
/**
This factory function is defined so the class can be instantiated
via ECOM, which means it can only take a single TAny* argument.
@param aTransportCreateInfo Pointer to an instance of
TTransportCreateInfo, which contains the
data required to allocate the transport.
@return Transport that sends messages to a remote
device over SMS. This is owned by the caller.
*/
{
const TTransportInterfaceCreateInfo& tci =
*reinterpret_cast<TTransportInterfaceCreateInfo*>(aTransportCreateInfo);
return New2L(tci.iObserver, *tci.iAddress, tci.iInitListen);
}
CSmsTransport* CSmsTransport::New2L(MTransportObserver& aObserver, const TDesC& aAddress, TBool aInitListen)
/**
Factory function allocates new initialized instance of CSmsTransport.
The returned object can be used to send short messages to and receive
them from a single remote device.
@param aObserver Observer to notify about transport events.
This is managed by the CTransport superclass.
@param aAddress Remote device's address. This should be a
text representation of a telephone number.
@param aInitListen If true, this object should start by listening
for an incoming payload. Otherwise, it should
wait for its owner to send a payload to the remote
device.
@return Transport that sends messages to a remote
device via SMS. This is owned by the caller.
@see NewL
*/
{
CSmsTransport* self = new(ELeave) CSmsTransport(aObserver);
CleanupStack::PushL(self);
self->ConstructL(aAddress, aInitListen);
CleanupStack::Pop(self);
return self;
}
CSmsTransport::CSmsTransport(MTransportObserver& aObserver)
/**
This c'tor is defined to pass the supplied observer to the superclass.
@param aObserver Observer to notify about transport events.
This is managed by the CTransport superclass.
*/
: CBodyTextTransport(aObserver, KUidMsgTypeSMS)
{
// empty.
}
// -------- implement CMessageTransport --------
TBool CSmsTransport::ShouldUseReceivedMtmUid(TUid aMtmUid) const
/**
Implement CMessageTransport by testing whether the supplied
MTM UID identifies a short message MTM.
@param aMtmUid Incoming message's UID.
@return Whether aMtmUid describes an SMS MTM.
*/
{
return aMtmUid == KUidMsgTypeSMS;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -