camerauis/cameraxui/cxengine/inc/cxememorymonitorprivate.h
changeset 28 3075d9b614e6
child 29 699651f2666f
equal deleted inserted replaced
19:d9aefe59d544 28:3075d9b614e6
       
     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 CXEMEMORYMONITORPRIVATE_H
       
    19 #define CXEMEMORYMONITORPRIVATE_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QTimer>
       
    23 #include <QList>
       
    24 #ifdef Q_OS_SYMBIAN
       
    25 #include <oommonitorsession.h>
       
    26 #endif // Q_OS_SYMBIAN
       
    27 
       
    28 class CxeFeatureManager;
       
    29 
       
    30 class CxeMemoryMonitorPrivate : public QObject
       
    31 {
       
    32     Q_OBJECT
       
    33 
       
    34     // Owner of this private implementation.
       
    35     friend class CxeMemoryMonitor;
       
    36 
       
    37 private:
       
    38     explicit CxeMemoryMonitorPrivate(CxeFeatureManager &features);
       
    39     ~CxeMemoryMonitorPrivate();
       
    40 
       
    41 private:
       
    42     int free() const;
       
    43     bool requestFreeMemory(int requiredFreeMemory);
       
    44 
       
    45     void startMonitoring();
       
    46     void stopMonitoring();
       
    47 
       
    48 private slots:
       
    49     void checkMemory();
       
    50 
       
    51 private:
       
    52     CxeFeatureManager &mFeatures;
       
    53     QTimer mTimer;
       
    54     QList<int> mLevels;
       
    55 #ifdef Q_OS_SYMBIAN
       
    56     ROomMonitorSession mOomMonitor;
       
    57 #endif // Q_OS_SYMBIAN
       
    58 };
       
    59 
       
    60 #endif // CXEMEMORYMONITORPRIVATE_H
       
    61