|
Nokia N97 SDK Example Applications Guide |
#include <applicationusingsnap.h>
Inheritance diagram for CApplicationUsingSNAP:

Definition at line 30 of file applicationusingsnap.h.
Public Member Functions |
|
| ~CApplicationUsingSNAP () | |
| void | RunL () |
| void | DoCancel () |
| void | StartL () |
Static Public Member Functions |
|
| static CApplicationUsingSNAP * | NewL (MDataMobilityPrinter &aObserver) |
Private Member Functions |
|
| CApplicationUsingSNAP (MDataMobilityPrinter &aObserver) | |
| void | ConstructL () |
| void | PrintL (TInt aResourceId) |
| void | PrintL (TInt aResourceId, TInt aInt) |
Private Attributes |
|
| MDataMobilityPrinter & | iObserver |
| RConnection | iConnection |
| RSocketServ | iSocketServer |
|
|
Destructor. Definition at line 63 of file applicationusingsnap.cpp. References iConnection, and iSocketServer. 00064 { 00065 Cancel(); 00066 00067 iConnection.Close(); 00068 00069 iSocketServer.Close(); 00070 }
|
|
|
C++ default constructor. Definition at line 52 of file applicationusingsnap.cpp. Referenced by NewL(). 00053 : CActive( CActive::EPriorityStandard ), 00054 iObserver( aObserver ) 00055 { 00056 CActiveScheduler::Add( this ); 00057 }
|
|
|
NewL is first phase of two-phased constructor. Definition at line 28 of file applicationusingsnap.cpp. References CApplicationUsingSNAP(). 00030 { 00031 CApplicationUsingSNAP* self = 00032 new ( ELeave ) CApplicationUsingSNAP( aObserver ); 00033 CleanupStack::PushL( self ); 00034 self->ConstructL(); 00035 CleanupStack::Pop( self ); 00036 return self; 00037 }
|
|
|
Start the connection. Definition at line 76 of file applicationusingsnap.cpp. References iConnection, iSocketServer, and PrintL(). 00077 { 00078 User::LeaveIfError( iConnection.Open( iSocketServer ) ); 00079 00080 TConnSnapPref prefs; 00081 prefs.SetSnap( 1 ); // assume 1 is a valid SNAP configured in CommsDat 00082 00083 PrintL( R_OUTPUT_START_CONNECTION_WITH_PREFERENCES ); 00084 00085 PrintL( R_OUTPUT_SNAP_ID, prefs.Snap() ); 00086 00087 iConnection.Start( prefs, iStatus ); 00088 00089 SetActive(); 00090 }
|
|
|
By default Symbian OS constructor is private. Definition at line 43 of file applicationusingsnap.cpp. References iSocketServer. 00044 { 00045 User::LeaveIfError( iSocketServer.Connect() ); 00046 }
|
|
|
Helper method to send message to print to the observer.
Definition at line 127 of file applicationusingsnap.cpp. References iObserver, and MDataMobilityPrinter::Print(). Referenced by RunL(), and StartL(). 00128 { 00129 // Load a string from the resource file. 00130 HBufC* message = StringLoader::LoadL( aResourceId ); 00131 00132 iObserver.Print( *message ); 00133 00134 delete message; 00135 }
|
|
||||||||||||
|
Helper method to send message to print to the observer.
Definition at line 141 of file applicationusingsnap.cpp. References iObserver, and MDataMobilityPrinter::Print(). 00142 { 00143 // Load a string from the resource file. 00144 HBufC* message = StringLoader::LoadL( aResourceId, aInt ); 00145 00146 iObserver.Print( *message ); 00147 00148 delete message; 00149 }
|
|
© Nokia 2009 |