idlefw/plugins/devicestatus/inc/aioperatornamepublisher.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:  Operator/Service provider name publisher.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIOPERATORPROVIDERNAMEPUBLISHER_H
       
    20 #define C_AIOPERATORPROVIDERNAMEPUBLISHER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <AknUtils.h>
       
    25 #include "aidevicestatuspublisher.h"
       
    26 #include "ainetworkinfoobserver.h"
       
    27 
       
    28 class CAiNetworkInfoListener;
       
    29 class MAiDeviceStatusContentObserver;
       
    30 class MAiPropertyExtension;
       
    31 
       
    32 /**
       
    33  *  @ingroup group_devicestatusplugin
       
    34  *
       
    35  *  Operator/Service provider name publisher.
       
    36  *
       
    37  *  Listens network info changes and publishes operator name
       
    38  *  if it is received.
       
    39  *
       
    40  *  @since S60 3.2
       
    41  */
       
    42 class CAiOperatorNamePublisher : public CBase, public MAiDeviceStatusPublisher,
       
    43                                public MAiNetworkInfoObserver
       
    44     {
       
    45 public:
       
    46 
       
    47     static CAiOperatorNamePublisher* NewL();
       
    48 
       
    49     virtual ~CAiOperatorNamePublisher();
       
    50 
       
    51 //from base class MAiDeviceStatusPublisher
       
    52 
       
    53     void ResumeL();
       
    54     void Subscribe( MAiContentObserver& aObserver, 
       
    55                     MAiPropertyExtension& aExtension,
       
    56                     MAiPublishPrioritizer& aPrioritizer,
       
    57                     MAiPublisherBroadcaster& aBroadcaster );
       
    58     void RefreshL( TBool aClean );
       
    59     TBool RefreshL( TInt aContentId, TBool aClean );
       
    60     TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority );
       
    61 
       
    62 
       
    63 protected:
       
    64 
       
    65 //from base class MAiNetworkInfoObserver
       
    66 
       
    67     /**
       
    68      * From MAiNetworkInfoObserver.
       
    69      * Called when network info changes.
       
    70      */
       
    71     void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, 
       
    72     							  const TNWInfo& aInfo, 
       
    73     							  const TBool aShowOpInd );
       
    74 
       
    75 
       
    76 private:
       
    77 
       
    78     CAiOperatorNamePublisher();
       
    79 
       
    80     void ConstructL();
       
    81 
       
    82     /**
       
    83      * Check SPN status from PLMNField. Also check if current country and network
       
    84      * codes are in PLMNField.
       
    85      */
       
    86     void CAiOperatorNamePublisher::CheckServiceProviderDisplayListStatus(
       
    87         TInt aMCC,
       
    88         TInt aMNC,
       
    89         TBool& aShowSPN,
       
    90         TBool& aIsInSPDI ) const;
       
    91 
       
    92     /**
       
    93      * Check if current network is ready. Returns ETrue if all needed messages are
       
    94      * received from network info listener.
       
    95      */
       
    96     TBool CurrentNetworkOk() const;
       
    97 
       
    98     /**
       
    99      * Returns ETrue if phone is currently roaming.
       
   100      */
       
   101     TBool IsRoaming() const;
       
   102 
       
   103     /**
       
   104      * If operator indicator needs to be animated, start delayed clean operation.
       
   105      * Operator indicator will be replaced by plmn indicator after clean operation.
       
   106      */
       
   107     void StartDelayedPLMNOperation();
       
   108 
       
   109     /**
       
   110      * Called by CPeriodic when timer expires.
       
   111      */
       
   112     static TInt CleanAndShowPLMNOperationCallback( TAny* aPtr );
       
   113 
       
   114     /**
       
   115      * Do delayed clean operation.
       
   116      */
       
   117     void DoCleanOperationL();
       
   118     
       
   119     /**
       
   120      * Show network indicator
       
   121      * @param aTryToPublish 
       
   122      * ETrue: Sets operator name, priority and tries to publish operator name. 
       
   123      * EFalse: Sets operator name, priority and not to try to publish it.
       
   124      */
       
   125     void ShowNetworkIdentityNameL( TBool aTryToPublish );
       
   126     
       
   127     /**
       
   128      * Check priority of operator name
       
   129      */	
       
   130     TBool OperatorNamePriority( TInt& aPriority );
       
   131     
       
   132     /**
       
   133      * Construct PLMN and SPN indicators to same string
       
   134      */
       
   135     HBufC* ConstructOperatorNameStringL( const TDesC& aServiceProviderName );
       
   136     
       
   137     /**
       
   138      * Check status of keylock
       
   139      */
       
   140     TBool IsKeyLockEnabled();
       
   141 
       
   142 private: // data
       
   143 
       
   144     /**
       
   145      * Network info listener.
       
   146      * Own.
       
   147      */
       
   148     CAiNetworkInfoListener* iListener;
       
   149 
       
   150     /**
       
   151      * Property extension.
       
   152      * Not own.
       
   153      */
       
   154     MAiPropertyExtension* iExtension;
       
   155 
       
   156 	/**
       
   157 	 * Content prioritizer.
       
   158 	 * Not own.
       
   159 	 */
       
   160 	MAiPublishPrioritizer* iPrioritizer;
       
   161     
       
   162 	/**
       
   163 	 * Publish broadcaster.
       
   164 	 * Not own.
       
   165 	 */
       
   166 	MAiPublisherBroadcaster* iBroadcaster;
       
   167     
       
   168     /**
       
   169      * Used to do delayed clean operation.
       
   170      * Own.
       
   171      */
       
   172     CPeriodic* iPeriodic;
       
   173     
       
   174     /**
       
   175      * True if publish was successful.
       
   176      */
       
   177     TBool iSuccess;
       
   178     
       
   179     /**
       
   180      * Operator name priority
       
   181      */
       
   182     TInt iPriority;
       
   183     
       
   184     /**
       
   185      * Show operator indicator.
       
   186      */
       
   187     TBool iShowOpInd;
       
   188     
       
   189     /**
       
   190      * Network identity name
       
   191      */
       
   192     TPtrC iNetworkIdentityName;
       
   193     };
       
   194 
       
   195 
       
   196 #endif // C_AIOPERATORPROVIDERNAMEPUBLISHER_H