wlanutilities/wlansniffer/model/inc/wsfmodel.h
branchRCL_3
changeset 20 a9524956f6b5
parent 12 981afc7d3841
equal deleted inserted replaced
18:aaabc7526ded 20:a9524956f6b5
    21 #define C_WSFMODEL_H
    21 #define C_WSFMODEL_H
    22 
    22 
    23 
    23 
    24 //  EXTERNAL INCLUDES
    24 //  EXTERNAL INCLUDES
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <ictsclientinterface.h>
       
    27 
    26 
    28 //  INTERNAL INCLUDES
    27 //  INTERNAL INCLUDES
    29 #include "wsfsession.h"
    28 #include "wsfsession.h"
    30 #include "wsfbrowserlaunchobserver.h"
    29 #include "wsfbrowserlaunchobserver.h"
    31 #include "wsfscreensaverstateobserver.h"
    30 #include "wsfscreensaverstateobserver.h"
    52  * @since S60 5.0
    51  * @since S60 5.0
    53  */
    52  */
    54 NONSHARABLE_CLASS( CWsfModel ): public CBase, 
    53 NONSHARABLE_CLASS( CWsfModel ): public CBase, 
    55                                 public MWsfBrowserLaunchObserver, 
    54                                 public MWsfBrowserLaunchObserver, 
    56                                 public MWsfScreenSaverStateObserver,
    55                                 public MWsfScreenSaverStateObserver,
    57                                 public MWsfBrowserLaunchAdapter,
    56                                 public MWsfBrowserLaunchAdapter
    58                                 public MIctsObserver
       
    59     {
    57     {
    60     public:     // Constructors and destructor
    58     public:     // Constructors and destructor
    61 
    59 
    62         /**
    60         /**
    63         * Factory function.
    61         * Factory function.
   160 
   158 
   161         /**
   159         /**
   162         * Connects to the given WLAN IAP
   160         * Connects to the given WLAN IAP
   163         * @since S60 5.0
   161         * @since S60 5.0
   164         * @param aIapId WLAN IAP id to connect to.
   162         * @param aIapId WLAN IAP id to connect to.
   165         */
   163         * @param aConnectOnly ETrue if Connect selected
   166         IMPORT_C int ConnectL( TUint32 aIapId );
   164         * @param aPersistence The value of the persistence property
       
   165         */
       
   166         IMPORT_C int ConnectL( TUint32 aIapId, 
       
   167                                TBool aConnectOnly,
       
   168                                TWsfIapPersistence aPersistence );
   167         
   169         
   168         /**
   170         /**
   169         * Asyncronous request to the server to connect to the given WLAN IAP
   171         * Asyncronous request to the server to connect to the given WLAN IAP
   170         * @since S60 5.2
   172         * @since S60 5.2
   171         * @param aPckg request result
   173         * @param aPckg request result
   172         * @param aIapId WLAN IAP id to connect to.
   174         * @param aIapId WLAN IAP id to connect to.
       
   175         * @param aConnectOnly ETrue if Connect selected
   173         * @param aPersistence The value of the persistence property
   176         * @param aPersistence The value of the persistence property
   174         * @param aStatus The request status object used to contain 
   177         * @param aStatus The request status object used to contain 
   175         *        the completion status of the request.
   178         *        the completion status of the request.
   176         */
   179         */
   177         IMPORT_C void ConnectL( TPckgBuf<TBool>& aPckg, TUint32 aIapId, 
   180         IMPORT_C void ConnectL( TPckgBuf<TBool>& aPckg, TUint32 aIapId,
   178                                TWsfIapPersistence aPersistence,
   181                                 TBool aConnectOnly,
   179                                TRequestStatus& aStatus );
   182                                 TWsfIapPersistence aPersistence,
       
   183                                 TRequestStatus& aStatus );
   180 
   184 
   181         /**
   185         /**
   182         * Sets connection result
   186         * Sets connection result
   183         * @since S60 5.2
   187         * @since S60 5.2
   184         * @param aResult connection result
   188         * @param aResult connection result
   266         */
   270         */
   267         IMPORT_C TBool CreateAccessPointL( TWsfWlanInfo& aWlan,
   271         IMPORT_C TBool CreateAccessPointL( TWsfWlanInfo& aWlan,
   268                                            TBool aExplicitDefine );
   272                                            TBool aExplicitDefine );
   269 
   273 
   270         /**
   274         /**
   271         * Tests the WLAN access point and offers to save it to a destination
       
   272         * @since S60 5.0
       
   273         * @param aWlan Reference to wlaninfo to test
       
   274         * @param aKeepConnection Indicates whether to keep alive the connection.
       
   275         * @param aConnectOnly ETrue if the helper app is expected to connect 
       
   276         *                     only, EFalse if it should also launch the browser 
       
   277         *                     on successful connection.
       
   278         * @return KErrNone if successful, system-wide error code otherwise
       
   279         */
       
   280         IMPORT_C TInt TestAccessPointL( TWsfWlanInfo& aWlan,
       
   281                                         TBool aKeepConnection, 
       
   282                                         TBool aConnectOnly );
       
   283         
       
   284         /**
       
   285         * Tests the connected WLAN access point
       
   286         * @since S60 5.0
       
   287         * @param aWlan Reference to wlaninfo to test
       
   288         * @param aConnectOnly ETrue if connect only case, 
       
   289         * EFalse if launch browser case after successful connection.
       
   290         * @return KErrNone if successful, system-wide error code otherwise
       
   291         */
       
   292         IMPORT_C TInt TestConnectedAccessPointL( TWsfWlanInfo& aWlan,
       
   293                                                  TBool aConnectOnly );
       
   294 
       
   295         /**
       
   296         * Requests a rescan for available wlans
   275         * Requests a rescan for available wlans
   297         * @since S60 5.0
   276         * @since S60 5.0
   298         * @return ETrue on success
   277         * @return ETrue on success
   299         */
   278         */
   300         IMPORT_C TBool RefreshScanL();
   279         IMPORT_C TBool RefreshScanL();
   388         /**
   367         /**
   389         * Aborts the currently ongoing scanning process 
   368         * Aborts the currently ongoing scanning process 
   390         * @since S60 5.0
   369         * @since S60 5.0
   391         */
   370         */
   392         IMPORT_C void AbortScanningL();
   371         IMPORT_C void AbortScanningL();
   393 
       
   394         /**
       
   395         * Gets the ICTS test permission setting value 
       
   396         * @since S60 5.0
       
   397         * @return The ICTS setting
       
   398         */
       
   399         IMPORT_C static TInt IctsTestPermission();
       
   400         
   372         
   401         /**
   373         /**
   402         * Check if Iap Id is valid
   374         * Check if Iap Id is valid
   403         * Leaves with system wide error code if Iap ID is 
   375         * Leaves with system wide error code if Iap ID is 
   404         * not valid or checking fails
   376         * not valid or checking fails
   444         * Called if the status of the screensaver has been changed
   416         * Called if the status of the screensaver has been changed
   445         * @since S60 5.0
   417         * @since S60 5.0
   446         * @param aScreenSaverActive Current status of the screensaver
   418         * @param aScreenSaverActive Current status of the screensaver
   447         */
   419         */
   448         void ScreenSaverStatusChangedL( const TBool aScreenSaverActive );
   420         void ScreenSaverStatusChangedL( const TBool aScreenSaverActive );
   449 
   421         
   450 
       
   451     public:     // from MIctsObserver
       
   452 
       
   453         /**
       
   454         * Called by ICTS during/after connectivity test
       
   455         * @since S60 5.0
       
   456         * @param aResult Result code of the connectivity test
       
   457         * @param aString Parameter to hold auxiliary data
       
   458         */
       
   459         void ConnectivityObserver( TIctsTestResult aResult, const TDesC& aString );
       
   460 
       
   461 
   422 
   462     private:  // New methods
   423     private:  // New methods
   463         
       
   464         /**
       
   465         * Starts WLAN Login application
       
   466         * @param aString Contains redirect URL
       
   467         */  
       
   468         void LaunchWlanLoginL( const TDesC& aString );
       
   469         
       
   470         /**
       
   471         * Makes the temporary IAP created for ICT persistent, i.e. notifies
       
   472         * the server not to delete it when the connection terminates.
       
   473         * @since S60 5.0
       
   474         * @param aPersistence The persistence property for the IAP
       
   475         */    
       
   476         void MakeIctIapPersistentL( TWsfIapPersistence aPersistence );
       
   477         
       
   478         /**
       
   479         * Moves the IAP to internet SNAP
       
   480         * @param aIapId Id of the connection method
       
   481         */  
       
   482         void MoveToInternetSnapL( const TUint32 aIapId );
       
   483         
   424         
   484         /**
   425         /**
   485         * Check if there is disk space left 
   426         * Check if there is disk space left 
   486         * Leaves with KErrDiskFull is space is below CL
   427         * Leaves with KErrDiskFull is space is below CL
   487         * @since S60 5.0
   428         * @since S60 5.0
   540 
   481 
   541         /**
   482         /**
   542         * Id of currently connected IAP (if applicable)
   483         * Id of currently connected IAP (if applicable)
   543         */
   484         */
   544         TUint iConnectedIapId;
   485         TUint iConnectedIapId;
   545         
       
   546         /**
       
   547         * Network id of currently connected IAP (if applicable)
       
   548         */
       
   549         TUint iConnectedNetId;
       
   550 
   486 
   551         /**
   487         /**
   552         * Refreshing status
   488         * Refreshing status
   553         */
   489         */
   554         TBool iRefreshing;
   490         TBool iRefreshing;
   555         
       
   556         /**
       
   557         * Persistent WlanInfo for ICT cleanup
       
   558         */
       
   559         TWsfWlanInfo iIctWlanInfo;
       
   560         
   491         
   561         /**
   492         /**
   562         * Indicates whether connection creation has been started but not
   493         * Indicates whether connection creation has been started but not
   563         * finished yet.
   494         * finished yet.
   564         */
   495         */
   565         TBool iConnecting;
   496         TBool iConnecting;
   566         
       
   567         /**
       
   568         * Waiter for ICT
       
   569         */
       
   570         CActiveSchedulerWait iIctWait;
       
   571         
       
   572         /**
       
   573         * Indicates that connectivity test if over.
       
   574         */
       
   575         TBool iIctEnded;
       
   576         
       
   577         /**
       
   578         * Indicates if connection will be kept when launching browser.
       
   579         */
       
   580         TBool iKeepConnection;
       
   581         
       
   582         /**
       
   583         * Indicates if "Connect" or "Start Web browsing" is selected.
       
   584         */
       
   585         TBool iConnectOnly;
       
   586         
       
   587 		/**
       
   588         * ICT class. Owned.
       
   589         */
       
   590         CIctsClientInterface* iIct;
       
   591 
   497 
   592     };
   498     };
   593 
   499 
   594 
   500 
   595 #include "wsfmodel.inl"
   501 #include "wsfmodel.inl"