cbs/CbsServer/ServerInc/CCbsBackupMonitor.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     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:  This file contains the header file of the CCbsBackupMonitor class
       
    15 *    
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef     CCBSBACKUPMONITOR_H
       
    21 #define     CCBSBACKUPMONITOR_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32property.h>
       
    26 #include "CCbsDbImp.H"
       
    27 
       
    28 //  CLASS DECLARATION 
       
    29 
       
    30 /**
       
    31 *  The CCbsBackupMonitor instance listens to 
       
    32 *  shutdown signal via Publish and Subscribe. On device shutdown,
       
    33 *  the listener stops server operation by stopping the active scheduler.
       
    34 *  CbsServer will then be terminated. 
       
    35 */
       
    36 class CCbsBackupMonitor : public CActive
       
    37     {
       
    38     public:     // New functions
       
    39 
       
    40         /**
       
    41         *   Creates an instance of the class.
       
    42         *
       
    43         *   @param  aServer     Server reference
       
    44         *   @return             A new instance of CCbsBackupMonitor
       
    45         */
       
    46         static CCbsBackupMonitor* NewL( CCbsDbImp& aDbImp );
       
    47 
       
    48         /**
       
    49         *   Destructor.
       
    50         */
       
    51         ~CCbsBackupMonitor();
       
    52 
       
    53         /** 
       
    54         *   Reissues the Subscribe request.
       
    55         */
       
    56         void IssueRequest();
       
    57 
       
    58     private:    // From CActive
       
    59 
       
    60         /**
       
    61         *   Gets called when the system state changes.
       
    62         */
       
    63         void RunL();
       
    64 
       
    65         /**
       
    66         *   Cancels an outstanding Subscribe request.
       
    67         */
       
    68         void DoCancel();
       
    69 
       
    70     private:
       
    71 
       
    72         /**
       
    73         *   The constructor.
       
    74         *
       
    75         */
       
    76         CCbsBackupMonitor( CCbsDbImp& aDbImp );
       
    77 
       
    78         /**
       
    79         *   Finalizes the construction.
       
    80         */
       
    81         void ConstructL();
       
    82       
       
    83     private:    // Data
       
    84         
       
    85         // PubSub connection
       
    86         RProperty iProperty;
       
    87         
       
    88         // DB reference
       
    89         CCbsDbImp& iDbImp;
       
    90     };
       
    91 
       
    92 #endif      //  CCBSBACKUPMONITOR_H   
       
    93             
       
    94 // End of File
       
    95 
       
    96