harvester/server/inc/harvestershutdownobserver.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2009 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HARVESTERSHUTDOWNOBSERVER_H
       
    19 #define HARVESTERSHUTDOWNOBSERVER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <w32std.h>
       
    23 #include <e32property.h> 
       
    24 
       
    25 
       
    26 /**
       
    27  * Observer interface for signaling the need for shutdown
       
    28  */
       
    29 class MHarvesterShutdownObserver
       
    30     {
       
    31 public:
       
    32 
       
    33     virtual void ShutdownNotification() = 0;
       
    34     
       
    35     virtual void RestartNotification() = 0;
       
    36     };
       
    37 
       
    38 /**
       
    39  *  Active object for observing P&S keys
       
    40  *
       
    41  *  @since S60 v5.0
       
    42  */
       
    43 class CHarvesterShutdownObserver  : public CActive
       
    44     {
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      *
       
    50      * @since S60 v5.0
       
    51      * @return Instance of CTMShutdownObserver.
       
    52      */
       
    53     IMPORT_C static CHarvesterShutdownObserver* NewL( MHarvesterShutdownObserver& aObserver/*, const TUid& aKeyCategory*/ );
       
    54 
       
    55     /**
       
    56      * Destructor
       
    57      *
       
    58      * @since S60 v5.0
       
    59      */
       
    60     virtual ~CHarvesterShutdownObserver();
       
    61 
       
    62 public:
       
    63 
       
    64 	/**
       
    65 	* Returns IAD update status
       
    66 	*/
       
    67 	TBool UpdateInProgress();
       
    68     
       
    69 protected:
       
    70 
       
    71     /**
       
    72      * Handles an active object's request completion event.
       
    73      *
       
    74      * @since S60 v5.0
       
    75      */
       
    76     void RunL();
       
    77 
       
    78     /**
       
    79      * Implements cancellation of an outstanding request.
       
    80      *
       
    81      * @since S60 v5.0
       
    82      */
       
    83     void DoCancel();
       
    84     
       
    85     TInt RunError( TInt aError );
       
    86 
       
    87 private:
       
    88 
       
    89     /**
       
    90      * C++ default constructor
       
    91      *
       
    92      * @since S60 v5.0
       
    93      * @return Instance of CShutdownObserver.
       
    94      */
       
    95     CHarvesterShutdownObserver( MHarvesterShutdownObserver& aObserver/*, const TUid& aKeyCategory*/ );
       
    96 
       
    97     /**
       
    98      * Symbian 2nd phase constructor can leave.
       
    99      *
       
   100      * @since S60 v5.0
       
   101      */
       
   102     void ConstructL();
       
   103 
       
   104 private:
       
   105     
       
   106     // not own
       
   107     MHarvesterShutdownObserver& iObserver;
       
   108     
       
   109     RProperty iProperty;
       
   110 	TInt iValue;
       
   111 };
       
   112 
       
   113 #endif // SHUTDOWNOBSERVER_H