photosgallery/viewframework/uiutilities/inc/glxrequestfreegoom.h
branchRCL_3
changeset 47 f9e827349359
child 57 ea65f74e6de4
equal deleted inserted replaced
35:420f6808bf21 47:f9e827349359
       
     1 /*
       
     2  * Copyright (c) 2008-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:    Request Goom to free memroy in asynch way
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef GLXREQUESTFREEGOOM_H_
       
    19 #define GLXREQUESTFREEGOOM_H_
       
    20 
       
    21 #include <goommonitorsession.h>
       
    22 
       
    23 //observer class to notify events
       
    24 class MGoomNotifierObserver
       
    25     {
       
    26 public:
       
    27     virtual void HandleGoomMemoryReleased(TInt aStatus) = 0;
       
    28     };
       
    29 
       
    30 /**
       
    31  * class declaration
       
    32  */
       
    33 class CGlxRelaseGPUMemory : public CActive
       
    34     {
       
    35 public:
       
    36     /**
       
    37      * Two-phased constructor.
       
    38      */
       
    39     IMPORT_C
       
    40     static CGlxRelaseGPUMemory* NewL(MGoomNotifierObserver& aNotify);
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     static CGlxRelaseGPUMemory* NewLC(MGoomNotifierObserver& aNotify);
       
    46     /**
       
    47      * Destructor
       
    48      */
       
    49     ~CGlxRelaseGPUMemory();
       
    50     /*
       
    51      * Start Memory release process
       
    52      */
       
    53     IMPORT_C void RequestMemory();
       
    54 private:
       
    55     /**
       
    56      * Default constructor
       
    57      */
       
    58     CGlxRelaseGPUMemory(MGoomNotifierObserver& aNotify);
       
    59     /**
       
    60      * By default Symbian 2nd phase constructor is private.
       
    61      */
       
    62     void ConstructL();
       
    63 
       
    64 private:
       
    65     /**
       
    66      * active object's default implelemtaions
       
    67      */
       
    68     void RunL();
       
    69     void DoCancel();
       
    70 
       
    71     /**
       
    72      * IssueRequest 
       
    73      */
       
    74     void IssueRequest();
       
    75 
       
    76 private:
       
    77     /**
       
    78      * reference of observer
       
    79      */
       
    80     MGoomNotifierObserver& iNotify;
       
    81     RGOomMonitorSession iGoom;
       
    82     TBool iIsFirstRequest;
       
    83     
       
    84 #ifdef _DEBUG
       
    85     TTime iStartTime;
       
    86     TTime iStopTime;
       
    87 #endif
       
    88 
       
    89     };
       
    90 
       
    91 #endif /* GLXREQUESTFREEGOOM_H_ */