Nokia N97 SDK
Example Applications Guide

alrapplicationusingnopref.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : alrapplicationusingnopref.h
00004 *  Part of     : datamobility
00005 *  Description : example of class declaration using connection
00006 *                and Mobility extension API
00007 *
00008 *  Copyright (c) 2007 Nokia Corporation.
00009 *  This material, including documentation and any related
00010 *  computer programs, is protected by copyright controlled by
00011 *  Nokia Corporation.
00012 * ==============================================================================
00013 */
00014 
00015 #ifndef ALRAPPLICATIONUSINGNOPREF_H
00016 #define ALRAPPLICATIONUSINGNOPREF_H
00017 
00018 // INCLUDES
00019 #include <e32base.h>
00020 #include <in_sock.h>
00021 #include <comms-infras/cs_mobility_apiext.h>
00022 
00023 // FORWARD DECLARATIONS
00024 class MDataMobilityPrinter;
00025 
00026 // CLASS DECLARATION
00027 
00028 /**
00029 *  CALRApplicationUsingNoPref  example of class using connection
00030 *                              and Mobility extension API.
00031 *
00032 */
00033 class CALRApplicationUsingNoPref : public CActive, public MMobilityProtocolResp
00034     {
00035     public:  // Constructors and destructor
00036 
00037         /**
00038         * NewL is first phase of two-phased constructor.
00039         */
00040         static CALRApplicationUsingNoPref* NewL( MDataMobilityPrinter& aObserver );
00041 
00042         /**
00043         * Destructor.
00044         */
00045         ~CALRApplicationUsingNoPref();
00046 
00047     public: // From CActive
00048 
00049         void RunL();
00050 
00051         void DoCancel();
00052 
00053         TInt RunError( TInt aError );
00054 
00055     public: // From MMobilityProtocolResp
00056 
00057         void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
00058                                         TAccessPointInfo aNewAPInfo,
00059                                         TBool aIsUpgrade,
00060                                         TBool aIsSeamless );
00061 
00062         void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless );
00063 
00064         void Error( TInt aError );
00065 
00066     public: // New functions
00067 
00068         /**
00069         * Start the connection.
00070         */
00071         void StartL();
00072 
00073     private:
00074 
00075         /**
00076         * C++ default constructor.
00077         */
00078         CALRApplicationUsingNoPref( MDataMobilityPrinter& aObserver );
00079 
00080         /**
00081         * By default Symbian OS constructor is private.
00082         */
00083         void ConstructL();
00084 
00085         /**
00086          * Helper method to send message to print to the observer.
00087          * @param aResourceId Resource identifier of the string to print.
00088          */
00089          void Print( TInt aResourceId );
00090 
00091          /**
00092          * Helper method to send message to print to the observer.
00093          * @param aResourceId Resource identifier of the string to print.
00094          * @param aInt Integer value replacing %N in the string.
00095          */
00096          void Print( TInt aResourceId, TInt aInt );
00097 
00098     private:    // Data
00099 
00100         MDataMobilityPrinter&         iObserver;       // Pointer to Observer
00101         RConnection                   iConnection;
00102         RSocketServ                   iSocketServer;
00103         CActiveCommsMobilityApiExt*   iMobility;
00104     };
00105 
00106 #endif // ALRAPPLICATIONUSINGNOPREF_H
00107 

© Nokia 2009

Back to top