satengine/SatServer/SatClient/inc/CSatAllowRefreshMonitor.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  Waits for the refresj query notification
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSATALLOWREFRESHMONITOR_H
       
    21 #define CSATALLOWREFRESHMONITOR_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <msatrefreshobserver.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class RSatRefresh;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  Active object to wait the refresh query notification.
       
    34 *
       
    35 *  @lib SatClient.lib
       
    36 *  @since 2.6
       
    37 */
       
    38 class CSatAllowRefreshMonitor : public CActive
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param aObserver Observer for refresh query.
       
    45         * @param aRefresh Refresh sub-session.
       
    46         */
       
    47         static CSatAllowRefreshMonitor* NewL(
       
    48             MSatRefreshObserver& aObserver,
       
    49             RSatRefresh& aRefresh );
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CSatAllowRefreshMonitor();
       
    55 
       
    56     public: // New functions
       
    57 
       
    58         /**
       
    59         * Set files to be observed.
       
    60         * @since 3.0
       
    61         * @param aObservedFiles List of files to be observed for refresh.
       
    62         */
       
    63         void ObserveFiles( const TSatRefreshFiles& aObservedFiles );
       
    64 
       
    65         /**
       
    66         * Starts waiting for the refresh query.
       
    67         */
       
    68         void Start();
       
    69 
       
    70     protected:  // Functions from base classes
       
    71 
       
    72         /**
       
    73         * From CActive
       
    74         */
       
    75         void RunL();
       
    76 
       
    77         /**
       
    78         * From CActive
       
    79         * @param aStatus Request status.
       
    80         */
       
    81         TInt RunError( TInt aError );
       
    82 
       
    83         /**
       
    84         * From CActive
       
    85         */
       
    86         void DoCancel();
       
    87 
       
    88     private:
       
    89 
       
    90         /**
       
    91         * C++ default constructor.
       
    92         */
       
    93         CSatAllowRefreshMonitor(
       
    94             MSatRefreshObserver& aObserver,
       
    95             RSatRefresh& aRefresh );
       
    96 
       
    97     private:
       
    98 
       
    99         // Notified when query comes.
       
   100         MSatRefreshObserver& iObserver;
       
   101 
       
   102         // Refresh sub-sesion.
       
   103         RSatRefresh& iRefresh;
       
   104 
       
   105         // Changing files
       
   106         TSatRefreshFiles iChangingFiles;
       
   107 
       
   108         // Package of chaning files.
       
   109         TPckg<TSatRefreshFiles> iChangingFilesPckg;
       
   110 
       
   111         // Observed files
       
   112         TSatRefreshFiles iObservedFiles;
       
   113 
       
   114         // Refresh type.
       
   115         TSatRefreshType iType;
       
   116 
       
   117         // Refresh type package.
       
   118         TPckg<TSatRefreshType> iTypePckg;
       
   119 
       
   120     };
       
   121 
       
   122 #endif      // CSATALLOWREFRESHMONITOR_H
       
   123 
       
   124 // End of File