CDpsEngine Class Reference

class CDpsEngine : public CBase

Inherits from

Public Member Functions
IMPORT_C void CancelDpsEventNotify ()
IMPORT_C void CancelDpsRequest ()
IMPORT_C void CancelPrintMode ()
IMPORT_C void ConnectStateNotify ( TRequestStatus &)
IMPORT_C void Delete ()
IMPORT_C void DoDpsRequestL ( TMDpsOperation *, TRequestStatus &)
IMPORT_C void DpsEventNotify ( TDpsEvents &, TRequestStatus &)
IMPORT_C const TDesC & DpsFolder ()
TDpsXmlString * DpsParameters ()
TDpsEvents * Event ()
TRequestStatus *& EventRequest ()
IMPORT_C void GetDpsConfigL ( TDpsConfigPrintReq &)
IMPORT_C CDpsEngine * GetEngineL ()
TRequestStatus *& OperationRequest ()
TRequestStatus *& PrinterConnectRequest ()
RPtp & Ptp ()
void SetDpsFolder (const TDesC &)
IMPORT_C void SetPrintMode ( TRequestStatus &)
Private Member Functions
~CDpsEngine ()
void ConstructL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TConnectionStatus { ENotConnected  = 1, EPrinterConnected , EPrinterDisconnected , EOtherConnected , EWrongPrintModeConnected }
Private Attributes
TRequestStatus * iDpsEventRequest
TFileName iDpsFolder
TRequestStatus * iDpsOperationRequest
CDpsStateMachine * iDpsOperator
TDpsXmlString * iDpsParameters
TDpsEvents * iOutEvent
TRequestStatus * iPrinterConnectRequest
RPtp iPtp
CDpsUsbNotifier * iUsbNotifier

Constructor & Destructor Documentation

~CDpsEngine()

~CDpsEngine ( ) [private]

Prohibits the destructor called by the client. To delete engine object Delete() must be called

Member Functions Documentation

CancelDpsEventNotify()

IMPORT_C void CancelDpsEventNotify ( )
Since
3.2 pictbridge.lib
Cancels Dps event notification. The client only needs to call this to reset the state of the dps engine and it must be called after CancelDpsRequest() .

CancelDpsRequest()

IMPORT_C void CancelDpsRequest ( )
Since
3.2 pictbridge.lib
Cancels the dps operation. Calling this will reset the state of the dps engine, either because of error happened or the client wants to do this on purpose. In most cases, the client never need to cancel the ongoing request because the request will end very quick, normally within several million seconds. The client normally waits until the request is finished, either succesfully or failed indicated by timeout.

CancelPrintMode()

IMPORT_C void CancelPrintMode ( )
Since
3.2 pictbridge.lib
Cancels the SetPrintMode request

ConnectStateNotify(TRequestStatus &)

IMPORT_C void ConnectStateNotify ( TRequestStatus & aStatus )
Since
3.2 pictbridge.lib
Registers connection notification. This function can inform the connection and the disconnect, two states. Connection: the personality has been set to PTP by SetPrintMode, but the cable is not connected at the moment. The connection will be informed by this function. Disconnect: the user has unplugged the cable or changed personality.

Parameters

TRequestStatus & aStatus the asynchronous request status and it has the connect state after returned.

ConstructL()

void ConstructL ( ) [private]

Second phase constructor. Operations which might leave should be called here

Delete()

IMPORT_C void Delete ( )
Since
3.2 pictbridge.lib
Deletes the dps engine object.

DoDpsRequestL(TMDpsOperation *, TRequestStatus &)

IMPORT_C void DoDpsRequestL ( TMDpsOperation * aRequest,
TRequestStatus & aStatus
)
Since
3.2 pictbridge.lib
Starts a Dps operation. If this function returned with error, e.g. leaving, the client should call CancelDpsRequest() , to cancel the pending request.

Parameters

TMDpsOperation * aRequest the Dps operation. It includes both request and reply. The client should fill in the request parameter and the Dps engine will fill in the reply paramter when this operation is finished. The client should declare it as a class variable.
TRequestStatus & aStatus the asynchronous status

DpsEventNotify(TDpsEvents &, TRequestStatus &)

IMPORT_C void DpsEventNotify ( TDpsEvents & aParam,
TRequestStatus & aStatus
)
Since
3.2 pictbridge.lib
Registers Dps event notification. There are two events: jobStatus and deviceStatus. This function is called immediately after ConnecSatetNotify call. After this call, the client should issue ConfigPrintService request to configure the printer.

Parameters

TDpsEvents & aParam this parameter serves as out parameter. After processing the event from the printer, Dps engine will put the correct value to this parameter. As the result, the client can get the event by accessing this parameter after this request gets answered. So the client should have it as a class variable
TRequestStatus & aStatus the asynchronous status.

DpsFolder()

IMPORT_C const TDesC & DpsFolder ( ) const
Since
3.2 pictbridge.lib
Gets the folder where the printer configure file should be kept. The print App needs a file to store the printer configure when it first calls configPrintService Dps request. The print app can quit at anytime while the ptpserver (stack) is still running. Since the ptpstack is keeping the session with the printer, the printer always does not excute the second onward configPrintService request. As the result, the restarted print app cannot get the printer configure. So there must be a file for keeping this information and it will be deleted by ptpserver when it quits, e.g. when the connection with the printer is lost.

DpsParameters()

TDpsXmlString * DpsParameters ( ) const

Gets the dps constant strings

Event()

TDpsEvents * Event ( ) const

Gets the Dps event object

EventRequest()

TRequestStatus *& EventRequest ( )

GetDpsConfigL(TDpsConfigPrintReq &)

IMPORT_C void GetDpsConfigL ( TDpsConfigPrintReq & aConfig )
Since
3.2 pictbridge.lib
Reads the phone dps configuration from the resource file

Parameters

TDpsConfigPrintReq & aConfig the dps configuration is returned by this parameter

GetEngineL()

IMPORT_C CDpsEngine * GetEngineL ( ) [static]
Since
3.2 pictbridge.lib
The client should always call this function to get the Dps engine object. This function guarantees there is only one engine in the thread, a singleton.

OperationRequest()

TRequestStatus *& OperationRequest ( )

PrinterConnectRequest()

TRequestStatus *& PrinterConnectRequest ( )

Ptp()

RPtp & Ptp ( )

Gets the ptp server reference

SetDpsFolder(const TDesC &)

void SetDpsFolder ( const TDesC & aFolder )

Sets the Dps file folder.

Parameters

const TDesC & aFolder the foler location, readed from Ptp server/stack

SetPrintMode(TRequestStatus &)

IMPORT_C void SetPrintMode ( TRequestStatus & aStatus )
Since
3.2 pictbridge.lib
Sets the personality to PTP. This must be the first call after the client has got the CDpsEngine object and should only be called once.

Parameters

TRequestStatus & aStatus the asynchronous request and it has the connect state after returned. The client can use this value to get the current connect status.

Member Enumerations Documentation

Enum TConnectionStatus

Enumerators

ENotConnected = 1
EPrinterConnected
EPrinterDisconnected
EOtherConnected
EWrongPrintModeConnected

Member Data Documentation

TRequestStatus * iDpsEventRequest

TRequestStatus * iDpsEventRequest [private]

TFileName iDpsFolder

TFileName iDpsFolder [private]

TRequestStatus * iDpsOperationRequest

TRequestStatus * iDpsOperationRequest [private]

CDpsStateMachine * iDpsOperator

CDpsStateMachine * iDpsOperator [private]

TDpsXmlString * iDpsParameters

TDpsXmlString * iDpsParameters [private]

TDpsEvents * iOutEvent

TDpsEvents * iOutEvent [private]

TRequestStatus * iPrinterConnectRequest

TRequestStatus * iPrinterConnectRequest [private]

RPtp iPtp

RPtp iPtp [private]

CDpsUsbNotifier * iUsbNotifier

CDpsUsbNotifier * iUsbNotifier [private]