Nokia N97 SDK
Example Applications Guide

CALRApplicationUsingNoPref Class Reference

#include <alrapplicationusingnopref.h>

Inheritance diagram for CALRApplicationUsingNoPref:

List of all members.

Detailed Description

CALRApplicationUsingNoPref example of class using connection and Mobility extension API.

Definition at line 33 of file alrapplicationusingnopref.h.


Public Member Functions

  ~CALRApplicationUsingNoPref ()
void  RunL ()
void  DoCancel ()
TInt  RunError (TInt aError)
void  PreferredCarrierAvailable (TAccessPointInfo aOldAPInfo, TAccessPointInfo aNewAPInfo, TBool aIsUpgrade, TBool aIsSeamless)
void  NewCarrierActive (TAccessPointInfo aNewAPInfo, TBool aIsSeamless)
void  Error (TInt aError)
void  StartL ()

Static Public Member Functions

static CALRApplicationUsingNoPref *  NewL (MDataMobilityPrinter &aObserver)

Private Member Functions

  CALRApplicationUsingNoPref (MDataMobilityPrinter &aObserver)
void  ConstructL ()
void  Print (TInt aResourceId)
void  Print (TInt aResourceId, TInt aInt)

Private Attributes

MDataMobilityPrinter &  iObserver
RConnection  iConnection
RSocketServ  iSocketServer
CActiveCommsMobilityApiExt *  iMobility


Constructor & Destructor Documentation

CALRApplicationUsingNoPref::~CALRApplicationUsingNoPref (   ) 
 

Destructor.

Definition at line 62 of file alrapplicationusingnopref.cpp.

References iConnection, iMobility, and iSocketServer.

00063     {
00064     delete iMobility;
00065 
00066     Cancel();
00067 
00068     iConnection.Close();
00069 
00070     iSocketServer.Close();
00071     }

CALRApplicationUsingNoPref::CALRApplicationUsingNoPref (  MDataMobilityPrinter &  aObserver  )  [private]
 

C++ default constructor.

Definition at line 50 of file alrapplicationusingnopref.cpp.

Referenced by NewL().

00051     : CActive( CActive::EPriorityStandard ),
00052       iObserver( aObserver ),
00053       iMobility( NULL )
00054     {
00055     CActiveScheduler::Add( this );
00056     }


Member Function Documentation

CALRApplicationUsingNoPref * CALRApplicationUsingNoPref::NewL (  MDataMobilityPrinter &  aObserver  )  [static]
 

NewL is first phase of two-phased constructor.

Definition at line 27 of file alrapplicationusingnopref.cpp.

References CALRApplicationUsingNoPref().

00028     {
00029     CALRApplicationUsingNoPref* self =
00030         new ( ELeave ) CALRApplicationUsingNoPref( aObserver );
00031     CleanupStack::PushL( self );
00032     self->ConstructL();
00033     CleanupStack::Pop( self );
00034     return self;
00035     }

void CALRApplicationUsingNoPref::StartL (   ) 
 

Start the connection.

Definition at line 77 of file alrapplicationusingnopref.cpp.

References iConnection, iSocketServer, and Print().

00078     {
00079     User::LeaveIfError( iConnection.Open( iSocketServer ) );
00080 
00081     Print( R_OUTPUT_START_CONNECTION_WITH_NO_PREFERENCES );
00082 
00083     iConnection.Start( iStatus );
00084 
00085     SetActive();
00086     }

void CALRApplicationUsingNoPref::ConstructL (   )  [private]
 

By default Symbian OS constructor is private.

Definition at line 41 of file alrapplicationusingnopref.cpp.

References iSocketServer.

00042     {
00043     User::LeaveIfError( iSocketServer.Connect() );
00044     }

void CALRApplicationUsingNoPref::Print (  TInt  aResourceId  )  [private]
 

Helper method to send message to print to the observer.

Parameters:
aResourceId  Resource identifier of the string to print.

Definition at line 214 of file alrapplicationusingnopref.cpp.

References iObserver, and MDataMobilityPrinter::Print().

Referenced by Error(), NewCarrierActive(), PreferredCarrierAvailable(), RunError(), RunL(), and StartL().

00215     {
00216     // Load a string from the resource file.
00217     HBufC* message = NULL;
00218     TRAPD( err, message = StringLoader::LoadL( aResourceId ) );
00219     if ( err != KErrNone )
00220         {
00221         return;
00222         }
00223 
00224     iObserver.Print( *message );
00225 
00226     delete message;
00227     }

void CALRApplicationUsingNoPref::Print (  TInt  aResourceId,
TInt  aInt
)  [private]
 

Helper method to send message to print to the observer.

Parameters:
aResourceId  Resource identifier of the string to print.
aInt  Integer value replacing N in the string.

Definition at line 233 of file alrapplicationusingnopref.cpp.

References iObserver, and MDataMobilityPrinter::Print().

00234     {
00235     // Load a string from the resource file.
00236     HBufC* message = NULL;
00237     TRAPD( err, message = StringLoader::LoadL( aResourceId, aInt ) );
00238     if ( err != KErrNone )
00239         {
00240         return;
00241         }
00242 
00243     iObserver.Print( *message );
00244 
00245     delete message;
00246     }


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top