camerauis/cameraxui/cxengine/inc/api/cxememorymonitor.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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 CXEMEMORYMONITOR_H
       
    19 #define CXEMEMORYMONITOR_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 class CxeFeatureManager;
       
    24 class CxeMemoryMonitorPrivate;
       
    25 
       
    26 /*!
       
    27 * Memory monitor class.
       
    28 * Memory monitor requests a pre-defined value of startup memory
       
    29 * at the time it is created, and throws error if it cannot get
       
    30 * enough memory freed. After creating, it can be set to monitor
       
    31 * free memory and try to keep it above pre-defined level.
       
    32 * Pre-defined levels are read from Feature Manager.
       
    33 */
       
    34 class CxeMemoryMonitor : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39     explicit CxeMemoryMonitor(CxeFeatureManager &features);
       
    40     ~CxeMemoryMonitor();
       
    41 
       
    42 public:
       
    43     int free() const;
       
    44 
       
    45 public slots:
       
    46     void startMonitoring();
       
    47     void stopMonitoring();
       
    48 
       
    49 private:
       
    50     bool requestFreeMemory(int requiredFreeMemory);
       
    51 
       
    52 private:
       
    53     CxeMemoryMonitorPrivate *p;
       
    54 };
       
    55 
       
    56 #endif // CXEMEMORYMONITOR_H
       
    57