harvester/server/inc/harvesteroomao.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:  Low memory observer for havester server
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __HARVESTEROOMAO_H__
       
    19 #define __HARVESTEROOMAO_H__
       
    20 
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <e32msgqueue.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  * MHarvesterPluginObserver
       
    31  */
       
    32 class MHarvesterOomObserver
       
    33 	{
       
    34     public:
       
    35     	virtual void MemoryLow() = 0;
       
    36     	virtual void MemoryGood() = 0;
       
    37 	};
       
    38 
       
    39 /**
       
    40 *  CMdSOomPlugin
       
    41 * 
       
    42 */
       
    43 class CHarvesterOomAO : public CActive
       
    44 	{
       
    45 public:
       
    46 	// Constructors and destructor
       
    47 	static CHarvesterOomAO* NewL( MHarvesterOomObserver& aObserver );
       
    48 	
       
    49 	/**
       
    50 	 * Destructor.
       
    51 	 */
       
    52 	virtual ~CHarvesterOomAO();	
       
    53 	
       
    54     /**
       
    55      * Standard RunL-method.
       
    56      * From CActive.
       
    57      */       
       
    58     void RunL();
       
    59 
       
    60     /**
       
    61      * From CActive.
       
    62      */       
       
    63     void DoCancel();
       
    64 
       
    65     /**
       
    66      * From CActive.
       
    67      * @param aError  Leave error code.
       
    68      * @return Always KErrNone.
       
    69      */       
       
    70     TInt RunError( TInt aError );
       
    71 
       
    72 
       
    73 private:
       
    74 
       
    75 	/**
       
    76 	 * Constructor for performing 1st stage construction
       
    77 	 */
       
    78 	CHarvesterOomAO( MHarvesterOomObserver& aObserver );
       
    79 	
       
    80 	/**
       
    81 	 * default constructor for performing 2nd stage construction
       
    82 	 */
       
    83 	void ConstructL();
       
    84 
       
    85     
       
    86 private:
       
    87 	
       
    88 	RMsgQueue<TInt> iOomMsgQueue;
       
    89 	MHarvesterOomObserver* iObserver;
       
    90 	
       
    91 	};
       
    92 
       
    93 
       
    94 #endif /*__HARVESTEROOMAO_H__*/