dosservices/dosserver/inc/SaeSignalStrengthObserver.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Observes and updates to PS the network signal strength.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSAESIGNALSTRENGTHOBSERVER_H
       
    21 #define CSAESIGNALSTRENGTHOBSERVER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <etelmm.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 // CLASS DECLARATION
       
    37 class CSaePubSubNotifier;
       
    38 
       
    39 /**
       
    40 *  Observes signal strengths from ETel
       
    41 */
       
    42 NONSHARABLE_CLASS( CSaeSignalStrengthObserver ) : public CActive
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49         static CSaeSignalStrengthObserver* NewL( CSaePubSubNotifier* aNotifier );
       
    50         
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CSaeSignalStrengthObserver();
       
    55 
       
    56     public: // New functions
       
    57         
       
    58         /**
       
    59         * Start listening to signal strength changes. 
       
    60         * Update current status with synchronous getter operation and request
       
    61         * notifications about state changes.
       
    62         * @return void
       
    63         */
       
    64         void Receive();
       
    65 
       
    66     protected:  // Functions from base classes
       
    67         
       
    68          /**
       
    69         * From CActive Cancels the asyncronous request
       
    70         * @since 
       
    71         * @return void
       
    72         */
       
    73         void DoCancel();
       
    74 
       
    75         /**
       
    76         * From CActive Handles the the event that has arrived from ETel.
       
    77         * @since 
       
    78         * @return void
       
    79         */
       
    80         void RunL();
       
    81 
       
    82         
       
    83     private:
       
    84 
       
    85         /**
       
    86         * C++ default constructor.
       
    87         */
       
    88         CSaeSignalStrengthObserver( CSaePubSubNotifier* aNotifier );
       
    89 
       
    90         /**
       
    91         * By default Symbian 2nd phase constructor is private.
       
    92         */
       
    93         void ConstructL();
       
    94         
       
    95         /**
       
    96         * Issue notification request to RMobilePhone.
       
    97         */
       
    98         void IssueRequest();
       
    99 
       
   100     public:     // Data
       
   101     
       
   102     protected:  // Data
       
   103 
       
   104     private:    // Data
       
   105     
       
   106         // Session with Etel server
       
   107         RTelServer iEtelServer;
       
   108 
       
   109         // RMobilePhone for requesting the signal strength state
       
   110         RMobilePhone iMobilePhone;
       
   111         
       
   112         // Notifier to PubSub
       
   113         CSaePubSubNotifier* iNotifier;
       
   114         
       
   115         // The signal strength in dBm
       
   116         TInt32 iSignalStrength;
       
   117         
       
   118         // The number of signal strength bars
       
   119         TInt8 iBar;
       
   120         
       
   121         // The number of last notification signal strength bars
       
   122         TInt8 iPreviousBar;
       
   123     };
       
   124 
       
   125 #endif      // CSAESIGNALSTRENGTHOBSERVER_H   
       
   126             
       
   127 // End of File