idlefw/plugins/devicestatus/inc/ainwspublisher.h
changeset 0 79c6a41cd166
child 8 d0529222e3f0
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Network status publisher
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AINWSPUBLISHER_H
       
    20 #define C_AINWSPUBLISHER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "aidevicestatuspublisher.h"
       
    25 #include "aidevicestatuscontentmodel.h"
       
    26 #include "ainetworkinfoobserver.h"
       
    27 
       
    28 
       
    29 class MAiDeviceStatusContentObserver;
       
    30 class MAiPropertyExtension;
       
    31 class CAiNetworkInfoListener;
       
    32 class CRepository;
       
    33 
       
    34 /**
       
    35  *  @ingroup group_devicestatusplugin
       
    36  *
       
    37  *  Listens Network status and publishes data if network selection dialog is needed.
       
    38  *
       
    39  *  @since S60 3.2
       
    40  */
       
    41 class CAiNwsPublisher : public CBase, public MAiDeviceStatusPublisher,
       
    42                                 public MAiNetworkInfoObserver
       
    43     {
       
    44 public:
       
    45 
       
    46     static CAiNwsPublisher* NewL();
       
    47 
       
    48     virtual ~CAiNwsPublisher();
       
    49 
       
    50 // from base class MAiDeviceStatusPublisher
       
    51 
       
    52     void ResumeL();
       
    53 
       
    54     void Subscribe( MAiContentObserver& aObserver,
       
    55                     MAiPropertyExtension& aExtension,
       
    56                     MAiPublishPrioritizer& aPrioritizer,
       
    57                     MAiPublisherBroadcaster& aBroadcaster );
       
    58 
       
    59     void RefreshL( TBool aClean );
       
    60 
       
    61     TBool RefreshL( TInt aContentId, TBool aClean );
       
    62 
       
    63 protected:
       
    64 
       
    65 //from base class MAiNetworkInfoObserver
       
    66 
       
    67     void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage,
       
    68     							  const TNWInfo& aInfo,
       
    69     							  const TBool aShowOpInd );
       
    70 
       
    71 private:
       
    72 
       
    73 
       
    74     CAiNwsPublisher();
       
    75 
       
    76     void ConstructL();
       
    77 
       
    78     void HandleStateChange( const TNWInfo& aInfo );
       
    79 
       
    80     void HandleNetworkFound();
       
    81 
       
    82     void HandleNetworkLost( const TNWNetworkSelectionSetting &aSelectionSetting  );
       
    83 
       
    84 
       
    85     /**
       
    86      * Tests if offline mode is engaged.
       
    87      *
       
    88      * @return ETrue if offline mode is currently active
       
    89      */
       
    90     TBool IsOffLineMode() const;
       
    91 
       
    92     /**
       
    93      * Tests if Bluetooth SAP is in connected mode.
       
    94      *
       
    95      * @return ETrue if Bluetooth SAP is active.
       
    96      */
       
    97     TBool IsBluetoothSAPConnected() const;
       
    98 
       
    99 private: // data
       
   100 
       
   101     /**
       
   102      * Content observer.
       
   103      * Not own.
       
   104      */
       
   105     MAiContentObserver* iContentObserver;
       
   106 
       
   107     /**
       
   108      * Property extension.
       
   109      * Not own.
       
   110      */
       
   111     MAiPropertyExtension* iExtension;
       
   112 
       
   113     /**
       
   114      * Network info listener.
       
   115      * Own.
       
   116      */
       
   117     CAiNetworkInfoListener* iListener;
       
   118 
       
   119     /**
       
   120      * Profile API.
       
   121      */
       
   122     CRepository* iProfileApi;
       
   123 
       
   124 
       
   125     /**
       
   126      * A true value if registered to network.
       
   127      */
       
   128     TBool iRegistered;
       
   129 
       
   130     };
       
   131 
       
   132 
       
   133 #endif // C_AINWSPUBLISHER_H