perfmon/ui/hb/app/inc/datacontainer.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:32:02 +0300
changeset 15 e11368ed4880
permissions -rw-r--r--
Revision: 201016 Kit: 201018

/*
* Copyright (c) 2010 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: 
*
*/

#ifndef DATACONTAINER_H
#define DATACONTAINER_H

#include <hbwidget.h>
#include <enginewrapper.h>

class DataContainer : public HbWidget
{
    Q_OBJECT

public:
    DataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0) :
            HbWidget(parent),
            mEngine(engine)
    {
    }

    void hideContainer()
        {
        disconnect(&mEngine, SIGNAL(samplesUpdated()), this, SLOT(samplesUpdated()));
        hide();
        }
    
    void showContainer()
        {
        connect(&mEngine, SIGNAL(samplesUpdated()),this, SLOT(samplesUpdated()));
        show();
        }
    
    inline const EngineWrapper& engine() const { return mEngine; }

public slots:
    virtual void samplesUpdated()
    {
    update();
    }

private:
    const EngineWrapper& mEngine;
};

#endif // DATACONTAINER_H