hotspotfw/hsbrowser/inc/hsbrowsercontainer.h
branchRCL_3
changeset 24 63be7eb3fc78
parent 23 b852595f5cbe
child 25 f28ada11abbf
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Declares container control for HotSpot Browser Application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HSBROWSERCONTAINER_H
       
    21 #define HSBROWSERCONTAINER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <coecntrl.h>
       
    25 #include <coecobs.h>
       
    26 #include <ictscommon.h>
       
    27 #include <ictsclientinterface.h>
       
    28 #include <eikmenup.h>
       
    29 #include <brctlinterface.h>
       
    30 #include <wlanmgmtcommon.h>
       
    31 #include <wlanmgmtclient.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CBrCtlInterface;
       
    35 class CHsBrowserSpecialLoadObserver;
       
    36 class CHsBrowserLoadEventObserver;
       
    37 class CHsBrowserIctsObserver;
       
    38 class CHsBrowserHsSrvNotifs;
       
    39 class CHsBrowserModel;
       
    40 class TCoeEvent;
       
    41 class CAknNavigationControlContainer;
       
    42 class CAknNavigationDecorator;
       
    43 class CAknIndicatorContainer;
       
    44 class CAknNaviLabel;       
       
    45 
       
    46 // CONSTANTS
       
    47 const TInt KComponentsNumber = 1;
       
    48 const TInt KBrCtlComponentIndex = 0;
       
    49 
       
    50 // CLASS DECLARATION
       
    51 /**
       
    52 *  CHsBrowserContainer class.
       
    53 *  This is the container control class.
       
    54 */
       
    55 class CHsBrowserContainer : public CCoeControl
       
    56     {
       
    57     public: // Constructors and destructor
       
    58         
       
    59         /**
       
    60         * C++ default constructor.
       
    61         *
       
    62         * @param aModel Pointer to model of HsBrowser.
       
    63         */
       
    64         CHsBrowserContainer( CHsBrowserModel* aModel );
       
    65         
       
    66         /**
       
    67         * EPOC default constructor.
       
    68         *
       
    69         * @param aRect Frame rectangle for container.
       
    70         */
       
    71         void ConstructL( const TRect& aRect );
       
    72 
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         ~CHsBrowserContainer();
       
    77 
       
    78     public:
       
    79             enum TNaviPaneEvent
       
    80             {
       
    81             ELoadingLoginPage,
       
    82             ELoadingUrl,
       
    83             EPageTitleAvailable,
       
    84             ELoadingFinished
       
    85             };
       
    86 
       
    87 
       
    88     public: // new
       
    89 
       
    90         /**
       
    91         * Initializes the indicators in the navi pane.
       
    92         */   
       
    93         void InitNaviPaneL();
       
    94 
       
    95         /**
       
    96         * Updates the indicators in the navi pane.
       
    97         */      
       
    98         void UpdateNaviPane( TNaviPaneEvent aUpdateEvent );
       
    99 
       
   100         /**
       
   101         * Pass a command to the Browser Control
       
   102         *
       
   103         * @param aCommand The command that the Browser Control should process.
       
   104         */
       
   105         void HandleCommandL( TInt aCommand );        
       
   106 
       
   107         /**
       
   108         * Handles key events
       
   109         *
       
   110         * @param aKeyEvent The key event that occurred.
       
   111         * @param aType The window server event type that is being handled
       
   112         * @return TKeyResponse Value indicates whether or not the key event was consumed by the control.
       
   113         *                      The default implementation simply returns EKeyWasNotConsumed.
       
   114         */
       
   115         TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   116         
       
   117         /**
       
   118         * Handle events when when an application switches to, 
       
   119         * or from, the foreground.
       
   120         *
       
   121         * @param aForeground ETrue if the application is in the foreground,
       
   122         * otherwise EFalse.
       
   123         */
       
   124         void ProcessForegroundEvent( TBool aForeground );
       
   125         
       
   126         /**
       
   127         * Send application to foreground.
       
   128         */
       
   129         void SendToForeground();
       
   130         
       
   131         /**
       
   132         * Restore original ordinary position and priority.
       
   133         */
       
   134         void RestorePositionAndPriority();
       
   135 
       
   136         /**
       
   137         * Send application to background.
       
   138         */        
       
   139         void SendToBackground();
       
   140         
       
   141         /**
       
   142         * Update softkeys according to model state. 
       
   143         */
       
   144         void UpdateSoftkeys();
       
   145         
       
   146         /**
       
   147         * Show login complete information note.
       
   148         */
       
   149         void ShowLoginCompleteNote();
       
   150         
       
   151         /**
       
   152         * Show connection closed information note.
       
   153         */
       
   154         void ShowConnClosedNote();
       
   155         
       
   156         /**
       
   157         * Initialize model, attach to connection, and load specified URL.
       
   158         *
       
   159         * @param aUrl URL of authentication web page.
       
   160         * @param aIapId ID of IAP.
       
   161         * @param aNetId Network ID.
       
   162         * @return KErrNone, if successful, otherwice one of system wide errorcodes.
       
   163         */
       
   164         TInt LoadRedirect( const TPtrC& aUrl, TInt aIapId, TInt aNetId );
       
   165         
       
   166         /**
       
   167         * Called when wlan connection is lost.
       
   168         * Shows information note and exits.
       
   169         */
       
   170         void ProcessWlanConnModeNotConnected();
       
   171                 
       
   172         /**
       
   173         * Returns boolean value for application foreground status.
       
   174         *
       
   175         * @return ETrue / EFalse
       
   176         */
       
   177         TBool IsForeground();
       
   178         
       
   179     public: // access
       
   180 
       
   181         /**
       
   182         * Accessor method for iBrCtlInterface
       
   183         *
       
   184         * @return CBrCtlInterface* A pointer to the browser control interface.
       
   185         */
       
   186 		inline CBrCtlInterface* BrCtlInterface();
       
   187 
       
   188         /**
       
   189         * Accessor method for iHsBrowserSpecialLoadObserver.
       
   190         *
       
   191         * @return CHsBrowserSpecialLoadObserver* A pointer to the special load observer.
       
   192         */
       
   193 		inline CHsBrowserSpecialLoadObserver* HsBrowserSpecialLoadObserver();
       
   194         
       
   195         /**
       
   196         * Accessor method for iHsBrowserIctsObserver.
       
   197         *
       
   198         * @return CHsBrowserIctsObserver* A pointer to the Internet connectivity test observer.
       
   199         */
       
   200 		inline CHsBrowserIctsObserver* HsBrowserIctsObserver();
       
   201         
       
   202         /**
       
   203         * Accessor method for iModel.
       
   204         *
       
   205         * @return CHsBrowserModel* A pointer to the model of HsBrowser.
       
   206         */
       
   207         inline CHsBrowserModel* Model();        
       
   208         
       
   209         /**
       
   210         * Accessor method for iNaviLabel.
       
   211         *
       
   212         * @return CAknNaviLabel* A pointer to the label control in the navigation pane.
       
   213         */
       
   214         inline CAknNaviLabel* NaviLabel();
       
   215         
       
   216         /**
       
   217         * Get boolean value if input box is active or not.
       
   218         *
       
   219         * @return ETrue / EFalse
       
   220         */
       
   221         inline TBool ActiveInputBox();
       
   222         
       
   223         /**
       
   224         * Set input box active flag
       
   225         */
       
   226         inline void SetActiveInputBox( TBool aActiveInputBox );
       
   227         
       
   228     private: // From CoeControl
       
   229 
       
   230         /**
       
   231         * From CoeControl,SizeChanged.
       
   232         */
       
   233         void SizeChanged();
       
   234 
       
   235         /**
       
   236         * From CoeControl,CountComponentControls.
       
   237         */
       
   238         TInt CountComponentControls() const;
       
   239 
       
   240         /**
       
   241         * From CCoeControl,ComponentControl.
       
   242         */
       
   243         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   244 
       
   245         /**
       
   246         * From CCoeControl,Handle key events.
       
   247         */
       
   248         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   249                                      TEventCode aType);
       
   250     
       
   251         /**
       
   252         * From CCoeControl,Handle resource change events.
       
   253         */
       
   254         void HandleResourceChange( TInt aType );
       
   255     
       
   256     private: //data 
       
   257     
       
   258         /**
       
   259         * Pointer to the browser control interface.
       
   260         * Owned.
       
   261         */
       
   262         CBrCtlInterface* iBrCtlInterface;
       
   263 
       
   264         /**
       
   265         * Command Base
       
   266         */
       
   267         TInt iCommandBase;
       
   268 
       
   269         /**
       
   270         * Special Load Observer
       
   271         */
       
   272         CHsBrowserSpecialLoadObserver* iHsBrowserSpecialLoadObserver;
       
   273         
       
   274         /**
       
   275         * Load Event Observer
       
   276         */
       
   277         CHsBrowserLoadEventObserver* iHsBrowserLoadEventObserver;
       
   278 
       
   279         /**
       
   280         * Internet connectivity test observer
       
   281         */
       
   282         CHsBrowserIctsObserver* iHsBrowserIctsObserver;
       
   283         
       
   284         /**
       
   285         * Notifications from hotspot server.
       
   286         */
       
   287         CHsBrowserHsSrvNotifs* iHsBrowserHsSrvNotifs;
       
   288         
       
   289         /**
       
   290         * Model of HsBrowser
       
   291         */
       
   292         CHsBrowserModel* iModel;
       
   293         
       
   294         /**
       
   295         * Pointer to default control in the status pane's navigation pane.
       
   296         * Not owned.
       
   297         */
       
   298         CAknNavigationControlContainer* iNaviPane;
       
   299         
       
   300         /**
       
   301         * Pointer to the editor indicator control in the navigation pane.
       
   302         * Owned.
       
   303         */
       
   304         CAknNavigationDecorator* iEditorIndicatorContainer;
       
   305                 
       
   306         /**
       
   307         * Pointer to the editor indicator control in the navigation pane
       
   308         * Not owned.
       
   309         */
       
   310         CAknIndicatorContainer* iIndiContainer;
       
   311         
       
   312        /**
       
   313         * Resource.
       
   314         */
       
   315         TInt iResource; 
       
   316         
       
   317         /**
       
   318         * Flag for softkey press.
       
   319         */
       
   320         TBool iActiveInputBox;
       
   321         
       
   322         /**
       
   323         * handle to WlanMgmtClient
       
   324         */
       
   325      	CWlanMgmtClient *iMgtClient;
       
   326     };
       
   327 
       
   328 #include "hsbrowsercontainer.inl"
       
   329 
       
   330 #endif
       
   331 
       
   332 // End of File
       
   333