S60 5th Edition SDK Example Applications Guide |
#include <csasyncrequesthandler.h>
Inheritance diagram for CCSAsyncRequestHandler:
Definition at line 33 of file csasyncrequesthandler.h.
Public Member Functions | |
virtual | ~CCSAsyncRequestHandler () |
void | RequestTime () |
void | CancelRequest () |
TTime | Time () const |
Static Public Member Functions | |
static CCSAsyncRequestHandler * | NewL (MAsyncTimeObserver &aObserver) |
static CCSAsyncRequestHandler * | NewLC (MAsyncTimeObserver &aObserver) |
Protected Member Functions | |
void | RunL () |
void | DoCancel () |
Private Member Functions | |
CCSAsyncRequestHandler (MAsyncTimeObserver &aObserver) | |
void | ConstructL () |
Private Attributes | |
RTimeServerSession | iSession |
TTime | iTime |
MAsyncTimeObserver & | iObserver |
|
~CCSAsyncRequestHandler. Destructor. Destroys the object and release all memory objects. Definition at line 77 of file csasyncrequesthandler.cpp. References iSession. 00078 { 00079 Cancel(); // Causes call to DoCancel() 00080 iSession.Close(); 00081 }
|
|
CCSAsyncRequestHandler. Performs the first phase of two phase construction.
Definition at line 66 of file csasyncrequesthandler.cpp. Referenced by NewLC(). 00067 : CActive( EPriorityStandard ), iObserver( aObserver ) 00068 { 00069 CActiveScheduler::Add( this ); 00070 }
|
|
NewL. Two-phased constructor. Creates a CCSAsyncRequestHandler object using two phase construction, and return a pointer to the created object.
Definition at line 30 of file csasyncrequesthandler.cpp. References NewLC(). Referenced by CCSAsyncDocument::CreateAppUiL(). 00032 { 00033 CCSAsyncRequestHandler* self = NewLC( aObserver ); 00034 CleanupStack::Pop( self ); 00035 return( self ) ; 00036 }
|
|
NewLC. Two-phased constructor. Creates a CCSAsyncRequestHandler object using two phase construction, and return a pointer to the created object.
Definition at line 42 of file csasyncrequesthandler.cpp. References CCSAsyncRequestHandler(). Referenced by NewL(). 00044 { 00045 CCSAsyncRequestHandler* self = 00046 new ( ELeave ) CCSAsyncRequestHandler( aObserver ); 00047 CleanupStack::PushL( self ); 00048 self->ConstructL(); 00049 return self; 00050 }
|
|
RequestTime. Sends a request to the server for an update to the time. Definition at line 88 of file csasyncrequesthandler.cpp. References iSession, iTime, and RTimeServerSession::RequestTime(). Referenced by RunL(), and CCSAsyncDocument::UpdateTime(). 00089 { 00090 if ( !IsActive() ) 00091 { 00092 iSession.RequestTime( iTime, iStatus ); 00093 SetActive(); 00094 } 00095 }
|
|
CancelRequest. Cancels an outstanding request. Definition at line 102 of file csasyncrequesthandler.cpp. Referenced by CCSAsyncDocument::StopClock().
|
|
Time. Gets a copy of the last time received from the server.
Definition at line 151 of file csasyncrequesthandler.cpp. References iTime. Referenced by CCSAsyncDocument::Time(). 00152 { 00153 return iTime; 00154 }
|
|
From CActive, RunL. Callback function. Invoked to handle responses from the server. Definition at line 112 of file csasyncrequesthandler.cpp. References MAsyncTimeObserver::HandleTimeUpdate(), iObserver, and RequestTime(). 00113 { 00114 switch ( iStatus.Int() ) 00115 { 00116 case ETimeServRequestTimeComplete: 00117 // The server has completed the request, signalled the client 00118 // thread and the clients active scheduler runs the active object. 00119 // Now do something with it 00120 iObserver.HandleTimeUpdate(); 00121 RequestTime(); // Add this line to make the clock keep ticking 00122 break ; 00123 00124 case KErrCancel: 00125 // The request was canceled 00126 break ; 00127 00128 case KErrNotReady: 00129 // We requested a new time before completing the previous request 00130 default: 00131 User::Panic( KCSAsyncClient, ECSAsyncBadState ); // Unexpected error 00132 break; 00133 } 00134 }
|
|
From CActive, DoCancel. Cancels any outstanding operation. Definition at line 141 of file csasyncrequesthandler.cpp. References RTimeServerSession::CancelRequestTime(), and iSession. 00142 { 00143 iSession.CancelRequestTime(); 00144 }
|
|
ConstructL. Performs the second phase construction of a CCSAsyncRequestHandler object. Definition at line 57 of file csasyncrequesthandler.cpp. References RTimeServerSession::Connect(), and iSession.
|
|
iSession, the time server session. Definition at line 123 of file csasyncrequesthandler.h. Referenced by ConstructL(), DoCancel(), RequestTime(), and ~CCSAsyncRequestHandler(). |
|
iTime, passed to the session to store the time. Definition at line 128 of file csasyncrequesthandler.h. Referenced by RequestTime(), and Time(). |
|
iObserver, observer which handles updates from the server. Definition at line 133 of file csasyncrequesthandler.h. Referenced by RunL(). |
© Nokia 2009 |