presetserver/serverinc/psshutdown.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:07:46 +0300
changeset 17 38bbf2dcd608
parent 0 09774dfdd46b
permissions -rw-r--r--
Revision: 201037 Kit: 201039

/*
* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Shutdown timer for the preset server
*
*/


#ifndef C_CPSSHUTDOWN_H
#define C_CPSSHUTDOWN_H

#include <e32base.h>

/**
 * Shutdown timer for the preset server.
 * 
 * Closes the server when it has been unused for a set period of time.
 */
NONSHARABLE_CLASS( CPSShutdown ) : public CTimer
    {

public:

    /**
     * Two-phased constructor.
     *
     * @return  The newly created object.
     */
    static CPSShutdown* NewL();
    
    /**
     * Destructor.
     */    
    ~CPSShutdown();
    
    /**
     * Starts the shutdown timer.
     * @param   aDelay  The delay after PresetServer is shut down.
     */    
    void Start( TTimeIntervalMicroSeconds32 aDelay );


// from base class CActive

    /**
     * @see CActive::RunL()
     */
    void RunL();

    /**
     * @see CActive::DoCancel()
     */
    void DoCancel();

private:

    /**
     * Constructor.
     */    
    CPSShutdown();
    
    /**
     * Second-phase constructor.
     */    
    void ConstructL();

    };

#endif // C_CPSSHUTDOWN_H