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