wvuing/IMPSServiceSettingsUI/SharedDataSrc/CIMPSSystemNotifierSystemAgent.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  System Agent keys change observer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIMPSSYSTEMNOTFIERSYSTEMAGENT_H
       
    21 #define CIMPSSYSTEMNOTFIERSYSTEMAGENT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>        // CActive
       
    25 #include <saclient.h>       // RSystemAgent
       
    26 
       
    27 #include "MIMPSSystemNotifier.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MIMPSSystemNotifierObserver;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Implementation of the System Agent change observer
       
    36 *
       
    37 *  @since 2.6
       
    38 */
       
    39 NONSHARABLE_CLASS( CIMPSSystemNotifierSystemAgent ) : public CActive,
       
    40         public MIMPSSystemNotifier
       
    41     {
       
    42 public:  // Constructors and destructor
       
    43 
       
    44     /**
       
    45     * Two-phased constructor.
       
    46     * @param aObserver Observer to be informed when observed system key changes
       
    47     */
       
    48     static CIMPSSystemNotifierSystemAgent* NewL( MIMPSSystemNotifierObserver& aObserver,
       
    49     const TUid aKey );
       
    50 
       
    51     /**
       
    52     * Destructor.
       
    53     */
       
    54     virtual ~CIMPSSystemNotifierSystemAgent();
       
    55 
       
    56 protected:     // from MIMPSSystemNotifier
       
    57 
       
    58     /**
       
    59     * @see MIMPSSystemNotifier
       
    60     */
       
    61     TInt Subscribe();
       
    62 
       
    63     /**
       
    64     * @see MIMPSSystemNotifier
       
    65     */
       
    66     void UnSubscribe();
       
    67 
       
    68     /**
       
    69     * @see MIMPSSystemNotifier
       
    70     */
       
    71     TInt GetIntKey( TInt& aValue );
       
    72 
       
    73 protected:  // Functions from base classes
       
    74 
       
    75     /**
       
    76     * From CActive
       
    77     */
       
    78     void RunL();
       
    79 
       
    80     /**
       
    81     * From CActive
       
    82     */
       
    83     void DoCancel();
       
    84 
       
    85 private:
       
    86 
       
    87     /**
       
    88     * C++ default constructor.
       
    89     */
       
    90     CIMPSSystemNotifierSystemAgent( MIMPSSystemNotifierObserver& aObserver,
       
    91                                     const TUid aKey );
       
    92 
       
    93     /**
       
    94     * Symbian 2nd phase constructor..
       
    95     */
       
    96     void ConstructL();
       
    97 
       
    98 private:    // Data
       
    99 
       
   100     // Owns: System Agent
       
   101     RSystemAgent iSysAgent;
       
   102 
       
   103     // Call event stored here
       
   104     TSysAgentEvent iAgentEvent;
       
   105 
       
   106     // Observer to be informed when value of system key changes
       
   107     MIMPSSystemNotifierObserver& iObserver;
       
   108 
       
   109     // the key this observer is attached
       
   110     TUid iKey;
       
   111 
       
   112     };
       
   113 
       
   114 #endif      // CIMPSSYSTEMNOTFIERSYSTEMAGENT_H
       
   115 
       
   116 // End of File