photosgallery/viewframework/uiutilities/inc/glxrequestfreegoom.h
author Simon Howkins <simonh@symbian.org>
Mon, 29 Nov 2010 11:47:03 +0000
branchRCL_3
changeset 78 dbcb928abe9c
parent 60 5b3385a43d68
permissions -rw-r--r--
Adjusted to avoid exports, etc, from a top-level bld.inf

/*
 * Copyright (c) 2008-2009 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:    Request Goom to free memroy in asynch way
 *
 */

#ifndef GLXREQUESTFREEGOOM_H_
#define GLXREQUESTFREEGOOM_H_

#include <goommonitorsession.h>

//observer class to notify events
class MGoomNotifierObserver
    {
public:
    virtual void HandleGoomMemoryReleased(TInt aStatus) = 0;
    };

/**
 * class declaration
 */
class CGlxRelaseGPUMemory : public CActive
    {
public:
    /**
     * Two-phased constructor.
     */
    IMPORT_C
    static CGlxRelaseGPUMemory* NewL(MGoomNotifierObserver& aNotify);

    /**
     * Two-phased constructor.
     */
    static CGlxRelaseGPUMemory* NewLC(MGoomNotifierObserver& aNotify);
    /**
     * Destructor
     */
    ~CGlxRelaseGPUMemory();
    /*
     * Start Memory release process
     */
    IMPORT_C void RequestMemory(TBool aRequest = ETrue);
private:
    /**
     * Default constructor
     */
    CGlxRelaseGPUMemory(MGoomNotifierObserver& aNotify);
    /**
     * By default Symbian 2nd phase constructor is private.
     */
    void ConstructL();

private:
    /**
     * active object's default implelemtaions
     */
    void RunL();
    void DoCancel();

    /**
     * IssueRequest 
     */
    void IssueRequest();

private:
    /**
     * reference of observer
     */
    MGoomNotifierObserver& iNotify;
    RGOomMonitorSession iGoom;
    TBool iIsFirstRequest;
    TBool iNotifyCaller;
#ifdef _DEBUG
    TTime iStartTime;
    TTime iStopTime;
#endif

    };

#endif /* GLXREQUESTFREEGOOM_H_ */