idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
child 30 b8fae6b8a148
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
     1 /*
     1 /*
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <NWHandlingEngine.h>
    22 #include <NWHandlingEngine.h>
    23 #include <MProfileChangeObserver.h>
    23 #include <MProfileChangeObserver.h>
    24 #include <babitflags.h>
    24 #include <babitflags.h>
       
    25 #include <cmgenconnsettings.h>
       
    26 #include "cenrepobserver.h"
    25 
    27 
    26 // Forward declrations
    28 // Forward declrations
    27 class CNWSession;
    29 class CNWSession;
    28 class CProfileChangeNotifyHandler;
    30 class CProfileChangeNotifyHandler;
    29 class CXnNodeAppIf;
    31 class CXnNodeAppIf;
       
    32 class CAknGlobalConfirmationQuery;
    30 
    33 
    31 namespace AiXmlUiController
    34 namespace AiXmlUiController
    32 {
    35 {
    33 // Forward declrations
    36 // Forward declrations
    34 class CXmlUiController;
    37 class CXmlUiController;
    35 
    38 class CGlobalQueryHandler;
    36 // Classe declaration
    39 // Classe declaration
    37 
    40 
    38 
    41 
    39 /**
    42 /**
    40  * Online/offline state helper
    43  * Online/offline state helper
    43  * @lib ai3xmluimain.lib
    46  * @lib ai3xmluimain.lib
    44  * @since S60 5.0
    47  * @since S60 5.0
    45  */
    48  */
    46 
    49 
    47 class COnlineOfflineHelper : public CBase, 
    50 class COnlineOfflineHelper : public CBase, 
    48     public MNWMessageObserver, public MProfileChangeObserver
    51     public MNWMessageObserver, public MProfileChangeObserver, public MCenRepObserver
    49     {    
    52     {    
    50 public:
    53 public:
    51     // Constructors
    54     // Constructors
    52 
    55 
    53     /**
    56     /**
    69     /**
    72     /**
    70      *  2nd phase constructor
    73      *  2nd phase constructor
    71      */
    74      */
    72     void ConstructL();    
    75     void ConstructL();    
    73 
    76 
       
    77 public : 
       
    78     // from MCenRepObserver
       
    79 
       
    80     /**
       
    81     * This method is called every time when Central Repository key 
       
    82     * KCRUidCmManager/ KCurrentCellularDataUsage changes.
       
    83     *
       
    84     * @param aValue The new value for KCurrentCellularDataUsage.
       
    85     * 
       
    86     */
       
    87     void CurrentCellularDataUsageChangedL( const TInt aValue );
       
    88     
    74 public:
    89 public:
    75     // New functions
    90     // New functions
    76     
    91     
    77     /*
    92     /*
    78      * Determines if online menuitem can be shown
    93      * Determines if online menuitem can be shown
    89      * @return ETrue if item can be shown, EFalse otherwise
   104      * @return ETrue if item can be shown, EFalse otherwise
    90      */    
   105      */    
    91     TBool ShowOfflineItem() const;
   106     TBool ShowOfflineItem() const;
    92     
   107     
    93     /*
   108     /*
    94      * Check and set whether online/offline state is needed by plugins
       
    95      * 
       
    96      * @since S60 5.0
       
    97      * @param aList List of plugins 
       
    98      */
       
    99     void ProcessOnlineStateL( RPointerArray< CXnNodeAppIf >& aList );
       
   100 
       
   101     /*
       
   102      * Set online or offline state based on user selection
   109      * Set online or offline state based on user selection
   103      * 
   110      * 
   104      * @since S60 5.0
   111      * @since S60 5.0
   105      * @param aOnline ETrue to set online, EFalse to offline 
   112      * @param aOnline ETrue to set online, EFalse to offline 
   106      */    
   113      */    
   107     void ProcessOnlineStateL( TBool aOnline );
   114     void ProcessOnlineStateL( TBool aOnline );
   108     
   115     
       
   116     /*
       
   117      * Handles the connection query dialogs
       
   118      * 
       
   119      * @since S60 5.0
       
   120      * @param aConnection connection disconnected or connected 
       
   121      */ 
       
   122     void HandleConnectionQueryL( const TDesC& aConnection);
       
   123     
       
   124     /**
       
   125      * Displayes global query for 'go online' or 'go offline' confirmations
       
   126      * @param aResourceId resource id for the text string
       
   127      * @param aSetOnline if ETrue then set widgets online if confirmation accepted,
       
   128      *     if EFalse then set widgets offline if confirmation accepted 
       
   129      */
       
   130     void ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline );
       
   131 
   109 private:    
   132 private:    
   110     // from MNWMessageObserver
   133     // from MNWMessageObserver
   111 
   134 
   112     /**
   135     /**
   113      * From MNWMessageObserver.
   136      * From MNWMessageObserver.
   144     // New functions
   167     // New functions
   145     
   168     
   146     TBool HasNetworkInfoChanged( const TNWMessages aMsg );
   169     TBool HasNetworkInfoChanged( const TNWMessages aMsg );
   147     void InterpretNWMessageL( const TNWMessages aMessage, const TNWInfo );
   170     void InterpretNWMessageL( const TNWMessages aMessage, const TNWInfo );
   148     
   171     
   149     void SetOnlineL( TBool aOnline );
   172     void SetOnline( TBool aOnline );
       
   173     
       
   174     void CurrentNetworkSetting();
       
   175     
   150 private:
   176 private:
   151     // Data types
   177     // Data types
   152     
   178     
   153     /**
   179     /**
   154      * Network related message flags
   180      * Network related message flags
   220 
   246 
   221    /**
   247    /**
   222     * Flags
   248     * Flags
   223     */
   249     */
   224    TBitFlags32 iFlags;
   250    TBitFlags32 iFlags;
       
   251    
       
   252    /**
       
   253     * Network setting observer, owned
       
   254     */
       
   255    CCenRepObserver *iNwSettingObserver;
       
   256   
       
   257    /**
       
   258     * Home network setting
       
   259     */
       
   260    TInt iHomeNetwork;
       
   261    
       
   262    /**
       
   263      * Roaming network setting
       
   264      */
       
   265    TInt iRoamingNetwork;
       
   266    
       
   267    /**
       
   268     * Global query handler, owned.
       
   269     */
       
   270    CGlobalQueryHandler* iGlobalQueryHandler;
       
   271    
       
   272    /**
       
   273     * Global confirmation query, owned.
       
   274     */
       
   275    CAknGlobalConfirmationQuery* iGlobalConfirmationQuery;
       
   276 
   225    };
   277    };
   226 
   278 
   227 }// namespace AiXmlUiController
   279 }// namespace AiXmlUiController
   228 #endif //ONLINEOFFLINEHELPER_H
   280 #endif //ONLINEOFFLINEHELPER_H
   229 
   281 
   230 
       
   231 
       
   232 
       
   233